Bug 1407854 - Part 1: Remove nsIEditor.createNode(); r=masayuki
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 11 Oct 2017 20:54:21 -0400
changeset 386017 0d50bf107005b01f497f27dacd2975b85aabc461
parent 386016 337103b85c025be555c107c7710ebe25d2feb6ed
child 386018 4f60235521e987e272de2eb0864d179442428d28
push id32673
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 09:13:17 +0000
treeherdermozilla-central@196dadb2fe50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1407854
milestone58.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 1407854 - Part 1: Remove nsIEditor.createNode(); r=masayuki
editor/libeditor/EditorBase.cpp
editor/nsIEditor.idl
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -1410,30 +1410,16 @@ EditorBase::SyncRealTimeSpell()
 NS_IMETHODIMP
 EditorBase::SetSpellcheckUserOverride(bool enable)
 {
   mSpellcheckCheckboxState = enable ? eTriTrue : eTriFalse;
 
   return SyncRealTimeSpell();
 }
 
-NS_IMETHODIMP
-EditorBase::CreateNode(const nsAString& aTag,
-                       nsIDOMNode* aParent,
-                       int32_t aPosition,
-                       nsIDOMNode** aNewNode)
-{
-  RefPtr<nsAtom> tag = NS_Atomize(aTag);
-  nsCOMPtr<nsINode> parent = do_QueryInterface(aParent);
-  NS_ENSURE_STATE(parent);
-  *aNewNode = GetAsDOMNode(CreateNode(tag, parent, aPosition).take());
-  NS_ENSURE_STATE(*aNewNode);
-  return NS_OK;
-}
-
 already_AddRefed<Element>
 EditorBase::CreateNode(nsAtom* aTag,
                        nsINode* aParent,
                        int32_t aPosition)
 {
   MOZ_ASSERT(aTag && aParent);
 
   AutoRules beginRulesSniffing(this, EditAction::createNode, nsIEditor::eNext);
--- a/editor/nsIEditor.idl
+++ b/editor/nsIEditor.idl
@@ -425,28 +425,16 @@ interface nsIEditor  : nsISupports
    *
    * The supplied nodes MUST BE ELEMENTS (most callers are working with nodes)
    * @param aDestNode     the destination element to operate on
    * @param aSourceNode   the source element to copy attributes from
    */
   void cloneAttributes(in nsIDOMNode destNode, in nsIDOMNode sourceNode);
 
   /**
-   * createNode instantiates a new element of type aTag and inserts it
-   * into aParent at aPosition.
-   * @param aTag      The type of object to create
-   * @param aParent   The node to insert the new object into
-   * @param aPosition The place in aParent to insert the new node
-   * @return          The node created.  Caller must release aNewNode.
-   */
-  nsIDOMNode createNode(in AString tag,
-                        in nsIDOMNode parent,
-                        in long position);
-
-  /**
    * insertNode inserts aNode into aParent at aPosition.
    * No checking is done to verify the legality of the insertion.
    * That is the responsibility of the caller.
    * @param aNode     The DOM Node to insert.
    * @param aParent   The node to insert the new object into
    * @param aPosition The place in aParent to insert the new node
    *                  0=first child, 1=second child, etc.
    *                  any number > number of current children = last child