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

Unified Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 9771001: Merge 110324 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 9 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/multicol/anonymous-block-split-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBlock.cpp
===================================================================
--- Source/WebCore/rendering/RenderBlock.cpp (revision 111424)
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -515,6 +515,7 @@
// Once we hit the anonymous columns block we're done.
RenderBoxModelObject* curr = toRenderBoxModelObject(parent());
RenderBoxModelObject* currChild = this;
+ RenderObject* currChildNextSibling = currChild->nextSibling();
while (curr && curr != fromBlock) {
ASSERT(curr->isRenderBlock());
@@ -541,15 +542,20 @@
// Someone may have indirectly caused a <q> to split. When this happens, the :after content
// has to move into the inline continuation. Call updateBeforeAfterContent to ensure that the inline's :after
// content gets properly destroyed.
+ bool isLastChild = (currChildNextSibling == blockCurr->lastChild());
if (document()->usesBeforeAfterRules())
blockCurr->children()->updateBeforeAfterContent(blockCurr, AFTER);
+ if (isLastChild && currChildNextSibling != blockCurr->lastChild())
+ currChildNextSibling = 0; // We destroyed the last child, so now we need to update
+ // the value of currChildNextSibling.
// Now we need to take all of the children starting from the first child
// *after* currChild and append them all to the clone.
- blockCurr->moveChildrenTo(cloneBlock, currChild->nextSibling(), 0, true);
+ blockCurr->moveChildrenTo(cloneBlock, currChildNextSibling, 0, true);
// Keep walking up the chain.
currChild = curr;
+ currChildNextSibling = currChild->nextSibling();
curr = toRenderBoxModelObject(curr->parent());
}
@@ -558,7 +564,7 @@
// Now take all the children after currChild and remove them from the fromBlock
// and put them in the toBlock.
- fromBlock->moveChildrenTo(toBlock, currChild->nextSibling(), 0, true);
+ fromBlock->moveChildrenTo(toBlock, currChildNextSibling, 0, true);
}
void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
« no previous file with comments | « LayoutTests/fast/multicol/anonymous-block-split-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698