Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1803)

Unified Diff: WebCore/rendering/RenderBlock.cpp

Issue 6192002: Merge 75090 - Merge 75082 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/block/merge-anonymous-block-remove-child-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/rendering/RenderBlock.cpp
===================================================================
--- WebCore/rendering/RenderBlock.cpp (revision 75418)
+++ WebCore/rendering/RenderBlock.cpp (working copy)
@@ -988,11 +988,25 @@
// Take all the children out of the |next| block and put them in
// the |prev| block.
nextBlock->moveAllChildrenTo(prevBlock, nextBlock->hasLayer() || prevBlock->hasLayer());
-
+
+ // FIXME: When we destroy nextBlock, it might happen that nextBlock's next sibling block and
+ // oldChild can get merged. Since oldChild is getting removed, we do not want to move
+ // nextBlock's next sibling block's children into it. By setting a fake continuation,
+ // we prevent this from happening.
+ RenderBlock* oldChildBlock = 0;
+ if (oldChild->isAnonymous() && oldChild->isRenderBlock() && !toRenderBlock(oldChild)->continuation()) {
+ oldChildBlock = toRenderBlock(oldChild);
+ oldChildBlock->setContinuation(oldChildBlock);
+ }
+
// Delete the now-empty block's lines and nuke it.
nextBlock->deleteLineBoxTree();
nextBlock->destroy();
next = 0;
+
+ // FIXME: Revert the continuation change done above.
+ if (oldChildBlock)
+ oldChildBlock->setContinuation(0);
}
}
« no previous file with comments | « LayoutTests/fast/block/merge-anonymous-block-remove-child-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698