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

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

Issue 1718153002: Implement 'sequential focus navigation starting point.' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actual fix for non-oilpan test failures Created 4 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
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 4617e58fbc64fcb03ecdc1167f5bc3041d6d51b2..b01d38e406e245f49f5ffa98f3586dea29f4d540 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -743,7 +743,7 @@ bool FocusController::advanceFocusInDocumentOrder(LocalFrame* frame, Element* st
Element* current = start;
if (!current)
- current = document->focusedElement();
+ current = document->sequentialFocusNavigationStartingPoint(type);
// FIXME: Not quite correct when it comes to focus transitions leaving/entering the WebView itself
bool caretBrowsing = frame->settings() && frame->settings()->caretBrowsingEnabled();
@@ -760,6 +760,7 @@ bool FocusController::advanceFocusInDocumentOrder(LocalFrame* frame, Element* st
// searching for focusable elements there.
if (frame->localFrameRoot() != frame->tree().top()) {
document->clearFocusedElement();
+ document->setSequentialFocusNavigationStartingPoint(nullptr);
toRemoteFrame(frame->localFrameRoot()->tree().parent())->advanceFocus(type, frame->localFrameRoot());
return true;
}
@@ -767,6 +768,7 @@ bool FocusController::advanceFocusInDocumentOrder(LocalFrame* frame, Element* st
// We didn't find an element to focus, so we should try to pass focus to Chrome.
if (!initialFocus && m_page->chromeClient().canTakeFocus(type)) {
document->clearFocusedElement();
+ document->setSequentialFocusNavigationStartingPoint(nullptr);
setFocusedFrame(nullptr);
m_page->chromeClient().takeFocus(type);
return true;

Powered by Google App Engine
This is Rietveld 408576698