author | Masatoshi Kimura <VYV03354@nifty.ne.jp> |
Mon, 27 Feb 2012 18:57:28 -0500 | |
changeset 87881 | 547e2b0fbe8380a37c10a688bad425a43219e3b8 |
parent 87880 | 7b74d51579b47e73e35e400548d143b666da1f50 |
child 87882 | c90e1b198f93d96143b0825377461b55940ac1cf |
push id | 22160 |
push user | mbrubeck@mozilla.com |
push date | Tue, 28 Feb 2012 17:21:33 +0000 |
treeherder | mozilla-central@dde4e0089a18 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug |
bugs | 705110 |
milestone | 13.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -2894,16 +2894,24 @@ nsGenericElement::GetAttributeNodeNS(con const nsAString& aLocalName, nsIDOMAttr** aReturn) { NS_ENSURE_ARG_POINTER(aReturn); *aReturn = nsnull; 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); nsCOMPtr<nsIDOMNode> node; rv = map->GetNamedItemNS(aNamespaceURI, aLocalName, getter_AddRefs(node)); if (NS_SUCCEEDED(rv) && node) { @@ -5201,18 +5209,18 @@ nsGenericElement::SetAttrAndNotify(PRInt } if (aFireMutation) { nsMutationEvent mutation(true, NS_MUTATION_ATTRMODIFIED); 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; nsAutoString newValue; GetAttr(aNamespaceID, aName, newValue); if (!newValue.IsEmpty()) { mutation.mNewAttrValue = do_GetAtom(newValue); } @@ -5381,18 +5389,18 @@ nsGenericElement::UnsetAttr(PRInt32 aNam NS_EVENT_BITS_MUTATION_ATTRMODIFIED, this); // Grab the attr node if needed before we remove it from the attr map nsCOMPtr<nsIDOMAttr> attrNode; 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 nsDOMSlots *slots = GetExistingDOMSlots(); if (slots && slots->mAttributeMap) { slots->mAttributeMap->DropAttribute(aNameSpaceID, aName); }
--- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -789,16 +789,20 @@ protected: nsIFrame* GetStyledFrame(); virtual mozilla::dom::Element* GetNameSpaceElement() { 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. /** * There are a set of DOM- and scripting-specific instance variables * that may only be instantiated when a content object is accessed * through the DOM. Rather than burn actual slots in the content * objects for each of these instance variables, we put them off
--- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -1363,17 +1363,18 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpa bool hasMutationListeners = aNotify && nsContentUtils::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_ATTRMODIFIED, this); nsCOMPtr<nsIDOMAttr> attrNode; 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(); if (slots && slots->mAttributeMap) { slots->mAttributeMap->DropAttribute(aNameSpaceID, aName); } // The id-handling code, and in the future possibly other code, need to