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

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

Issue 62083004: Transfer date/time value to the chooser as a double (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@datetime3
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 62e7522ffc1087a65750a194a421ab259feb6d3b..eb68bca7a8c1d8ca54f42a84856cbf37cd7e87ea 100644
--- a/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
@@ -97,6 +97,15 @@ void BaseChooserOnlyDateAndTimeInputType::didChooseValue(const String& value)
element().setValue(value, DispatchInputAndChangeEvent);
}
+void BaseChooserOnlyDateAndTimeInputType::didChooseValue(double value)
+{
+ ASSERT(std::isfinite(value) || std::isnan(value));
+ if (std::isnan(value))
+ element().setValue(emptyString(), DispatchInputAndChangeEvent);
+ else
+ element().setValueAsNumber(value, ASSERT_NO_EXCEPTION, DispatchInputAndChangeEvent);
+}
+
void BaseChooserOnlyDateAndTimeInputType::didEndChooser()
{
m_dateTimeChooser.clear();

Powered by Google App Engine
This is Rietveld 408576698