Bug 362391, DOMAttrModified doesn't handle namespaced attributes properly, r+sr=sicking

This commit is contained in:
Olli.Pettay%helsinki.fi 2006-12-01 08:44:38 +00:00
parent 3f9008b966
commit f4e4277761
2 changed files with 9 additions and 5 deletions

View File

@ -3233,7 +3233,9 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
nsAutoString attrName;
aName->ToString(attrName);
nsCOMPtr<nsIDOMAttr> attrNode;
GetAttributeNode(attrName, getter_AddRefs(attrNode));
nsAutoString ns;
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNamespaceID, ns);
GetAttributeNodeNS(ns, attrName, getter_AddRefs(attrNode));
mutation.mRelatedNode = attrNode;
mutation.mAttrName = aName;
@ -3431,10 +3433,11 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
// Grab the attr node if needed before we remove it from the attr map
nsCOMPtr<nsIDOMAttr> attrNode;
if (hasMutationListeners) {
// XXXbz namespaces, dude!
nsAutoString attrName;
aName->ToString(attrName);
GetAttributeNode(attrName, getter_AddRefs(attrNode));
nsAutoString ns;
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, ns);
GetAttributeNodeNS(ns, attrName, getter_AddRefs(attrNode));
}
// Clear binding to nsIDOMNamedNodeMap

View File

@ -1337,10 +1337,11 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
nsCOMPtr<nsIDOMAttr> attrNode;
if (hasMutationListeners) {
// XXXbz namespaces, dude!
nsAutoString attrName;
aName->ToString(attrName);
GetAttributeNode(attrName, getter_AddRefs(attrNode));
nsAutoString ns;
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, ns);
GetAttributeNodeNS(ns, attrName, getter_AddRefs(attrNode));
}
nsDOMSlots *slots = GetExistingDOMSlots();