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/BaseChooserOnlyDateAndTimeInputType.cpp

Issue 23623017: Prepare for date/time input datalist support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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/BaseChooserOnlyDateAndTimeInputType.cpp
diff --git a/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp b/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
index 21d39a3312da26d7f03785b02abb83a62d036d86..83bfde6655a8b403a9bf434ddcc8ed46a77b9180 100644
--- a/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
@@ -97,6 +97,14 @@ void BaseChooserOnlyDateAndTimeInputType::didChooseValue(const String& value)
element().setValue(value, DispatchInputAndChangeEvent);
}
+void BaseChooserOnlyDateAndTimeInputType::didChooseValue(double value)
+{
+ if (std::isnan(value))
+ element().setValue(String(), DispatchInputAndChangeEvent);
tkent 2013/11/07 01:43:10 Are you sure this should be null string, not empty
+ else
+ element().setValueAsNumber(value, ASSERT_NO_EXCEPTION, DispatchInputAndChangeEvent);
+}
+
void BaseChooserOnlyDateAndTimeInputType::didEndChooser()
{
m_dateTimeChooser.clear();

Powered by Google App Engine
This is Rietveld 408576698