Bug 1100535 - Do not assume that the radio required status changed when the attribute changes. r=smaug

This commit is contained in:
Giovanni Sferro
2014-11-27 17:40:00 -08:00
parent b6ce3108b9
commit 9d6615d76a
8 changed files with 55 additions and 28 deletions

View File

@@ -2196,13 +2196,10 @@ HTMLFormElement::GetRequiredRadioCount(const nsAString& aName) const
}
void
HTMLFormElement::RadioRequiredChanged(const nsAString& aName,
nsIFormControl* aRadio)
HTMLFormElement::RadioRequiredWillChange(const nsAString& aName,
bool aRequiredAdded)
{
nsCOMPtr<nsIContent> element = do_QueryInterface(aRadio);
NS_ASSERTION(element, "radio controls have to be content elements!");
if (element->HasAttr(kNameSpaceID_None, nsGkAtoms::required)) {
if (aRequiredAdded) {
mRequiredRadioButtonCounts.Put(aName,
mRequiredRadioButtonCounts.Get(aName)+1);
} else {