Bug 1236258 part 1. Remove the unused nsDOMAttributeMap::RemoveAttribute. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 11 Jan 2016 13:01:29 -0500
changeset 316408 9543976f8b1cb62712a0f8de84216b168cef9a05
parent 316407 824028cb6c890ab20e78807cb08625773ee6d5dd
child 316409 f4bbe8741e30cfb0ea27f6e2fff4e3e19a6ec621
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1236258
milestone46.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
Bug 1236258 part 1. Remove the unused nsDOMAttributeMap::RemoveAttribute. r=smaug
dom/base/nsDOMAttributeMap.cpp
dom/base/nsDOMAttributeMap.h
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -143,43 +143,16 @@ nsDOMAttributeMap::DropAttribute(int32_t
     // Break link to map
     node->SetMap(nullptr);
 
     // Remove from cache
     mAttributeCache.Remove(attr);
   }
 }
 
-already_AddRefed<Attr>
-nsDOMAttributeMap::RemoveAttribute(mozilla::dom::NodeInfo* aNodeInfo)
-{
-  NS_ASSERTION(aNodeInfo, "RemoveAttribute() called with aNodeInfo == nullptr!");
-
-  nsAttrKey attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
-
-  RefPtr<Attr> node;
-  if (!mAttributeCache.Get(attr, getter_AddRefs(node))) {
-    nsAutoString value;
-    // As we are removing the attribute we need to set the current value in
-    // the attribute node.
-    mContent->GetAttr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom(), value);
-    RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
-    node = new Attr(nullptr, ni.forget(), value, true);
-  }
-  else {
-    // Break link to map
-    node->SetMap(nullptr);
-
-    // Remove from cache
-    mAttributeCache.Remove(attr);
-  }
-
-  return node.forget();
-}
-
 Attr*
 nsDOMAttributeMap::GetAttribute(mozilla::dom::NodeInfo* aNodeInfo, bool aNsAware)
 {
   NS_ASSERTION(aNodeInfo, "GetAttribute() called with aNodeInfo == nullptr!");
 
   nsAttrKey attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
 
   Attr* node = mAttributeCache.GetWeak(attr);
--- a/dom/base/nsDOMAttributeMap.h
+++ b/dom/base/nsDOMAttributeMap.h
@@ -174,21 +174,16 @@ private:
    */
   AttrCache mAttributeCache;
 
   already_AddRefed<mozilla::dom::NodeInfo>
   GetAttrNodeInfo(const nsAString& aNamespaceURI,
                   const nsAString& aLocalName);
 
   Attr* GetAttribute(mozilla::dom::NodeInfo* aNodeInfo, bool aNsAware);
-
-  /**
-   * Remove an attribute, returns the removed node.
-   */
-  already_AddRefed<Attr> RemoveAttribute(mozilla::dom::NodeInfo* aNodeInfo);
 };
 
 // XXX khuey yes this is crazy.  The bindings code needs to see this include,
 // but if we pull it in at the top of the file we get a circular include
 // problem.
 #include "mozilla/dom/Element.h"
 
 #endif /* nsDOMAttributeMap_h */