Bug 1640276 - Part 3: Mark nsINode as const in GetNext/PreviousNodeInternal() r=masayuki
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Sat, 23 May 2020 12:39:03 +0000
changeset 531778 77aab1a07cfc6a3cd566bde4a3d1020a10a57d42
parent 531777 ac943e455cf43a61be56ef03d3ad61bc3ea74ac8
child 531779 65c499f35baaa7201c05c1de2ac509884920218d
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 3: Mark nsINode as const in GetNext/PreviousNodeInternal() r=masayuki Differential Revision: https://phabricator.services.mozilla.com/D76564
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -2788,17 +2788,17 @@ nsresult EditorBase::DeleteTextWithTrans
   if (AsHTMLEditor()) {
     TopLevelEditSubActionDataRef().DidDeleteText(
         *this, EditorRawDOMPoint(&aTextNode, aOffset));
   }
 
   return rv;
 }
 
-nsIContent* EditorBase::GetPreviousNodeInternal(nsINode& aNode,
+nsIContent* EditorBase::GetPreviousNodeInternal(const nsINode& aNode,
                                                 bool aFindEditableNode,
                                                 bool aFindAnyDataNode,
                                                 bool aNoBlockCrossing) const {
   if (!IsDescendantOfEditorRoot(&aNode)) {
     return nullptr;
   }
   return FindNode(&aNode, false, aFindEditableNode, aFindAnyDataNode,
                   aNoBlockCrossing);
@@ -2847,17 +2847,17 @@ nsIContent* EditorBase::GetPreviousNodeI
     return lastLeafContent;
   }
 
   // restart the search from the non-editable node we just found
   return GetPreviousNodeInternal(*lastLeafContent, aFindEditableNode,
                                  aFindAnyDataNode, aNoBlockCrossing);
 }
 
-nsIContent* EditorBase::GetNextNodeInternal(nsINode& aNode,
+nsIContent* EditorBase::GetNextNodeInternal(const nsINode& aNode,
                                             bool aFindEditableNode,
                                             bool aFindAnyDataNode,
                                             bool aNoBlockCrossing) const {
   if (!IsDescendantOfEditorRoot(&aNode)) {
     return nullptr;
   }
   return FindNode(&aNode, true, aFindEditableNode, aFindAnyDataNode,
                   aNoBlockCrossing);
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -2040,17 +2040,18 @@ class EditorBase : public nsIEditor,
    *                             like Comment.
    * @param aNoBlockCrossing     If true, don't move across "block" nodes,
    *                             whatever that means.
    * @return                     The node that occurs before aNode in
    *                             the tree, skipping non-editable nodes if
    *                             aFindEditableNode is true.  If there is no
    *                             previous node, returns nullptr.
    */
-  nsIContent* GetPreviousNodeInternal(nsINode& aNode, bool aFindEditableNode,
+  nsIContent* GetPreviousNodeInternal(const nsINode& aNode,
+                                      bool aFindEditableNode,
                                       bool aFindAnyDataNode,
                                       bool aNoBlockCrossing) const;
 
   /**
    * And another version that takes a point in DOM tree rather than a node.
    */
   nsIContent* GetPreviousNodeInternal(const EditorRawDOMPoint& aPoint,
                                       bool aFindEditableNode,
@@ -2065,19 +2066,19 @@ class EditorBase : public nsIEditor,
    *                             like Comment.
    * @param aNoBlockCrossing     If true, don't move across "block" nodes,
    *                             whatever that means.
    * @return                     The node that occurs after aNode in the
    *                             tree, skipping non-editable nodes if
    *                             aFindEditableNode is true.  If there is no
    *                             next node, returns nullptr.
    */
-  nsIContent* GetNextNodeInternal(nsINode& aNode, bool aFindEditableNode,
+  nsIContent* GetNextNodeInternal(const nsINode& aNode, bool aFindEditableNode,
                                   bool aFindAnyDataNode,
-                                  bool bNoBlockCrossing) const;
+                                  bool aNoBlockCrossing) const;
 
   /**
    * And another version that takes a point in DOM tree rather than a node.
    */
   nsIContent* GetNextNodeInternal(const EditorRawDOMPoint& aPoint,
                                   bool aFindEditableNode, bool aFindAnyDataNode,
                                   bool aNoBlockCrossing) const;