| Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
|
| index 862c3d8c5672d499912098c23b55bd2befce50c4..99c2ba7ddb76a7e110bcb004190419526a64f83a 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
|
| @@ -151,46 +151,8 @@ LayoutBlock::~LayoutBlock()
|
|
|
| void LayoutBlock::willBeDestroyed()
|
| {
|
| - // Mark as being destroyed to avoid trouble with merges in removeChild().
|
| - m_beingDestroyed = true;
|
| -
|
| - // Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will
|
| - // properly dirty line boxes that they are removed from. Effects that do :before/:after only on hover could crash otherwise.
|
| - children()->destroyLeftoverChildren();
|
| -
|
| - // Destroy our continuation before anything other than anonymous children.
|
| - // The reason we don't destroy it before anonymous children is that they may
|
| - // have continuations of their own that are anonymous children of our continuation.
|
| - LayoutBoxModelObject* continuation = this->continuation();
|
| - if (continuation) {
|
| - continuation->destroy();
|
| - setContinuation(nullptr);
|
| - }
|
| -
|
| - if (!documentBeingDestroyed()) {
|
| - if (firstLineBox()) {
|
| - // We can't wait for LayoutBox::destroy to clear the selection,
|
| - // because by then we will have nuked the line boxes.
|
| - // FIXME: The FrameSelection should be responsible for this when it
|
| - // is notified of DOM mutations.
|
| - if (isSelectionBorder())
|
| - view()->clearSelection();
|
| -
|
| - // If we are an anonymous block, then our line boxes might have children
|
| - // that will outlast this block. In the non-anonymous block case those
|
| - // children will be destroyed by the time we return from this function.
|
| - if (isAnonymousBlock()) {
|
| - for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) {
|
| - while (InlineBox* childBox = box->firstChild())
|
| - childBox->remove();
|
| - }
|
| - }
|
| - } else if (parent()) {
|
| - parent()->dirtyLinesFromChangedChild(this);
|
| - }
|
| - }
|
| -
|
| - m_lineBoxes.deleteLineBoxes();
|
| + if (!documentBeingDestroyed() && parent())
|
| + parent()->dirtyLinesFromChangedChild(this);
|
|
|
| if (UNLIKELY(gDelayedUpdateScrollInfoSet != 0))
|
| gDelayedUpdateScrollInfoSet->remove(this);
|
|
|