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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2678683002: Delay instantiating InputDeviceCapabilities until accessed. (Closed)
Patch Set: rebased Created 3 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/html/HTMLSelectElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
index bed8a4861b457aaf261e40493bf06a0e71d1e801..53af13e9f1ca42e75c78503e33780badc41ec4ae 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
@@ -1050,7 +1050,7 @@ void HTMLSelectElement::selectOption(HTMLOptionElement* element,
void HTMLSelectElement::dispatchFocusEvent(
Element* oldFocusedElement,
WebFocusType type,
- InputDeviceCapabilities* sourceCapabilities) {
+ const InputDeviceCapabilitiesValue& sourceCapabilities) {
// Save the selection so it can be compared to the new selection when
// dispatching change events during blur event dispatch.
if (usesMenuList())
@@ -1062,7 +1062,7 @@ void HTMLSelectElement::dispatchFocusEvent(
void HTMLSelectElement::dispatchBlurEvent(
Element* newFocusedElement,
WebFocusType type,
- InputDeviceCapabilities* sourceCapabilities) {
+ const InputDeviceCapabilitiesValue& sourceCapabilities) {
m_typeAhead.resetSession();
// We only need to fire change events here for menu lists, because we fire
// change events for list boxes whenever the selection change is actually
@@ -1351,9 +1351,8 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event) {
if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() &&
toMouseEvent(event)->button() ==
static_cast<short>(WebPointerProperties::Button::Left)) {
- InputDeviceCapabilities* sourceCapabilities =
- document().domWindow()->getInputDeviceCapabilities()->firesTouchEvents(
- toMouseEvent(event)->fromTouch());
+ InputDeviceCapabilitiesValue sourceCapabilities =
+ InputDeviceCapabilitiesValue(toMouseEvent(event)->fromTouch());
focus(FocusParams(SelectionBehaviorOnFocus::Restore, WebFocusTypeNone,
sourceCapabilities));
if (layoutObject() && layoutObject()->isMenuList() &&
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.h ('k') | third_party/WebKit/Source/core/html/TextControlElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698