Bug 1727868 - Make `HTMLEditUtils::IsVisibleBRElement()` stop using `WSRunScanner` r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 06 Sep 2021 22:31:22 +0000
changeset 591140 0c79c667c59a344d54f360ffe67b92823790b6e7
parent 591139 f3a453eb5700042249820b9cb060492c64e5a5c2
child 591141 891ac85a6625cff469546795bcde4aca9db2a4c1
push id38768
push userctuns@mozilla.com
push dateTue, 07 Sep 2021 09:48:49 +0000
treeherdermozilla-central@eac402936496 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1727868
milestone94.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 1727868 - Make `HTMLEditUtils::IsVisibleBRElement()` stop using `WSRunScanner` r=m_kato The method may be used for checking a `<br>` element visibility in non-editable content too. Therefore, using `WSRunScanner` which is designed for scanning editable content hits assertions. The visibility of `<br>` element is considered only with the following visible thing. If it's followed only by another or current block boundary, the `<br>` element is invisible. But otherwise, it's visible. So, it needs to scan following contents to look for first visible thing until reaching a block boundary. And it does not need to check its previous content. Differential Revision: https://phabricator.services.mozilla.com/D123876
editor/libeditor/HTMLEditSubActionHandler.cpp
editor/libeditor/HTMLEditUtils.cpp
editor/libeditor/HTMLEditUtils.h
editor/libeditor/HTMLEditorDeleteHandler.cpp
editor/libeditor/WSRunObject.h
editor/libeditor/crashtests/crashtests.list
--- a/editor/libeditor/HTMLEditSubActionHandler.cpp
+++ b/editor/libeditor/HTMLEditSubActionHandler.cpp
@@ -759,17 +759,17 @@ nsresult HTMLEditor::EnsureCaretNotAfter
   }
 
   nsIContent* previousBRElement =
       HTMLEditUtils::GetPreviousContent(atSelectionStart, {}, editingHost);
   if (!previousBRElement || !previousBRElement->IsHTMLElement(nsGkAtoms::br) ||
       !previousBRElement->GetParent() ||
       !EditorUtils::IsEditableContent(*previousBRElement->GetParent(),
                                       EditorType::HTML) ||
-      !HTMLEditUtils::IsInvisibleBRElement(*previousBRElement, editingHost)) {
+      !HTMLEditUtils::IsInvisibleBRElement(*previousBRElement)) {
     return NS_OK;
   }
 
   const RefPtr<const Element> blockElementAtSelectionStart =
       HTMLEditUtils::GetInclusiveAncestorElement(
           *atSelectionStart.ContainerAsContent(),
           HTMLEditUtils::ClosestBlockElement);
   const RefPtr<const Element> parentBlockElementOfBRElement =
@@ -5682,18 +5682,17 @@ EditorDOMPoint HTMLEditor::GetCurrentHar
   // I.e., looking for start of current hard line.
   constexpr HTMLEditUtils::WalkTreeOptions
       ignoreNonEditableNodeAndStopAtBlockBoundary{
           WalkTreeOption::IgnoreNonEditableNode,
           WalkTreeOption::StopAtBlockBoundary};
   for (nsIContent* previousEditableContent = HTMLEditUtils::GetPreviousContent(
            point, ignoreNonEditableNodeAndStopAtBlockBoundary, editingHost);
        previousEditableContent && previousEditableContent->GetParentNode() &&
-       !HTMLEditUtils::IsVisibleBRElement(*previousEditableContent,
-                                          editingHost) &&
+       !HTMLEditUtils::IsVisibleBRElement(*previousEditableContent) &&
        !HTMLEditUtils::IsBlockElement(*previousEditableContent);
        previousEditableContent = HTMLEditUtils::GetPreviousContent(
            point, ignoreNonEditableNodeAndStopAtBlockBoundary, editingHost)) {
     point.Set(previousEditableContent);
     // XXX Why don't we check \n in pre-formated text node here?
   }
 
   // Finding the real start for this point unless current line starts after
@@ -5792,17 +5791,17 @@ EditorDOMPoint HTMLEditor::GetCurrentHar
        !HTMLEditUtils::IsBlockElement(*nextEditableContent) &&
        nextEditableContent->GetParent();
        nextEditableContent = HTMLEditUtils::GetNextContent(
            point, ignoreNonEditableNodeAndStopAtBlockBoundary, editingHost)) {
     point.SetAfter(nextEditableContent);
     if (NS_WARN_IF(!point.IsSet())) {
       break;
     }
-    if (HTMLEditUtils::IsVisibleBRElement(*nextEditableContent, editingHost)) {
+    if (HTMLEditUtils::IsVisibleBRElement(*nextEditableContent)) {
       break;
     }
 
     // Check for newlines in pre-formatted text nodes.
     if (nextEditableContent->IsText() &&
         EditorUtils::IsWhiteSpacePreformatted(*nextEditableContent)) {
       nsAutoString textContent;
       nextEditableContent->GetAsText()->GetData(textContent);
@@ -6810,27 +6809,25 @@ EditActionResult HTMLEditor::HandleInser
     // not in a text node.
     // is there a BR prior to it?
     Element* editingHost = GetActiveEditingHost();
     nsIContent* nearContent =
         editingHost ? HTMLEditUtils::GetPreviousContent(
                           atStartOfSelection,
                           {WalkTreeOption::IgnoreNonEditableNode}, editingHost)
                     : nullptr;
-    if (!nearContent ||
-        !HTMLEditUtils::IsVisibleBRElement(*nearContent, editingHost) ||
+    if (!nearContent || !HTMLEditUtils::IsVisibleBRElement(*nearContent) ||
         EditorUtils::IsPaddingBRElementForEmptyLastLine(*nearContent)) {
       // is there a BR after it?
       nearContent = editingHost ? HTMLEditUtils::GetNextContent(
                                       atStartOfSelection,
                                       {WalkTreeOption::IgnoreNonEditableNode},
                                       editingHost)
                                 : nullptr;
-      if (!nearContent ||
-          !HTMLEditUtils::IsVisibleBRElement(*nearContent, editingHost) ||
+      if (!nearContent || !HTMLEditUtils::IsVisibleBRElement(*nearContent) ||
           EditorUtils::IsPaddingBRElementForEmptyLastLine(*nearContent)) {
         pointToInsertBR = atStartOfSelection;
         splitAfterNewBR = true;
       }
     }
     if (!pointToInsertBR.IsSet() && nearContent->IsHTMLElement(nsGkAtoms::br)) {
       brContent = nearContent;
     }
@@ -8276,18 +8273,17 @@ nsresult HTMLEditor::AdjustCaretPosition
         blockElementContainingCaret ==
             blockElementContainingPreviousEditableContent &&
         point.ContainerAsContent()->GetEditingHost() ==
             previousEditableContent->GetEditingHost() &&
         previousEditableContent &&
         previousEditableContent->IsHTMLElement(nsGkAtoms::br)) {
       // If it's an invisible `<br>` element, we need to insert a padding
       // `<br>` element for making empty line have one-line height.
-      if (HTMLEditUtils::IsInvisibleBRElement(*previousEditableContent,
-                                              editingHost)) {
+      if (HTMLEditUtils::IsInvisibleBRElement(*previousEditableContent)) {
         CreateElementResult createPaddingBRResult =
             InsertPaddingBRElementForEmptyLastLineWithTransaction(point);
         if (createPaddingBRResult.Failed()) {
           NS_WARNING(
               "HTMLEditor::"
               "InsertPaddingBRElementForEmptyLastLineWithTransaction() "
               "failed");
           return createPaddingBRResult.Rv();
--- a/editor/libeditor/HTMLEditUtils.cpp
+++ b/editor/libeditor/HTMLEditUtils.cpp
@@ -11,16 +11,17 @@
 #include "mozilla/ArrayUtils.h"      // for ArrayLength
 #include "mozilla/Assertions.h"      // for MOZ_ASSERT, etc.
 #include "mozilla/EditAction.h"      // for EditAction
 #include "mozilla/EditorBase.h"      // for EditorBase, EditorType
 #include "mozilla/EditorDOMPoint.h"  // for EditorDOMPoint, etc.
 #include "mozilla/EditorUtils.h"     // for EditorUtils
 #include "mozilla/dom/Element.h"     // for Element, nsINode
 #include "mozilla/dom/HTMLAnchorElement.h"
+#include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/Text.h"  // for Text
 
 #include "nsAString.h"  // for nsAString::IsEmpty
 #include "nsAtom.h"     // for nsAtom
 #include "nsCaseTreatment.h"
 #include "nsCOMPtr.h"        // for nsCOMPtr, operator==, etc.
 #include "nsDebug.h"         // for NS_ASSERTION, etc.
 #include "nsElementTable.h"  // for nsHTMLElement
@@ -432,80 +433,116 @@ bool HTMLEditUtils::IsInVisibleTextFrame
   rv = selectionController->CheckVisibilityContent(
       const_cast<Text*>(&aText), 0, aText.TextDataLength(), &isVisible);
   NS_WARNING_ASSERTION(
       NS_SUCCEEDED(rv),
       "nsISelectionController::CheckVisibilityContent() failed");
   return NS_SUCCEEDED(rv) && isVisible;
 }
 
-bool HTMLEditUtils::IsVisibleBRElement(
-    const nsIContent& aContent, const Element* aEditingHost /* = nullptr */) {
+bool HTMLEditUtils::IsVisibleBRElement(const nsIContent& aContent) {
   if (!aContent.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.
-  // E.g., foo<br><button contenteditable="false">button</button>
-  // However, we need to ignore invisible data nodes like comment node.
-  if (!aEditingHost) {
-    aEditingHost = HTMLEditUtils::GetInclusiveAncestorElement(
-        aContent,
-        HTMLEditUtils::ClosestEditableBlockElementOrInlineEditingHost);
-    if (NS_WARN_IF(!aEditingHost)) {
-      return false;
-    }
-  }
-  nsIContent* nextContent =
-      HTMLEditUtils::GetNextContent(aContent,
-                                    {WalkTreeOption::IgnoreDataNodeExceptText,
-                                     WalkTreeOption::StopAtBlockBoundary},
-                                    aEditingHost);
-  if (nextContent && nextContent->IsHTMLElement(nsGkAtoms::br)) {
+
+  // First, we get a block container because <br> element shouldn't be a
+  // direct child of a Document node.
+  Element* maybeNonEditableAncestorBlock = HTMLEditUtils::GetAncestorElement(
+      aContent, HTMLEditUtils::ClosestBlockElement);
+  if (NS_WARN_IF(!maybeNonEditableAncestorBlock)) {
     return true;
   }
 
-  // A single line break before a block boundary is not displayed, so e.g.
-  // foo<p>bar<br></p> and foo<br><p>bar</p> display the same as foo<p>bar</p>.
-  // But if there are multiple <br>s in a row, all but the last are visible.
-  if (!nextContent) {
-    // This break is trailer in block, it's not visible
-    return false;
-  }
-  if (HTMLEditUtils::IsBlockElement(*nextContent)) {
-    // Break is right before a block, it's not visible
-    return false;
+  // Then, scan visible content after the <br> elemenet.
+  for (nsIContent* nextContent = HTMLEditUtils::GetNextContent(
+           aContent,
+           {WalkTreeOption::IgnoreDataNodeExceptText,
+            WalkTreeOption::StopAtBlockBoundary},
+           maybeNonEditableAncestorBlock);
+       nextContent; nextContent = HTMLEditUtils::GetNextContent(
+                        *nextContent,
+                        {WalkTreeOption::IgnoreDataNodeExceptText,
+                         WalkTreeOption::StopAtBlockBoundary},
+                        maybeNonEditableAncestorBlock)) {
+    if (nextContent->IsElement()) {
+      // Break is right before a child block, it's not visible
+      if (HTMLEditUtils::IsBlockElement(*nextContent)) {
+        return false;
+      }
+
+      // XXX How about other non-HTML elements?  Assume they are styled as
+      //     blocks for now.
+      if (!nextContent->IsHTMLElement()) {
+        return false;
+      }
+
+      // If followed by another <br> element or an visible element, it's a
+      // visible <br> element.
+      if (nextContent->IsAnyOfHTMLElements(
+              nsGkAtoms::br, nsGkAtoms::applet, nsGkAtoms::iframe,
+              nsGkAtoms::img, nsGkAtoms::meter, nsGkAtoms::progress,
+              nsGkAtoms::select, nsGkAtoms::textarea)) {
+        return true;
+      }
+
+      if (HTMLInputElement* inputElement =
+              HTMLInputElement::FromNode(nextContent)) {
+        if (inputElement->ControlType() == FormControlType::InputHidden) {
+          continue;  // Keep scanning next one due to invisible form control.
+        }
+        return true;  // Followed by a visible form control so that visible
+                      // <br>.
+      }
+
+      continue;
+    }
+
+    // If the following text node is not white-spaces only and non-empty,
+    // the <br> element is visible.
+    Text* textNode = Text::FromNode(nextContent);
+    if (!textNode) {
+      continue;  // XXX Is this possible?
+    }
+    if (!textNode->TextLength()) {
+      continue;  // empty invisible text node, keep scanning next one.
+    }
+    if (!textNode->TextIsOnlyWhitespace()) {
+      return true;  // followed by a visible text node, so, visible <br>.
+    }
+    const nsTextFragment& textFragment = textNode->TextFragment();
+    const bool isWhiteSpacePreformatted =
+        EditorUtils::IsWhiteSpacePreformatted(*textNode);
+    const bool isNewLinePreformatted =
+        EditorUtils::IsNewLinePreformatted(*textNode);
+    if (!isWhiteSpacePreformatted && !isNewLinePreformatted) {
+      // if the white-space only text node is not preformatted, ignore it.
+      continue;
+    }
+    for (uint32_t i = 0; i < textFragment.GetLength(); i++) {
+      // If followed by a preformatted new line, the <br> element is visible.
+      if (textFragment.CharAt(AssertedCast<int32_t>(i)) ==
+          HTMLEditUtils::kNewLine) {
+        if (isNewLinePreformatted) {
+          return true;
+        }
+        continue;
+      }
+      // If followed by a preformatted white-space, the <br> element is
+      // visible.
+      if (isWhiteSpacePreformatted) {
+        return true;
+      }
+    }
+    // All white-spaces in the text node is invisible, keep scanning next one.
   }
 
-  // If there's an inline node after this one that's not a break, and also a
-  // prior break, this break must be visible.
-  // Note that even if previous node is non-editable, it may make the
-  // <br> element visible if it just exists.
-  // E.g., <button contenteditable="false"><br>foo
-  // However, we need to ignore invisible data nodes like comment node.
-  nsIContent* previousContent = HTMLEditUtils::GetPreviousContent(
-      aContent,
-      {WalkTreeOption::IgnoreDataNodeExceptText,
-       WalkTreeOption::StopAtBlockBoundary},
-      aEditingHost);
-  if (previousContent && previousContent->IsHTMLElement(nsGkAtoms::br)) {
-    return true;
-  }
-
-  // Sigh.  We have to use expensive white-space calculation code to
-  // determine what is going on
-  EditorRawDOMPoint afterBRElement(EditorRawDOMPoint::After(aContent));
-  if (NS_WARN_IF(!afterBRElement.IsSet())) {
-    return false;
-  }
-  return !WSRunScanner::ScanNextVisibleNodeOrBlockBoundary(
-              const_cast<Element*>(aEditingHost), afterBRElement)
-              .ReachedBlockBoundary();
+  // There is no visible content and reached current block boundary.  Then,
+  // the <br> element is the last content in the block and invisible.
+  // XXX Should we treat it visible if it's the only child of a block?
+  return false;
 }
 
 bool HTMLEditUtils::IsEmptyNode(nsPresContext* aPresContext,
                                 const nsINode& aNode,
                                 const EmptyCheckOptions& aOptions /* = {} */,
                                 bool* aSeenBR /* = nullptr */) {
   MOZ_ASSERT_IF(aOptions.contains(EmptyCheckOption::SafeToAskLayout),
                 aPresContext);
--- a/editor/libeditor/HTMLEditUtils.h
+++ b/editor/libeditor/HTMLEditUtils.h
@@ -305,27 +305,21 @@ class HTMLEditUtils final {
    */
   static bool IsInVisibleTextFrames(nsPresContext* aPresContext,
                                     const dom::Text& aText);
 
   /**
    * IsVisibleBRElement() and IsInvisibleBRElement() return true if aContent is
    * a visible HTML <br> element, i.e., not a padding <br> element for making
    * last line in a block element visible, or an invisible <br> element.
-   *
-   * If aEditingHost is omitted, this computes parent editable block for you.
-   * But if you call this a lot, please specify proper editing host (or parent
-   * block) for the performance.
    */
-  static bool IsVisibleBRElement(const nsIContent& aContent,
-                                 const Element* aEditingHost = nullptr);
-  static bool IsInvisibleBRElement(const nsIContent& aContent,
-                                   const Element* aEditingHost = nullptr) {
+  static bool IsVisibleBRElement(const nsIContent& aContent);
+  static bool IsInvisibleBRElement(const nsIContent& aContent) {
     return aContent.IsHTMLElement(nsGkAtoms::br) &&
-           !HTMLEditUtils::IsVisibleBRElement(aContent, aEditingHost);
+           !HTMLEditUtils::IsVisibleBRElement(aContent);
   }
 
   /**
    * IsEmptyNode() returns false if aNode has some visible content nodes,
    * list elements or table elements.
    *
    * @param aPresContext    Must not be nullptr if
    *                        EmptyCheckOption::SafeToAskLayout is set.
--- a/editor/libeditor/HTMLEditorDeleteHandler.cpp
+++ b/editor/libeditor/HTMLEditorDeleteHandler.cpp
@@ -1286,17 +1286,17 @@ nsresult HTMLEditor::AutoDeleteRangesHan
             wsRunScannerAtCaret.GetEditingHost()) {
           return NS_OK;
         }
         if (!EditorUtils::IsEditableContent(
                 *scanFromCaretPointResult.BRElementPtr(), EditorType::HTML)) {
           return NS_SUCCESS_DOM_NO_OPERATION;
         }
         if (HTMLEditUtils::IsInvisibleBRElement(
-                *scanFromCaretPointResult.BRElementPtr(), editingHost)) {
+                *scanFromCaretPointResult.BRElementPtr())) {
           EditorDOMPoint newCaretPosition =
               aDirectionAndAmount == nsIEditor::eNext
                   ? EditorDOMPoint::After(
                         *scanFromCaretPointResult.BRElementPtr())
                   : EditorDOMPoint(scanFromCaretPointResult.BRElementPtr());
           if (NS_WARN_IF(!newCaretPosition.IsSet())) {
             return NS_ERROR_FAILURE;
           }
@@ -1558,17 +1558,17 @@ EditActionResult HTMLEditor::AutoDeleteR
         if (scanFromCaretPointResult.BRElementPtr() == editingHost) {
           return EditActionHandled();
         }
         if (!EditorUtils::IsEditableContent(
                 *scanFromCaretPointResult.BRElementPtr(), EditorType::HTML)) {
           return EditActionCanceled();
         }
         if (HTMLEditUtils::IsInvisibleBRElement(
-                *scanFromCaretPointResult.BRElementPtr(), editingHost)) {
+                *scanFromCaretPointResult.BRElementPtr())) {
           // TODO: We should extend the range to delete again before/after
           //       the caret point and use `HandleDeleteNonCollapsedRanges()`
           //       instead after we would create delete range computation
           //       method at switching to the new white-space normalizer.
           nsresult rv = WhiteSpaceVisibilityKeeper::
               DeleteContentNodeAndJoinTextNodesAroundIt(
                   aHTMLEditor,
                   MOZ_KnownLive(*scanFromCaretPointResult.BRElementPtr()),
@@ -2373,18 +2373,17 @@ HTMLEditor::AutoDeleteRangesHandler::Com
   return rv;
 }
 
 EditActionResult HTMLEditor::AutoDeleteRangesHandler::HandleDeleteAtomicContent(
     HTMLEditor& aHTMLEditor, nsIContent& aAtomicContent,
     const EditorDOMPoint& aCaretPoint,
     const WSRunScanner& aWSRunScannerAtCaret) {
   MOZ_ASSERT(aHTMLEditor.IsEditActionDataAvailable());
-  MOZ_ASSERT(!HTMLEditUtils::IsInvisibleBRElement(
-      aAtomicContent, aWSRunScannerAtCaret.GetEditingHost()));
+  MOZ_ASSERT(!HTMLEditUtils::IsInvisibleBRElement(aAtomicContent));
   MOZ_ASSERT(&aAtomicContent != aWSRunScannerAtCaret.GetEditingHost());
 
   nsresult rv =
       WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt(
           aHTMLEditor, aAtomicContent, aCaretPoint);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     NS_WARNING(
         "WhiteSpaceVisibilityKeeper::DeleteContentNodeAndJoinTextNodesAroundIt("
@@ -3764,17 +3763,17 @@ HTMLEditor::AutoDeleteRangesHandler::Del
     //     guaranteed only when ReachedCurrentBlockBoundary() returns true.
     //     However, looks like that this code assumes that
     //     GetEndReasonContent() returns the (or a) <br> element.
     NS_ASSERTION(wsScannerForPoint.GetEndReasonContent() ==
                      forwardScanFromPointResult.BRElementPtr(),
                  "End reason is not the reached <br> element");
     // If the <br> element is visible, we shouldn't remove the parent block.
     if (HTMLEditUtils::IsVisibleBRElement(
-            *wsScannerForPoint.GetEndReasonContent(), editingHost)) {
+            *wsScannerForPoint.GetEndReasonContent())) {
       return NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND;
     }
     if (wsScannerForPoint.GetEndReasonContent()->GetNextSibling()) {
       WSScanResult scanResult =
           WSRunScanner::ScanNextVisibleNodeOrBlockBoundary(
               editingHost, EditorRawDOMPoint::After(
                                *wsScannerForPoint.GetEndReasonContent()));
       if (scanResult.Failed()) {
@@ -4442,17 +4441,17 @@ nsresult HTMLEditor::AutoDeleteRangesHan
       // If the range starts from end of a container, and computed block
       // boundaries range starts from an invisible `<br>` element,  we
       // may need to shrink the range.
       Element* editingHost = aHTMLEditor.GetActiveEditingHost();
       NS_WARNING_ASSERTION(editingHost, "There was no editing host");
       nsIContent* nextContent =
           atStart.IsEndOfContainer() && range.StartRef().GetChild() &&
                   HTMLEditUtils::IsInvisibleBRElement(
-                      *range.StartRef().GetChild(), editingHost)
+                      *range.StartRef().GetChild())
               ? HTMLEditUtils::GetNextContent(
                     *atStart.ContainerAsContent(),
                     {WalkTreeOption::IgnoreDataNodeExceptText,
                      WalkTreeOption::StopAtBlockBoundary},
                     editingHost)
               : nullptr;
       if (!nextContent || nextContent != range.StartRef().GetChild()) {
         noNeedToChangeStart = true;
@@ -5396,17 +5395,17 @@ bool HTMLEditor::AutoDeleteRangesHandler
         //     same as the reached <br> element because the equality is
         //     guaranteed only when ReachedCurrentBlockBoundary() returns true.
         //     However, looks like that this code assumes that
         //     GetEndReasonContent() returns the (or a) <br> element.
         NS_ASSERTION(wsScannerAtEnd.GetEndReasonContent() ==
                          forwardScanFromEndResult.BRElementPtr(),
                      "End reason is not the reached <br> element");
         if (HTMLEditUtils::IsVisibleBRElement(
-                *wsScannerAtEnd.GetEndReasonContent(), editingHost)) {
+                *wsScannerAtEnd.GetEndReasonContent())) {
           break;
         }
         if (!atFirstInvisibleBRElement.IsSet()) {
           atFirstInvisibleBRElement = atEnd;
         }
         atEnd.SetAfter(wsScannerAtEnd.GetEndReasonContent());
         continue;
       }
--- a/editor/libeditor/WSRunObject.h
+++ b/editor/libeditor/WSRunObject.h
@@ -931,23 +931,21 @@ class MOZ_STACK_CLASS WSRunScanner final
 
     bool StartsFromNonCollapsibleCharacters() const {
       return mStart.IsNonCollapsibleCharacters();
     }
     bool StartsFromSpecialContent() const { return mStart.IsSpecialContent(); }
     bool StartsFromBRElement() const { return mStart.IsBRElement(); }
     bool StartsFromVisibleBRElement() const {
       return StartsFromBRElement() &&
-             HTMLEditUtils::IsVisibleBRElement(*GetStartReasonContent(),
-                                               mEditingHost);
+             HTMLEditUtils::IsVisibleBRElement(*GetStartReasonContent());
     }
     bool StartsFromInvisibleBRElement() const {
       return StartsFromBRElement() &&
-             HTMLEditUtils::IsInvisibleBRElement(*GetStartReasonContent(),
-                                                 mEditingHost);
+             HTMLEditUtils::IsInvisibleBRElement(*GetStartReasonContent());
     }
     bool StartsFromPreformattedLineBreak() const {
       return mStart.IsPreformattedLineBreak();
     }
     bool StartsFromCurrentBlockBoundary() const {
       return mStart.IsCurrentBlockBoundary();
     }
     bool StartsFromOtherBlockElement() const {
@@ -956,22 +954,22 @@ class MOZ_STACK_CLASS WSRunScanner final
     bool StartsFromBlockBoundary() const { return mStart.IsBlockBoundary(); }
     bool StartsFromHardLineBreak() const { return mStart.IsHardLineBreak(); }
     bool EndsByNonCollapsibleCharacters() const {
       return mEnd.IsNonCollapsibleCharacters();
     }
     bool EndsBySpecialContent() const { return mEnd.IsSpecialContent(); }
     bool EndsByBRElement() const { return mEnd.IsBRElement(); }
     bool EndsByVisibleBRElement() const {
-      return EndsByBRElement() && HTMLEditUtils::IsVisibleBRElement(
-                                      *GetEndReasonContent(), mEditingHost);
+      return EndsByBRElement() &&
+             HTMLEditUtils::IsVisibleBRElement(*GetEndReasonContent());
     }
     bool EndsByInvisibleBRElement() const {
-      return EndsByBRElement() && HTMLEditUtils::IsInvisibleBRElement(
-                                      *GetEndReasonContent(), mEditingHost);
+      return EndsByBRElement() &&
+             HTMLEditUtils::IsInvisibleBRElement(*GetEndReasonContent());
     }
     bool EndsByPreformattedLineBreak() const {
       return mEnd.IsPreformattedLineBreak();
     }
     bool EndsByCurrentBlockBoundary() const {
       return mEnd.IsCurrentBlockBoundary();
     }
     bool EndsByOtherBlockElement() const { return mEnd.IsOtherBlockBoundary(); }
--- a/editor/libeditor/crashtests/crashtests.list
+++ b/editor/libeditor/crashtests/crashtests.list
@@ -123,17 +123,17 @@ load 1556799.html
 load 1579934.html
 load 1574544.html
 load 1578916.html
 load 1581246.html
 load 1596516.html
 load 1605741.html
 load 1613521.html
 load 1618906.html
-asserts(1-2) load 1623166.html # assertions in WSRunScanner::GetEditableBlockParentOrTopmostEditableInlineContent() ("indent" causes one in all platforms, the other is caused by "removeList" command enabled check only on Linux (and perhaps, Android))
+load 1623166.html
 load 1623913.html
 load 1624005.html # throws
 load 1624007.html
 load 1624011.html
 load 1626002.html
 load 1636541.html
 load 1644903.html
 load 1645983-1.html