Bug 1313986 - Part 5. Remove createAnonymousElement from nsIHTMLEditor. r=masayuki
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 31 Oct 2016 18:06:27 +0900
changeset 324076 efbc0c055fbc1511c181eadb728e135d9b7976eb
parent 324075 f2593e79b289aede3294d8cfa77d2a47d89eddb6
child 324077 9aef92f7911d35abc9520ffa0e802be3f4b92f5a
child 324189 cc39a32513fec7efc67055a934f226651807827f
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmasayuki
bugs1313986
milestone53.0a1
Bug 1313986 - Part 5. Remove createAnonymousElement from nsIHTMLEditor. r=masayuki c-c nor add-ons seem noet to use it. We should remove this. MozReview-Commit-ID: 3jN8kUp6D4Z
editor/libeditor/HTMLAnonymousNodeEditor.cpp
editor/nsIHTMLEditor.idl
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -156,42 +156,16 @@ ElementDeletionObserver::NodeWillBeDestr
     mNativeAnonNode->RemoveMutationObserver(this);
     mNativeAnonNode->UnbindFromTree();
     mNativeAnonNode = nullptr;
   }
 
   NS_RELEASE_THIS();
 }
 
-// Returns in *aReturn an anonymous nsDOMElement of type aTag,
-// child of aParentNode. If aIsCreatedHidden is true, the class
-// "hidden" is added to the created element. If aAnonClass is not
-// the empty string, it becomes the value of the attribute "_moz_anonclass"
-NS_IMETHODIMP
-HTMLEditor::CreateAnonymousElement(const nsAString& aTag,
-                                   nsIDOMNode* aParentNode,
-                                   const nsAString& aAnonClass,
-                                   bool aIsCreatedHidden,
-                                   nsIDOMElement** aReturn)
-{
-  NS_ENSURE_ARG_POINTER(aReturn);
-  *aReturn = nullptr;
-
-  nsCOMPtr<nsIAtom> atom = NS_Atomize(aTag);
-  RefPtr<Element> element =
-    CreateAnonymousElement(atom, aParentNode, aAnonClass, aIsCreatedHidden);
-  if (NS_WARN_IF(!element)) {
-    return NS_ERROR_FAILURE;
-  }
-  nsCOMPtr<nsIDOMElement> newElement =
-    static_cast<nsIDOMElement*>(GetAsDOMNode(element));
-  newElement.forget(aReturn);
-  return NS_OK;
-}
-
 already_AddRefed<Element>
 HTMLEditor::CreateAnonymousElement(nsIAtom* aTag,
                                    nsIDOMNode* aParentNode,
                                    const nsAString& aAnonClass,
                                    bool aIsCreatedHidden)
 {
   if (NS_WARN_IF(!aParentNode)) {
     return nullptr;
--- a/editor/nsIHTMLEditor.idl
+++ b/editor/nsIHTMLEditor.idl
@@ -505,34 +505,16 @@ interface nsIHTMLEditor : nsISupports
 
   /**
    * Remove listener for insertion override
    * @param inFilter  function which callers do not want called during insertion
    */
   void removeInsertionListener(in nsIContentFilter inFilter);
 
   /**
-   * Returns an anonymous nsDOMElement of type aTag,
-   * child of aParentNode. If aIsCreatedHidden is true, the class
-   * "hidden" is added to the created element. If aAnonClass is not
-   * the empty string, it becomes the value of the attribute "_moz_anonclass"
-   * @return a DOM Element
-   * @param aTag             [IN] a string representing the desired type of
-   *                              the element to create
-   * @param aParentNode      [IN] the parent node of the created anonymous
-   *                              element
-   * @param aAnonClass       [IN] contents of the _moz_anonclass attribute
-   * @param aIsCreatedHidden [IN] a boolean specifying if the class "hidden"
-   *                              is to be added to the created anonymous
-   *                              element
-   */
-  nsIDOMElement createAnonymousElement(in AString aTag, in nsIDOMNode aParentNode,
-                                       in AString aAnonClass, in boolean aIsCreatedHidden);
-
-  /**
    * returns the deepest container of the selection
    * @return a DOM Element
    */
   nsIDOMElement getSelectionContainer();
 
   /**
    * Checks if the anonymous nodes created by the HTML editor have to be
    * refreshed or hidden depending on a possible new state of the selection