Bug 1484092 - part 3: IsLinkTag() and IsNamedAnchorTag() should compare with nsGkAtoms r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 17 Aug 2018 14:51:40 +0000
changeset 432117 4b5906a29b0cd71fbb9bbacf8640b00892878ab2
parent 432116 a2a95c8855db46baa7009bdc25f1555bd5f1f1e4
child 432118 bb09f2ec0d284f79b4a49df1db8b455c53430be4
push id34460
push userdvarga@mozilla.com
push dateFri, 17 Aug 2018 21:51:39 +0000
treeherdermozilla-central@2f1bbddc826b [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 3: IsLinkTag() and IsNamedAnchorTag() should compare with nsGkAtoms r=m_kato The methods compared with const characters since we've supported "namedanchor" which is not in nsGkAtoms. Now, it's dropped so that we can compare given atom with nsGkAtoms. Differential Revision: https://phabricator.services.mozilla.com/D3586
editor/libeditor/HTMLEditor.cpp
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -86,23 +86,23 @@ GetLowerCaseNameAtom(const nsAString& aT
   nsContentUtils::ASCIIToLower(aTagName, lowerTagName);
   return NS_Atomize(lowerTagName);
 }
 
 // Some utilities to handle overloading of "A" tag for link and named anchor.
 static bool
 IsLinkTag(const nsAtom& aTagName)
 {
-  return aTagName.Equals(NS_LITERAL_STRING("href"));
+  return &aTagName == nsGkAtoms::href;
 }
 
 static bool
 IsNamedAnchorTag(const nsAtom& aTagName)
 {
-  return aTagName.Equals(NS_LITERAL_STRING("anchor"));
+  return &aTagName == nsGkAtoms::anchor;
 }
 
 template EditorDOMPoint
 HTMLEditor::InsertNodeIntoProperAncestorWithTransaction(
               nsIContent& aNode,
               const EditorDOMPoint& aPointToInsert,
               SplitAtEdges aSplitAtEdges);
 template EditorDOMPoint