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

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

Issue 435753003: Implement minlength for <input> and <textarea>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add support for minlength in remaining places and stop clasping it with maxlength Created 6 years, 2 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: Source/core/html/forms/InputType.cpp
diff --git a/Source/core/html/forms/InputType.cpp b/Source/core/html/forms/InputType.cpp
index 27d69d87471e9b92722ef3773c1e1286a022f858..40060d0c4cf8d29cb3bfbd2146220f947c98cb14 100644
--- a/Source/core/html/forms/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -239,6 +239,11 @@ bool InputType::tooLong(const String&, HTMLTextFormControlElement::NeedsToCheckD
return false;
}
+bool InputType::tooShort(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFlag) const
+{
+ return false;
+}
+
bool InputType::patternMismatch(const String&) const
{
return false;
@@ -370,6 +375,11 @@ String InputType::validationMessage() const
if (element().tooLong())
return locale().validationMessageTooLongText(value.length(), element().maxLength());
+ if (element().tooShort())
+ return "Too short"; // DO NOT CHECK IN!!!
keishi 2014/10/06 03:58:23 We don't need this comment. "check in" in Blink pr
Bartek Nowierski 2014/10/06 13:18:16 That was just a note to self and to the reviewer t
+ // TODO(bartekn): Add a localized message for tooShort().
+ // return locale().validationMessageTooShortText(value().length(), element.minLength());
keishi 2014/10/06 03:58:23 We don't need this line. Blink doesn't keep code i
Bartek Nowierski 2014/10/06 13:18:16 Similarly here, this wasn't meant to be submitted
+
if (!isSteppable())
return emptyString();
« Source/core/html/HTMLTextAreaElement.cpp ('K') | « Source/core/html/forms/InputType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698