Bug 1484092 - part 2: Drop supporting "namedanchor" special element name from nsIHTMLEditor::GetSelectedElement(), nsIHTMLEditor::GetElementOrParentByTagName() and nsIHTMLEditor::CreateElementWithDefaults() r=m_kato
☠☠ backed out by 32edecc9301f ☠ ☠
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 17 Aug 2018 07:41:55 +0000
changeset 489841 10fdd041f1b5ef4ab557d6d6d7c4b405ae55764b
parent 489840 d0b14e8711dfbe1063f0e9ea310118d486e46652
child 489842 89c42a14642a3d11329d41702557b8b960603b22
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [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);