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

Unified Diff: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 1615003002: Fix behavior of HTMLInputElement.maxLength/minLength getter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V2 Created 4 years, 11 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/HTMLInputElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
index 03cba21d8ca1fabba0b517620be266004b48713b..069b9eb551169471220e70ce8cd18b4cfd988937 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -1355,11 +1355,15 @@ const AtomicString& HTMLInputElement::alt() const
int HTMLInputElement::maxLength() const
{
+ if (!hasAttribute(maxlengthAttr))
+ return -1;
return m_maxLength;
}
int HTMLInputElement::minLength() const
{
+ if (!hasAttribute(minlengthAttr))
+ return -1;
return m_minLength;
}

Powered by Google App Engine
This is Rietveld 408576698