Bug 1100535 - Do not assume that the radio required status changed when the attribute changes. r=smaug
This commit is contained in:
@@ -1332,6 +1332,16 @@ HTMLInputElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
AttrValueIs(kNameSpaceID_None, nsGkAtoms::dir,
|
||||
nsGkAtoms::_auto, eIgnoreCase)) {
|
||||
SetDirectionIfAuto(false, aNotify);
|
||||
} else if (mType == NS_FORM_INPUT_RADIO && aName == nsGkAtoms::required) {
|
||||
nsCOMPtr<nsIRadioGroupContainer> container = GetRadioGroupContainer();
|
||||
|
||||
if (container &&
|
||||
((aValue && !HasAttr(aNameSpaceID, aName)) ||
|
||||
(!aValue && HasAttr(aNameSpaceID, aName)))) {
|
||||
nsAutoString name;
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
|
||||
container->RadioRequiredWillChange(name, !!aValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1405,16 +1415,6 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
}
|
||||
}
|
||||
|
||||
if (mType == NS_FORM_INPUT_RADIO && aName == nsGkAtoms::required) {
|
||||
nsCOMPtr<nsIRadioGroupContainer> container = GetRadioGroupContainer();
|
||||
|
||||
if (container) {
|
||||
nsAutoString name;
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
|
||||
container->RadioRequiredChanged(name, this);
|
||||
}
|
||||
}
|
||||
|
||||
if (aName == nsGkAtoms::required || aName == nsGkAtoms::disabled ||
|
||||
aName == nsGkAtoms::readonly) {
|
||||
UpdateValueMissingValidityState();
|
||||
|
||||
Reference in New Issue
Block a user