Index: Source/core/html/forms/DateInputType.cpp |
diff --git a/Source/core/html/forms/DateInputType.cpp b/Source/core/html/forms/DateInputType.cpp |
index 98146284ba2fff0243604b476e33a93fe3254a57..5bfe2c320b012405e31b22d28ac0c539ecb67f55 100644 |
--- a/Source/core/html/forms/DateInputType.cpp |
+++ b/Source/core/html/forms/DateInputType.cpp |
@@ -33,6 +33,7 @@ |
#include "core/HTMLNames.h" |
#include "core/InputTypeNames.h" |
+#include "core/dom/Document.h" |
#include "core/html/HTMLInputElement.h" |
#include "core/html/forms/DateTimeFieldsState.h" |
#include "platform/DateComponents.h" |
@@ -93,6 +94,14 @@ bool DateInputType::isDateField() const |
return true; |
} |
+void DateInputType::warnIfValueIsInvalid(const String& value) const |
+{ |
+ if (value != element().sanitizeValue(value)) { |
+ element().document().addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, ErrorMessageLevel, |
+ String::format("The specified value '%s' does not conform to the required format, 'yyyy-MM-dd'.", value.utf8().data()))); |
+ } |
+} |
+ |
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
String DateInputType::formatDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState) const |
{ |