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

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: Replaced detach functionality when input loses focus 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..aa60f4e3a43e589fb7042f7a434e51e6aafeafa7 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -186,7 +186,7 @@ void TextFieldInputType::setValue(const String& sanitizedValue, bool valueChange
break;
}
- if (!input->focused())
+ if (!input->focused() && eventBehavior != DispatchNoEvent)
tkent 2014/04/04 01:31:46 I think this change will make an incompatible beha
Habib Virji 2014/04/04 09:24:05 Done.
input->setTextAsOfLastFormControlChangeEvent(sanitizedValue);
}
@@ -212,6 +212,7 @@ void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
spinButtonStepDown();
else
return;
+ element().dispatchFormControlChangeEvent();
event->setDefaultHandled();
}
@@ -558,4 +559,9 @@ bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents()
return shouldSpinButtonRespondToMouseEvents() && element().focused();
}
+void TextFieldInputType::spinButtonDidReleaseMouseCapture()
+{
+ element().dispatchFormControlChangeEvent();
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698