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

Unified Diff: Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp

Issue 12047073: Merge 140324 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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 | « LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp
===================================================================
--- Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp (revision 140648)
+++ Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp (working copy)
@@ -73,10 +73,17 @@
void BaseMultipleFieldsDateAndTimeInputType::editControlValueChanged()
{
RefPtr<HTMLInputElement> input(element());
- input->setValueInternal(sanitizeValue(m_dateTimeEditElement->value()), DispatchNoEvent);
- input->setNeedsStyleRecalc();
- input->dispatchFormControlInputEvent();
- input->dispatchFormControlChangeEvent();
+ String oldValue = input->value();
+ String newValue = sanitizeValue(m_dateTimeEditElement->value());
+ // Even if oldValue is null and newValue is "", we should assume they are same.
+ if ((oldValue.isEmpty() && newValue.isEmpty()) || oldValue == newValue)
+ input->setNeedsValidityCheck();
+ else {
+ input->setValueInternal(newValue, DispatchNoEvent);
+ input->setNeedsStyleRecalc();
+ input->dispatchFormControlInputEvent();
+ input->dispatchFormControlChangeEvent();
+ }
input->notifyFormStateChanged();
}
« no previous file with comments | « LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698