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

Unified Diff: Source/core/html/forms/TextFieldInputType.cpp

Issue 196933006: Do not dispatch 'change' events during pressing spin buttons for input[type=number]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid extra change event Created 6 years, 9 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: Source/core/html/forms/TextFieldInputType.cpp
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
index 041d0307d823880aa98a8326103e359f9742e37a..6df7ed5462bbd1e17ce3caf529be6401946ebf15 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -212,6 +212,8 @@ void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
spinButtonStepDown();
else
return;
+ if (element().focused())
tkent 2014/03/18 08:26:20 Why is the focus check needed? It looks unnecessar
+ element().dispatchFormControlChangeEvent();
event->setDefaultHandled();
}
@@ -558,4 +560,12 @@ bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents()
return shouldSpinButtonRespondToMouseEvents() && element().focused();
}
+void TextFieldInputType::spinButtonDidReleaseMouseCapture()
+{
+ // Sending dispatch change event only when in focus,
+ // as when out of focus change event is triggered from setValue::DispatchChangeEvent.
+ if (element().focused())
tkent 2014/03/18 08:26:20 Ditto.
+ element().dispatchFormControlChangeEvent();
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698