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

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

Issue 2774723004: Update :in-range/:out-of-range when steppable min/max/value changes. (Closed)
Patch Set: Moved code to InputType class. Created 3 years, 9 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 6ef98db166c4461008c18ea222ca89ac575f4134..aa2e7b463c2cf68f0db1e721280371b7e1d6596b 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -726,6 +726,7 @@ void HTMLInputElement::parseAttribute(
setNeedsValidityCheck();
m_valueAttributeWasUpdatedAfterParsing = !m_parsingInProgress;
m_inputType->warnIfValueIsInvalidAndElementIsVisible(value);
+ m_inputType->inRangeChanged();
m_inputTypeView->valueAttributeChanged();
} else if (name == checkedAttr) {
// Another radio button in the same group might be checked by state
@@ -770,11 +771,13 @@ void HTMLInputElement::parseAttribute(
} else if (name == minAttr) {
m_inputTypeView->minOrMaxAttributeChanged();
m_inputType->sanitizeValueInResponseToMinOrMaxAttributeChange();
+ m_inputType->inRangeChanged();
setNeedsValidityCheck();
UseCounter::count(document(), UseCounter::MinAttribute);
} else if (name == maxAttr) {
m_inputTypeView->minOrMaxAttributeChanged();
m_inputType->sanitizeValueInResponseToMinOrMaxAttributeChange();
+ m_inputType->inRangeChanged();
setNeedsValidityCheck();
UseCounter::count(document(), UseCounter::MaxAttribute);
} else if (name == multipleAttr) {
@@ -1099,10 +1102,7 @@ void HTMLInputElement::setNonAttributeValue(const String& sanitizedValue) {
m_nonAttributeValue = sanitizedValue;
m_hasDirtyValue = true;
setNeedsValidityCheck();
- if (m_inputType->isSteppable()) {
- pseudoStateChanged(CSSSelector::PseudoInRange);
- pseudoStateChanged(CSSSelector::PseudoOutOfRange);
- }
+ m_inputType->inRangeChanged();
}
void HTMLInputElement::setNonDirtyValue(const String& newValue) {
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp ('k') | third_party/WebKit/Source/core/html/forms/InputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698