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

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

Issue 1420693006: Introduce a struct to store arguments of Element::focus(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/html/HTMLAreaElement.h » ('j') | 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 6caa4218ca71bc24056790b0f67a55005f2d7a64..ff7212a3bdf054348ee7cc6bb8a600ca1b482ea5 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2348,7 +2348,7 @@ bool Element::hasAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
return elementData()->attributes().find(qName);
}
-void Element::focus(bool restorePreviousSelection, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
+void Element::focus(const FocusParams& params)
{
if (!inDocument())
return;
@@ -2370,13 +2370,13 @@ void Element::focus(bool restorePreviousSelection, WebFocusType type, InputDevic
// Slide the focus to its inner node.
Element* next = document().page()->focusController().findFocusableElement(WebFocusTypeForward, *this);
if (next && containsIncludingShadowDOM(next)) {
- next->focus(false, WebFocusTypeForward);
+ next->focus(FocusParams(SelectionBehaviorOnFocus::Reset, WebFocusTypeForward, nullptr));
return;
}
}
RefPtrWillBeRawPtr<Node> protect(this);
- if (!document().page()->focusController().setFocusedElement(this, document().frame(), type, sourceCapabilities))
+ if (!document().page()->focusController().setFocusedElement(this, document().frame(), params.type, params.sourceCapabilities))
return;
// Setting the focused node above might have invalidated the layout due to scripts.
@@ -2385,7 +2385,7 @@ void Element::focus(bool restorePreviousSelection, WebFocusType type, InputDevic
return;
cancelFocusAppearanceUpdate();
- updateFocusAppearance(restorePreviousSelection);
+ updateFocusAppearance(params.selectionBehavior);
if (UserGestureIndicator::processedUserGestureSinceLoad()) {
// Bring up the keyboard in the context of anything triggered by a user
@@ -2396,7 +2396,7 @@ void Element::focus(bool restorePreviousSelection, WebFocusType type, InputDevic
}
}
-void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
+void Element::updateFocusAppearance(SelectionBehaviorOnFocus)
{
if (isRootEditableElement()) {
// Taking the ownership since setSelection() may release the last reference to |frame|.
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/html/HTMLAreaElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698