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

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

Issue 2474323002: Implement WebContentsViewChildFrame::TakeFocus. (Closed)
Patch Set: Fix cases where focus does not actually advance focus Created 4 years, 1 month 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
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 e9723e85639f74c9dd7331209e829670966c32b4..03cd7e02be73f0350f8876180fa3275ecb854315 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -874,7 +874,9 @@ void FocusController::setFocused(bool focused) {
if (!m_isFocused && focusedOrMainFrame()->isLocalFrame())
toLocalFrame(focusedOrMainFrame())->eventHandler().stopAutoscroll();
- if (!m_focusedFrame)
+ // Do not set a focused frame when being unfocsed. This might reset focus to
alexmos 2016/11/28 23:52:24 nits: s/unfocsed/unfocused/ s/reset focus/reset m
+ // true.
+ if (!m_focusedFrame && m_isFocused)
setFocusedFrame(m_page->mainFrame());
// setFocusedFrame above might reject to update m_focusedFrame, or
« content/browser/web_contents/web_contents_impl.cc ('K') | « content/common/view_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698