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

Unified Diff: third_party/WebKit/Source/core/html/forms/WeekInputType.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
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/WeekInputType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/WeekInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp b/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp
index d32765ff52c63578fce176a79230c2bb69bce196..8acd1e3cd6287a46ba783cf82345e625d5c4b675 100644
--- a/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp
@@ -82,6 +82,11 @@ bool WeekInputType::setMillisecondToDateComponents(double value, DateComponents*
return date->setMillisecondsSinceEpochForWeek(value);
}
+void WeekInputType::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-Www\" where yyyy is year in four or more digits, and ww is 01-53.", value);
+}
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
String WeekInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/WeekInputType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698