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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLabelElement.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
Index: third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
index 0268776b4023981f52e778710c3ce24c0467b644..c32e3b8dd48d25f33c35c4df5c3434074d646405 100644
--- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
@@ -186,7 +186,7 @@ void HTMLLabelElement::defaultEventHandler(Event* evt)
// In case of double click or triple click, selection will be there,
// so do not focus the control element.
if (!isLabelTextSelected)
- element->focus(true, WebFocusTypeMouse);
+ element->focus(FocusParams(SelectionBehaviorOnFocus::Restore, WebFocusTypeMouse, nullptr));
}
// Click the corresponding control.
@@ -208,13 +208,13 @@ bool HTMLLabelElement::willRespondToMouseClickEvents()
return HTMLElement::willRespondToMouseClickEvents();
}
-void HTMLLabelElement::focus(bool, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
+void HTMLLabelElement::focus(const FocusParams& params)
{
// to match other browsers, always restore previous selection
if (HTMLElement* element = control())
- element->focus(true, type, sourceCapabilities);
+ element->focus(FocusParams(SelectionBehaviorOnFocus::Restore, params.type, params.sourceCapabilities));
if (isFocusable())
- HTMLElement::focus(true, type, sourceCapabilities);
+ HTMLElement::focus(params);
}
void HTMLLabelElement::accessKeyAction(bool sendMouseEvents)
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLabelElement.h ('k') | third_party/WebKit/Source/core/html/HTMLLegendElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698