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

Unified Diff: third_party/WebKit/Source/core/html/forms/MonthInputType.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/MonthInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp b/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp
index 1f038c798988ebc23579cfc04fc5c6bb57144424..37c8503ab6344ed0bc0e21dc43d85544e43c3adb 100644
--- a/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp
@@ -127,6 +127,12 @@ bool MonthInputType::canSetSuggestedValue()
return true;
}
+void MonthInputType::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\" where yyyy is year in four or more digits, and MM is 01-12.", value);
+}
+
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
String MonthInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
{
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/MonthInputType.h ('k') | third_party/WebKit/Source/core/html/forms/WeekInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698