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

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: Test code updated Created 6 years, 8 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
« no previous file with comments | « Source/core/html/forms/TextFieldInputType.h ('k') | Source/core/html/shadow/SpinButtonElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4b03d211796c6000a83c1e97a066e5a2d5e9271f 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -212,6 +212,7 @@ void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
spinButtonStepDown();
else
return;
+ element().dispatchFormControlChangeEvent();
event->setDefaultHandled();
}
@@ -254,6 +255,8 @@ void TextFieldInputType::handleBlurEvent()
{
InputType::handleBlurEvent();
element().endEditing();
+ if (SpinButtonElement *spinButton = spinButtonElement())
+ spinButton->releaseCapture();
}
bool TextFieldInputType::shouldSubmitImplicitly(Event* event)
@@ -558,4 +561,9 @@ bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents()
return shouldSpinButtonRespondToMouseEvents() && element().focused();
}
+void TextFieldInputType::spinButtonDidReleaseMouseCapture()
+{
+ element().dispatchFormControlChangeEvent();
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/html/forms/TextFieldInputType.h ('k') | Source/core/html/shadow/SpinButtonElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698