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

Unified Diff: third_party/WebKit/Source/core/page/FocusController.cpp

Issue 2153063003: Should not call FocusController::setFocusedFrame() for detached frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for comment #26 Created 4 years, 5 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/dom/Selection/selection-crash.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/page/FocusController.cpp
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
index c7d11a226f30bdcff86214c2462d43f70a5ee4cc..9ec49ab3ac17cf3e90a38db115f94786029d39fc 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -772,6 +772,11 @@ void FocusController::focusDocumentView(Frame* frame, bool notifyEmbedder)
dispatchFocusEvent(*document, *focusedElement);
}
+ // dispatchBlurEvent/dispatchFocusEvent could have changed the focused frame, or
+ // detached the frame.
+ if (newFocusedFrame && !newFocusedFrame->view())
+ return;
+
setFocusedFrame(frame, notifyEmbedder);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/Selection/selection-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698