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

Unified Diff: Source/core/html/HTMLInputElement.h

Issue 435753003: Implement minlength for <input> and <textarea>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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/HTMLInputElement.h
diff --git a/Source/core/html/HTMLInputElement.h b/Source/core/html/HTMLInputElement.h
index 10940efc70991f43f5c2e6f1dc6612eaf396e0db..ae74e23c679d9de6b9344b060990396b01940f9a 100644
--- a/Source/core/html/HTMLInputElement.h
+++ b/Source/core/html/HTMLInputElement.h
@@ -61,6 +61,7 @@ public:
virtual bool rangeOverflow() const OVERRIDE FINAL;
virtual bool stepMismatch() const OVERRIDE FINAL;
virtual bool tooLong() const OVERRIDE FINAL;
+ virtual bool tooShort() const OVERRIDE FINAL;
virtual bool typeMismatch() const OVERRIDE FINAL;
virtual bool valueMissing() const OVERRIDE FINAL;
virtual String validationMessage() const OVERRIDE FINAL;
@@ -192,7 +193,9 @@ public:
KURL src() const;
int maxLength() const;
+ int minLength() const;
void setMaxLength(int, ExceptionState&);
+ void setMinLength(int, ExceptionState&);
bool multiple() const;
@@ -339,6 +342,7 @@ private:
bool isTextType() const;
bool tooLong(const String&, NeedsToCheckDirtyFlag) const;
+ bool tooShort(const String&, NeedsToCheckDirtyFlag) const;
virtual bool supportsPlaceholder() const OVERRIDE FINAL;
virtual void updatePlaceholderText() OVERRIDE FINAL;
@@ -359,6 +363,7 @@ private:
void setListAttributeTargetObserver(PassOwnPtrWillBeRawPtr<ListAttributeTargetObserver>);
void resetListAttributeTargetObserver();
void parseMaxLengthAttribute(const AtomicString&);
+ void parseMinLengthAttribute(const AtomicString&);
void updateValueIfNeeded();
// Returns null if this isn't associated with any radio button group.
@@ -376,6 +381,7 @@ private:
String m_suggestedValue;
int m_size;
int m_maxLength;
+ int m_minLength;
short m_maxResults;
bool m_isChecked : 1;
bool m_reflectsCheckedAttribute : 1;

Powered by Google App Engine
This is Rietveld 408576698