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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1704333002: Do not use Node in FocusController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split a CL 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/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 917872c7b405c75bd4f234396c0fcd417ddc116c..55c6af53a347d9b75e65a5db4eb315875cff7f62 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -1716,10 +1716,10 @@ bool EventHandler::slideFocusOnShadowHostIfNecessary(const Element& element)
// If the host has a focusable inner element, focus it. Otherwise, the host takes focus.
Page* page = m_frame->page();
ASSERT(page);
- Element* next = page->focusController().findFocusableElement(WebFocusTypeForward, *element.authorShadowRoot());
- if (next && element.containsIncludingShadowDOM(next)) {
+ Element* found = page->focusController().findFocusableElementInShadowHost(element);
+ if (found && element.containsIncludingShadowDOM(found)) {
// Use WebFocusTypeForward instead of WebFocusTypeMouse here to mean the focus has slided.
- next->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTypeForward, nullptr));
+ found->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTypeForward, nullptr));
return true;
}
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/page/FocusController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698