Bug 1484092 - part 2: Drop supporting "namedanchor" special element name from nsIHTMLEditor::GetSelectedElement(), nsIHTMLEditor::GetElementOrParentByTagName() and nsIHTMLEditor::CreateElementWithDefaults() r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 17 Aug 2018 14:50:56 +0000
changeset 487214 a2a95c8855db46baa7009bdc25f1555bd5f1f1e4
parent 487213 5a465e7bdc7a0f25a305a1e4301587dccd8935cd
child 487215 4b5906a29b0cd71fbb9bbacf8640b00892878ab2
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1484092
milestone63.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 1484092 - part 2: Drop supporting "namedanchor" special element name from nsIHTMLEditor::GetSelectedElement(), nsIHTMLEditor::GetElementOrParentByTagName() and nsIHTMLEditor::CreateElementWithDefaults() r=m_kato Nobody (including comm-central and BlueGriffon) does not use "namedanchor" special element name with those XPCOMs. Of course, our internal callers too. Therefore, we can drop. Note that there is no static Atom for this, so, keeping it makes unnecessary runtime cost for Firefox users. This could cause breaking some legacy add-ons for Thunderbird. However, they can use "anchor" special element name for same purpose. Differential Revision: https://phabricator.services.mozilla.com/D3585
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
editor/nsIHTMLEditor.idl
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -92,18 +92,17 @@ static bool
 IsLinkTag(const nsAtom& aTagName)
 {
   return aTagName.Equals(NS_LITERAL_STRING("href"));
 }
 
 static bool
 IsNamedAnchorTag(const nsAtom& aTagName)
 {
-  return aTagName.Equals(NS_LITERAL_STRING("anchor")) ||
-         aTagName.Equals(NS_LITERAL_STRING("namedanchor"));
+  return aTagName.Equals(NS_LITERAL_STRING("anchor"));
 }
 
 template EditorDOMPoint
 HTMLEditor::InsertNodeIntoProperAncestorWithTransaction(
               nsIContent& aNode,
               const EditorDOMPoint& aPointToInsert,
               SplitAtEdges aSplitAtEdges);
 template EditorDOMPoint
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -328,19 +328,18 @@ public:
    *
    * @param aTagName        The tag name which you want to look for.
    *                        Must not be nsGkAtoms::_empty.
    *                        If nsGkAtoms::list, the result may be <ul>, <ol> or
    *                        <dl> element.
    *                        If nsGkAtoms::td, the result may be <td> or <th>.
    *                        If nsGkAtoms::href, the result may be <a> element
    *                        which has "href" attribute with non-empty value.
-   *                        If nsGkAtoms::anchor or atom of "namedanchor", the
-   *                        result may be <a> which has "name" attribute with
-   *                        non-empty value.
+   *                        If nsGkAtoms::anchor, the result may be <a> which
+   *                        has "name" attribute with non-empty value.
    * @param aNode           If non-nullptr, this starts to look for the result
    *                        from it.  Otherwise, i.e., nullptr, starts from
    *                        anchor node of Selection.
    * @return                If an element which matches aTagName, returns
    *                        an Element.  Otherwise, nullptr.
    */
   Element*
   GetElementOrParentByTagName(const nsAtom& aTagName, nsINode* aNode);
@@ -841,19 +840,18 @@ protected: // Shouldn't be used by frien
    * @param aSelection      The Selection for this editor.
    * @param aTagName        The tag name which you want to look for.
    *                        Must not be nsGkAtoms::_empty.
    *                        If nsGkAtoms::list, the result may be <ul>, <ol> or
    *                        <dl> element.
    *                        If nsGkAtoms::td, the result may be <td> or <th>.
    *                        If nsGkAtoms::href, the result may be <a> element
    *                        which has "href" attribute with non-empty value.
-   *                        If nsGkAtoms::anchor or atom of "namedanchor", the
-   *                        result may be <a> which has "name" attribute with
-   *                        non-empty value.
+   *                        If nsGkAtoms::anchor, the result may be <a> which
+   *                        has "name" attribute with non-empty value.
    * @return                If an element which matches aTagName, returns
    *                        an Element.  Otherwise, nullptr.
    */
   Element*
   GetElementOrParentByTagNameAtSelection(Selection& aSelection,
                                          const nsAtom& aTagName);
 
   /**
@@ -862,19 +860,18 @@ protected: // Shouldn't be used by frien
    *
    * @param aTagName        The tag name which you want to look for.
    *                        Must not be nsGkAtoms::_empty.
    *                        If nsGkAtoms::list, the result may be <ul>, <ol> or
    *                        <dl> element.
    *                        If nsGkAtoms::td, the result may be <td> or <th>.
    *                        If nsGkAtoms::href, the result may be <a> element
    *                        which has "href" attribute with non-empty value.
-   *                        If nsGkAtoms::anchor or atom of "namedanchor", the
-   *                        result may be <a> which has "name" attribute with
-   *                        non-empty value.
+   *                        If nsGkAtoms::anchor, the result may be <a> which
+   *                        has "name" attribute with non-empty value.
    * @param aNode           Start node to look for the element.
    * @return                If an element which matches aTagName, returns
    *                        an Element.  Otherwise, nullptr.
    */
   Element*
   GetElementOrParentByTagNameInternal(const nsAtom& aTagName,
                                       nsINode& aNode);
 
--- a/editor/nsIHTMLEditor.idl
+++ b/editor/nsIHTMLEditor.idl
@@ -307,18 +307,18 @@ interface nsIHTMLEditor : nsISupports
    *
    * @param aTagName        The tag name which you want to look for.
    *                        Must not be empty string.
    *                        If "list", the result may be <ul>, <ol> or <dl>
    *                        element.
    *                        If "td", the result may be <td> or <th>.
    *                        If "href", the result may be <a> element
    *                        which has "href" attribute with non-empty value.
-   *                        If "anchor" or "namedanchor", the result may be <a>
-   *                        which has "name" attribute with non-empty value.
+   *                        If "anchor", the result may be <a> which has
+   *                        "name" attribute with non-empty value.
    * @param aNode           If non-null, this starts to look for the result
    *                        from it.  Otherwise, i.e., null, starts from
    *                        anchor node of Selection.
    * @return                If an element which matches aTagName, returns
    *                        an Element.  Otherwise, nullptr.
    */
   Element getElementOrParentByTagName(in AString aTagName,
                                       in Node aNode);