Index: Source/WebCore/rendering/RenderBlock.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderBlock.cpp (revision 126673) |
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) |
@@ -1145,15 +1145,21 @@ |
RenderBlock* anonBlock = toRenderBlock(parent->children()->removeChildNode(parent, child, child->hasLayer())); |
anonBlock->moveAllChildrenTo(parent, nextSibling, child->hasLayer()); |
// Delete the now-empty block's lines and nuke it. |
- if (!parent->documentBeingDestroyed()) |
- anonBlock->deleteLineBoxTree(); |
- if (!parent->documentBeingDestroyed() && childFlowThread && childFlowThread->isRenderNamedFlowThread()) |
+ anonBlock->deleteLineBoxTree(); |
+ if (childFlowThread && childFlowThread->isRenderNamedFlowThread()) |
toRenderNamedFlowThread(childFlowThread)->removeFlowChildInfo(anonBlock); |
anonBlock->destroy(); |
} |
void RenderBlock::removeChild(RenderObject* oldChild) |
{ |
+ // No need to waste time in merging or removing empty anonymous blocks. |
+ // We can just bail out if our document is getting destroyed. |
+ if (documentBeingDestroyed()) { |
+ RenderBox::removeChild(oldChild); |
+ return; |
+ } |
+ |
// If this child is a block, and if our previous and next siblings are |
// both anonymous blocks with inline content, then we can go ahead and |
// fold the inline content back together. |
@@ -1223,7 +1229,7 @@ |
} |
} |
- if (!firstChild() && !documentBeingDestroyed()) { |
+ if (!firstChild()) { |
// If this was our last child be sure to clear out our line boxes. |
if (childrenInline()) |
deleteLineBoxTree(); |