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

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

Issue 228633003: Do not dispatch change event when pressing spin button for input type=datetime (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Detach handling for DateTime field 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
Index: Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
diff --git a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
index b1be6db2599347e8fb04120712fc2f6aa1dce33e..5a35bc2c7a42a50e4ac2456bbb1b3ca67cec5eff 100644
--- a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -161,6 +161,8 @@ void BaseMultipleFieldsDateAndTimeInputType::didBlurFromControl()
RefPtr<HTMLInputElement> protector(element());
// Remove focus ring by CSS "focus" pseudo class.
element().setFocus(false);
+ if (SpinButtonElement *spinButton = spinButtonElement())
+ spinButton->releaseCapture();
}
void BaseMultipleFieldsDateAndTimeInputType::didFocusOnControl()
@@ -187,7 +189,6 @@ void BaseMultipleFieldsDateAndTimeInputType::editControlValueChanged()
input->setValueInternal(newValue, DispatchNoEvent);
input->setNeedsStyleRecalc(SubtreeStyleChange);
input->dispatchFormControlInputEvent();
- input->dispatchFormControlChangeEvent();
}
input->notifyFormStateChanged();
input->updateClearButtonVisibility();
@@ -264,6 +265,7 @@ void BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorChooseValue(const St
unsigned end;
if (date.parseDate(value, 0, end) && end == value.length())
edit->setOnlyYearMonthDay(date);
+ element().dispatchFormControlChangeEvent();
}
void BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorChooseValue(double value)
@@ -441,6 +443,11 @@ AtomicString BaseMultipleFieldsDateAndTimeInputType::localeIdentifier() const
return element().computeInheritedLanguage();
}
+void BaseMultipleFieldsDateAndTimeInputType::editControlDidChangeValueByKeyboard()
+{
+ element().dispatchFormControlChangeEvent();
+}
+
void BaseMultipleFieldsDateAndTimeInputType::minOrMaxAttributeChanged()
{
updateView();
« no previous file with comments | « Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h ('k') | Source/core/html/shadow/DateTimeEditElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698