Bug 1190172 part 4 - Remove unused nsHTMLEditor::HasAttr; r=ehsan
authorAryeh Gregor <ayg@aryeh.name>
Tue, 19 Apr 2016 05:41:00 +0200
changeset 331772 6a900f9ebc764b8b58b4a08e27226ededdd78dfe
parent 331771 3ebd82b3c97ed57bc0655585c1d31cf5da28f0a8
child 331773 f8ae8039c7adfc08f712fc4a6aade266c746da6d
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1190172
milestone48.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 1190172 part 4 - Remove unused nsHTMLEditor::HasAttr; r=ehsan
editor/libeditor/nsHTMLEditor.h
editor/libeditor/nsHTMLEditorStyle.cpp
--- a/editor/libeditor/nsHTMLEditor.h
+++ b/editor/libeditor/nsHTMLEditor.h
@@ -673,17 +673,16 @@ protected:
   nsresult RemoveStyleInside(nsIContent& aNode,
                              nsIAtom* aProperty,
                              const nsAString* aAttribute,
                              const bool aChildrenOnly = false);
   nsresult RemoveInlinePropertyImpl(nsIAtom* aProperty,
                                     const nsAString* aAttribute);
 
   bool NodeIsProperty(nsIDOMNode *aNode);
-  bool HasAttr(nsIDOMNode *aNode, const nsAString *aAttribute);
   bool IsAtFrontOfNode(nsIDOMNode *aNode, int32_t aOffset);
   bool IsAtEndOfNode(nsIDOMNode *aNode, int32_t aOffset);
   bool IsOnlyAttribute(const nsIContent* aElement, const nsAString& aAttribute);
 
   nsresult RemoveBlockContainer(nsIDOMNode *inNode);
 
   nsIContent* GetPriorHTMLSibling(nsINode* aNode);
   nsresult GetPriorHTMLSibling(nsIDOMNode *inNode, nsCOMPtr<nsIDOMNode> *outNode);
--- a/editor/libeditor/nsHTMLEditorStyle.cpp
+++ b/editor/libeditor/nsHTMLEditorStyle.cpp
@@ -843,36 +843,16 @@ nsHTMLEditor::IsOnlyAttribute(const nsIC
       return false;
     }
   }
   // if we made it through all of them without finding a real attribute
   // other than aAttribute, then return true
   return true;
 }
 
-bool nsHTMLEditor::HasAttr(nsIDOMNode* aNode,
-                           const nsAString* aAttribute)
-{
-  NS_ENSURE_TRUE(aNode, false);
-  if (!aAttribute || aAttribute->IsEmpty()) {
-    // everybody has the 'null' attribute
-    return true;
-  }
-
-  // get element
-  nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
-  NS_ENSURE_TRUE(element, false);
-
-  nsCOMPtr<nsIAtom> atom = NS_Atomize(*aAttribute);
-  NS_ENSURE_TRUE(atom, false);
-
-  return element->HasAttr(kNameSpaceID_None, atom);
-}
-
-
 nsresult
 nsHTMLEditor::PromoteRangeIfStartsOrEndsInNamedAnchor(nsRange* inRange)
 {
   NS_ENSURE_TRUE(inRange, NS_ERROR_NULL_POINTER);
   nsresult res;
   nsCOMPtr<nsIDOMNode> startNode, endNode, parent, tmp;
   int32_t startOffset, endOffset, tmpOffset;