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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2589913002: Clear the owner element's widget in Document::shutdown(). (Closed)
Patch Set: Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698