Bug 1640276 - Part 7: Mark nsINode as const in IsVisibleBRElement() r=masayuki
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Sat, 23 May 2020 12:40:08 +0000
changeset 531799 3dcbb4d3d97263affdbbca60b15c0e78a98f3807
parent 531798 54cdb503a9152341ebdb1f375e2e6ada99054ab8
child 531800 9a2f741cef6ae4ae568a17fd3ffe52599f0a574f
push id116879
push userkrosylight@mozilla.com
push dateSat, 23 May 2020 14:48:36 +0000
treeherderautoland@3dcbb4d3d972 [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 7: Mark nsINode as const in IsVisibleBRElement() r=masayuki Differential Revision: https://phabricator.services.mozilla.com/D76570
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -853,17 +853,17 @@ void HTMLEditor::IsPrevCharInNodeWhitesp
     *outIsNBSP = (ch == kNBSP);
     if (outNode && outOffset) {
       NS_IF_ADDREF(*outNode = aContent);
       *outOffset = aOffset - 1;
     }
   }
 }
 
-bool HTMLEditor::IsVisibleBRElement(nsINode* aNode) {
+bool HTMLEditor::IsVisibleBRElement(const nsINode* aNode) {
   MOZ_ASSERT(aNode);
   if (!aNode->IsHTMLElement(nsGkAtoms::br)) {
     return false;
   }
   // Check if there is another element or text node in block after current
   // <br> element.
   // Note that even if following node is non-editable, it may make the
   // <br> element visible if it just exists.
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -923,17 +923,17 @@ class HTMLEditor final : public TextEdit
                                          const nsAString* aValue,
                                          nsAString* outValue = nullptr);
 
   static dom::Element* GetLinkElement(nsINode* aNode);
 
   /**
    * Small utility routine to test if a break node is visible to user.
    */
-  bool IsVisibleBRElement(nsINode* aNode);
+  bool IsVisibleBRElement(const nsINode* aNode);
 
   /**
    * Helper routines for font size changing.
    */
   enum class FontSize { incr, decr };
   MOZ_CAN_RUN_SCRIPT nsresult RelativeFontChangeOnTextNode(FontSize aDir,
                                                            Text& aTextNode,
                                                            int32_t aStartOffset,