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

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

Issue 10546039: Merge 119409 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 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/span/positioned-objects-not-removed-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 119645)
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -601,7 +601,13 @@
RenderBoxModelObject* curr = toRenderBoxModelObject(parent());
RenderBoxModelObject* currChild = this;
RenderObject* currChildNextSibling = currChild->nextSibling();
-
+ bool documentUsesBeforeAfterRules = document()->usesBeforeAfterRules();
+
+ // Note: |this| can be destroyed inside this loop if it is an empty anonymous
+ // block and we try to call updateBeforeAfterContent inside which removes the
+ // generated content and additionally cleans up |this| empty anonymous block.
+ // See RenderBlock::removeChild(). DO NOT reference any local variables to |this|
+ // after this point.
while (curr && curr != fromBlock) {
ASSERT(curr->isRenderBlock());
@@ -628,7 +634,7 @@
// 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())
+ if (documentUsesBeforeAfterRules)
blockCurr->children()->updateBeforeAfterContent(blockCurr, AFTER);
if (isLastChild && currChildNextSibling != blockCurr->lastChild())
currChildNextSibling = 0; // We destroyed the last child, so now we need to update
@@ -638,8 +644,7 @@
// Since we are doing layout anyway, it is easier to blow away the entire list, than
// traversing down the subtree looking for positioned children and then remove them
// from our positioned objects list.
- if (currChildNextSibling)
- blockCurr->removePositionedObjects(0);
+ blockCurr->removePositionedObjects(0);
// Now we need to take all of the children starting from the first child
// *after* currChild and append them all to the clone.
« no previous file with comments | « LayoutTests/fast/multicol/span/positioned-objects-not-removed-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698