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

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

Issue 2692423006: Fix stale focusedElement in unloaded document. (Closed)
Patch Set: Check nullptr. Created 3 years, 10 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 | « third_party/WebKit/LayoutTests/fast/loader/crash-focus-in-unload.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 8e073759aa47850e3b1d3b95e5e5afa1f02ab70e..4b146314627f4c71e8e39040cffaf7eb002c7094 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2644,6 +2644,11 @@ void Element::focus(const FocusParams& params) {
if (!document().isActive())
return;
+ if (isFrameOwnerElement() &&
+ toHTMLFrameOwnerElement(this)->contentDocument() &&
+ toHTMLFrameOwnerElement(this)->contentDocument()->unloadStarted())
+ return;
+
document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
if (!isFocusable())
return;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/loader/crash-focus-in-unload.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698