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

Unified Diff: third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp

Issue 1742443003: input[type=datetime-local], input[type=month] and input[type=week] warn if a specified value is an … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
index 243f53cfb11ae8677814452d6fbea12645c22156..536df8012e64a9992ecc38529ec31d3ac5a09b2e 100644
--- a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
@@ -107,6 +107,12 @@ String DateTimeLocalInputType::localizeValue(const String& proposedValue) const
return localized.isEmpty() ? proposedValue : localized;
}
+void DateTimeLocalInputType::warnIfValueIsInvalid(const String& value) const
+{
+ if (value != element().sanitizeValue(value))
+ addWarningToConsole("The specified value %s does not conform to the required format. The format is \"yyyy-MM-ddThh:mm\" followed by optional \":ss\" or \":ss.SSS\".", value);
+}
+
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
// FIXME: It is better to share code for DateTimeInputType::formatDateTimeFieldsState()
// and DateTimeInputLocalType::formatDateTimeFieldsState().

Powered by Google App Engine
This is Rietveld 408576698