Bug 1640276 - Part 5: Mark nsINode as const in GetNext/PreviousGetNextHTMLElementOrTextInternal() r=masayuki
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Sat, 23 May 2020 12:39:36 +0000
changeset 531780 d918b4d3936cc8b41d7106172b44b70501a8a168
parent 531779 65c499f35baaa7201c05c1de2ac509884920218d
child 531781 54cdb503a9152341ebdb1f375e2e6ada99054ab8
push id37443
push usercbrindusan@mozilla.com
push dateSat, 23 May 2020 21:42:57 +0000
treeherdermozilla-central@9a2f741cef6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1640276
milestone78.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 1640276 - Part 5: Mark nsINode as const in GetNext/PreviousGetNextHTMLElementOrTextInternal() r=masayuki Differential Revision: https://phabricator.services.mozilla.com/D76567
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -4960,17 +4960,17 @@ nsIContent* HTMLEditor::GetNextHTMLSibli
           SkippableWhitespace(content, aSkipWS))) {
     content = content->GetNextSibling();
   }
 
   return content;
 }
 
 nsIContent* HTMLEditor::GetPreviousHTMLElementOrTextInternal(
-    nsINode& aNode, bool aNoBlockCrossing) const {
+    const nsINode& aNode, bool aNoBlockCrossing) const {
   if (NS_WARN_IF(!GetActiveEditingHost())) {
     return nullptr;
   }
   return aNoBlockCrossing ? GetPreviousElementOrTextInBlock(aNode)
                           : GetPreviousElementOrText(aNode);
 }
 
 template <typename PT, typename CT>
@@ -4998,17 +4998,17 @@ nsIContent* HTMLEditor::GetPreviousEdita
   if (NS_WARN_IF(!GetActiveEditingHost())) {
     return nullptr;
   }
   return aNoBlockCrossing ? GetPreviousEditableNodeInBlock(aPoint)
                           : GetPreviousEditableNode(aPoint);
 }
 
 nsIContent* HTMLEditor::GetNextHTMLElementOrTextInternal(
-    nsINode& aNode, bool aNoBlockCrossing) const {
+    const nsINode& aNode, bool aNoBlockCrossing) const {
   if (NS_WARN_IF(!GetActiveEditingHost())) {
     return nullptr;
   }
   return aNoBlockCrossing ? GetNextElementOrTextInBlock(aNode)
                           : GetNextElementOrText(aNode);
 }
 
 template <typename PT, typename CT>
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -1024,17 +1024,17 @@ class HTMLEditor final : public TextEdit
       const EditorDOMPointBase<PT, CT>& aPoint) const {
     return GetPreviousHTMLElementOrTextInternal(aPoint, true);
   }
 
   /**
    * GetPreviousHTMLElementOrTextInternal() methods are common implementation
    * of above methods.  Please don't use this method directly.
    */
-  nsIContent* GetPreviousHTMLElementOrTextInternal(nsINode& aNode,
+  nsIContent* GetPreviousHTMLElementOrTextInternal(const nsINode& aNode,
                                                    bool aNoBlockCrossing) const;
   template <typename PT, typename CT>
   nsIContent* GetPreviousHTMLElementOrTextInternal(
       const EditorDOMPointBase<PT, CT>& aPoint, bool aNoBlockCrossing) const;
 
   /**
    * GetPreviousEditableHTMLNode*() methods are similar to
    * EditorBase::GetPreviousEditableNode() but this won't return nodes outside
@@ -1093,17 +1093,17 @@ class HTMLEditor final : public TextEdit
       const EditorDOMPointBase<PT, CT>& aPoint) const {
     return GetNextHTMLElementOrTextInternal(aPoint, true);
   }
 
   /**
    * GetNextHTMLNodeInternal() methods are common implementation
    * of above methods.  Please don't use this method directly.
    */
-  nsIContent* GetNextHTMLElementOrTextInternal(nsINode& aNode,
+  nsIContent* GetNextHTMLElementOrTextInternal(const nsINode& aNode,
                                                bool aNoBlockCrossing) const;
   template <typename PT, typename CT>
   nsIContent* GetNextHTMLElementOrTextInternal(
       const EditorDOMPointBase<PT, CT>& aPoint, bool aNoBlockCrossing) const;
 
   /**
    * GetNextEditableHTMLNode*() methods are similar to
    * EditorBase::GetNextEditableNode() but this won't return nodes outside