Bug 1621273 - Value attribute changes can affect step validity even if the input value doesn't change. r=smaug
If the actual input value didn't change, we'd skip updating form validity, but that's not always correct because GetStepBase() depends on the value attribute. Differential Revision: https://phabricator.services.mozilla.com/D66836
This commit is contained in:
@@ -1193,9 +1193,13 @@ nsresult HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
// of the element so, if the value of the element is different than @value,
|
||||
// we have to re-set it. This is only the case when GetValueMode() returns
|
||||
// VALUE_MODE_VALUE.
|
||||
if (aName == nsGkAtoms::value && !mValueChanged &&
|
||||
GetValueMode() == VALUE_MODE_VALUE) {
|
||||
SetDefaultValueAsValue();
|
||||
if (aName == nsGkAtoms::value) {
|
||||
if (!mValueChanged && GetValueMode() == VALUE_MODE_VALUE) {
|
||||
SetDefaultValueAsValue();
|
||||
}
|
||||
// GetStepBase() depends on the `value` attribute if `min` is not present,
|
||||
// even if the value doesn't change.
|
||||
UpdateStepMismatchValidityState();
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user