Index: Source/WebCore/rendering/RenderFullScreen.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderFullScreen.cpp (revision 126658) |
+++ Source/WebCore/rendering/RenderFullScreen.cpp (working copy) |
@@ -117,9 +117,20 @@ |
// |object->parent()| can be null if the object is not yet attached |
// to |parent|. |
if (RenderObject* parent = object->parent()) { |
+ RenderBlock* containingBlock = object->containingBlock(); |
+ ASSERT(containingBlock); |
+ // Since we are moving the |object| to a new parent |fullscreenRenderer|, |
+ // the line box tree underneath our |containingBlock| is not longer valid. |
+ containingBlock->deleteLineBoxTree(); |
+ |
parent->addChild(fullscreenRenderer, object); |
object->remove(); |
+ |
+ // Always just do a full layout to ensure that line boxes get deleted properly. |
+ // Because objects moved from |parent| to |fullscreenRenderer|, we want to |
+ // make new line boxes instead of leaving the old ones around. |
parent->setNeedsLayoutAndPrefWidthsRecalc(); |
+ containingBlock->setNeedsLayoutAndPrefWidthsRecalc(); |
} |
fullscreenRenderer->addChild(object); |
fullscreenRenderer->setNeedsLayoutAndPrefWidthsRecalc(); |