Make <select> handle changes to defaultSelected on node for which selected has not been set. Bug 395107, r+sr=sicking.

This commit is contained in:
2007-12-04 08:50:32 -08:00
parent 0477cfc04d
commit 1c7307c329
22 changed files with 334 additions and 56 deletions

View File

@@ -3848,6 +3848,9 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
return NS_OK;
}
nsresult rv = BeforeSetAttr(aNameSpaceID, aName, nsnull, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
nsIDocument *document = GetCurrentDoc();
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
if (document) {
@@ -3890,7 +3893,7 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
}
nsAttrValue oldValue;
nsresult rv = mAttrsAndChildren.RemoveAttrAt(index, oldValue);
rv = mAttrsAndChildren.RemoveAttrAt(index, oldValue);
NS_ENSURE_SUCCESS(rv, rv);
if (document) {
@@ -3929,7 +3932,7 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
}
return NS_OK;
return AfterSetAttr(aNameSpaceID, aName, nsnull, aNotify);
}
const nsAttrName*