Bug 705110 - Suppress warning spam on DOMAttrModified event. r=smaug

This commit is contained in:
Masatoshi Kimura 2012-02-27 18:57:28 -05:00
Родитель 6b6f7e4458
Коммит fcffee46fd
3 изменённых файлов: 18 добавлений и 5 удалений

Просмотреть файл

@ -2899,6 +2899,14 @@ nsGenericElement::GetAttributeNodeNS(const nsAString& aNamespaceURI,
OwnerDoc()->WarnOnceAbout(nsIDocument::eGetAttributeNodeNS);
return GetAttributeNodeNSInternal(aNamespaceURI, aLocalName, aReturn);
}
nsresult
nsGenericElement::GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMAttr** aReturn)
{
nsCOMPtr<nsIDOMNamedNodeMap> map;
nsresult rv = GetAttributes(getter_AddRefs(map));
NS_ENSURE_SUCCESS(rv, rv);
@ -5206,8 +5214,8 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
nsCOMPtr<nsIDOMAttr> attrNode;
nsAutoString ns;
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNamespaceID, ns);
GetAttributeNodeNS(ns, nsDependentAtomString(aName),
getter_AddRefs(attrNode));
GetAttributeNodeNSInternal(ns, nsDependentAtomString(aName),
getter_AddRefs(attrNode));
mutation.mRelatedNode = attrNode;
mutation.mAttrName = aName;
@ -5386,8 +5394,8 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
if (hasMutationListeners) {
nsAutoString ns;
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, ns);
GetAttributeNodeNS(ns, nsDependentAtomString(aName),
getter_AddRefs(attrNode));
GetAttributeNodeNSInternal(ns, nsDependentAtomString(aName),
getter_AddRefs(attrNode));
}
// Clear binding to nsIDOMNamedNodeMap

Просмотреть файл

@ -794,6 +794,10 @@ protected:
return this;
}
nsresult GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMAttr** aReturn);
public:
// Because of a bug in MS C++ compiler nsDOMSlots must be declared public,
// otherwise nsXULElement::nsXULSlots doesn't compile.

Просмотреть файл

@ -1368,7 +1368,8 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, bool aNotify)
if (hasMutationListeners) {
nsAutoString ns;
nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, ns);
GetAttributeNodeNS(ns, nsDependentAtomString(aName), getter_AddRefs(attrNode));
GetAttributeNodeNSInternal(ns, nsDependentAtomString(aName),
getter_AddRefs(attrNode));
}
nsDOMSlots *slots = GetExistingDOMSlots();