Fixing nsbeta2+ bug #35321 (button.setAttribute('disabled', false) disables button instead of enabling it).

git-svn-id: svn://10.0.0.236/trunk@70241 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%netscape.com 2000-05-17 02:03:10 +00:00
parent 2cbc1dcd1a
commit 05b84c1c86
2 changed files with 12 additions and 2 deletions

View File

@ -3464,8 +3464,13 @@ nsGenericHTMLContainerFormElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* a
// Add the control to the hash table
nsCOMPtr<nsIFormControl> control;
control = do_QueryInterface(mContent);
if (mForm && (nsHTMLAtoms::name == aName || nsHTMLAtoms::id == aName))
if (mForm && (nsHTMLAtoms::name == aName || nsHTMLAtoms::id == aName)) {
mForm->AddElementToTable(control, aValue);
} else if (nsHTMLAtoms::disabled == aName &&
mNodeInfo->Equals(nsHTMLAtoms::button) &&
aValue.EqualsWithConversion("false", PR_TRUE)) {
return nsGenericHTMLElement::UnsetAttribute(aNameSpaceID, aName, aNotify);
}
return nsGenericHTMLElement::SetAttribute(aNameSpaceID, aName, aValue, aNotify);
}

View File

@ -3464,8 +3464,13 @@ nsGenericHTMLContainerFormElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* a
// Add the control to the hash table
nsCOMPtr<nsIFormControl> control;
control = do_QueryInterface(mContent);
if (mForm && (nsHTMLAtoms::name == aName || nsHTMLAtoms::id == aName))
if (mForm && (nsHTMLAtoms::name == aName || nsHTMLAtoms::id == aName)) {
mForm->AddElementToTable(control, aValue);
} else if (nsHTMLAtoms::disabled == aName &&
mNodeInfo->Equals(nsHTMLAtoms::button) &&
aValue.EqualsWithConversion("false", PR_TRUE)) {
return nsGenericHTMLElement::UnsetAttribute(aNameSpaceID, aName, aNotify);
}
return nsGenericHTMLElement::SetAttribute(aNameSpaceID, aName, aValue, aNotify);
}