Bug 464009, patch2, r+sr=sicking

This commit is contained in:
Olli Pettay
2008-12-03 12:39:21 +02:00
parent ecbc146230
commit 3ea94a1c94
5 changed files with 26 additions and 17 deletions

View File

@@ -4255,11 +4255,9 @@ nsGenericElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
attrValue.SetTo(aValue);
}
rv = SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValue,
attrValue, modification, hasListeners, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
return AfterSetAttr(aNamespaceID, aName, &aValue, aNotify);
return SetAttrAndNotify(aNamespaceID, aName, aPrefix, oldValue,
attrValue, modification, hasListeners, aNotify,
&aValue);
}
nsresult
@@ -4270,7 +4268,8 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
nsAttrValue& aParsedValue,
PRBool aModification,
PRBool aFireMutation,
PRBool aNotify)
PRBool aNotify,
const nsAString* aValueForAfterSetAttr)
{
nsresult rv;
PRUint8 modType = aModification ?
@@ -4329,7 +4328,16 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, modType,
stateMask);
}
if (aNamespaceID == kNameSpaceID_XMLEvents &&
aName == nsGkAtoms::event && mNodeInfo->GetDocument()) {
mNodeInfo->GetDocument()->AddXMLEventsContent(this);
}
if (aValueForAfterSetAttr) {
rv = AfterSetAttr(aNamespaceID, aName, aValueForAfterSetAttr, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
}
if (aFireMutation) {
mozAutoRemovableBlockerRemover blockerRemover;
@@ -4358,11 +4366,6 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
}
if (aNamespaceID == kNameSpaceID_XMLEvents &&
aName == nsGkAtoms::event && mNodeInfo->GetDocument()) {
mNodeInfo->GetDocument()->AddXMLEventsContent(this);
}
return NS_OK;
}
@@ -4587,6 +4590,9 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
stateMask);
}
rv = AfterSetAttr(aNameSpaceID, aName, nsnull, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
if (hasMutationListeners) {
mozAutoRemovableBlockerRemover blockerRemover;
@@ -4607,7 +4613,7 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
}
return AfterSetAttr(aNameSpaceID, aName, nsnull, aNotify);
return NS_OK;
}
const nsAttrName*