From 3be1d1aa64f136aabafdde15b05f99d718fbb430 Mon Sep 17 00:00:00 2001 From: "Olli.Pettay%helsinki.fi" Date: Fri, 1 Dec 2006 08:44:38 +0000 Subject: [PATCH] Bug 362391, DOMAttrModified doesn't handle namespaced attributes properly, r+sr=sicking git-svn-id: svn://10.0.0.236/trunk@216242 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsGenericElement.cpp | 9 ++++++--- mozilla/content/xul/content/src/nsXULElement.cpp | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 478a7755eeb..83c1e166c56 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -3233,7 +3233,9 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID, nsAutoString attrName; aName->ToString(attrName); nsCOMPtr 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 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 diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index 8d4bce2ed83..67fa509a791 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -1337,10 +1337,11 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify) nsCOMPtr 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();