| Index: third_party/WebKit/Source/core/dom/Document.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
| index d7d8493ccc0e354f08537c70b3e89f1edb859c97..cf334c632cc6a7d36823dc31994965e38fe00223 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -2326,6 +2326,15 @@ void Document::shutdown() {
|
| ScriptForbiddenScope forbidScript;
|
|
|
| view()->dispose();
|
| +
|
| + // If the widget of the document's frame owner doesn't match view() then
|
| + // FrameView::dispose() didn't clear the owner's widget. If we don't clear it
|
| + // here, it may be clobbered later in LocalFrame::createView(). See also
|
| + // https://crbug.com/673170 and the comment in FrameView::dispose().
|
| + HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
|
| + if (ownerElement)
|
| + ownerElement->setWidget(nullptr);
|
| +
|
| m_markers->prepareForDestruction();
|
|
|
| m_lifecycle.advanceTo(DocumentLifecycle::Stopping);
|
|
|