This commit is contained in:
Cameron Kaiser
2017-10-16 21:35:53 -07:00
parent b8ebae8398
commit 84bfb83b16
14 changed files with 198 additions and 87 deletions
+12 -1
View File
@@ -113,9 +113,14 @@ HTMLButtonElement::UpdateBarredFromConstraintValidation()
void
HTMLButtonElement::FieldSetDisabledChanged(bool aNotify)
{
UpdateBarredFromConstraintValidation();
// FieldSetDisabledChanged *has* to be called *before*
// UpdateBarredFromConstraintValidation, because the latter depends on our
// disabled state.
nsGenericHTMLFormElementWithState::FieldSetDisabledChanged(aNotify);
UpdateBarredFromConstraintValidation();
UpdateState(aNotify);
}
// nsIDOMHTMLButtonElement
@@ -522,6 +527,12 @@ HTMLButtonElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
}
if (aName == nsGkAtoms::type || aName == nsGkAtoms::disabled) {
if (aName == nsGkAtoms::disabled) {
// This *has* to be called *before* validity state check because
// UpdateBarredFromConstraintValidation depends on our disabled state.
UpdateDisabledState(aNotify);
}
UpdateBarredFromConstraintValidation();
UpdateState(aNotify);
}