Loading editor/libeditor/AutoRangeArray.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -665,6 +665,7 @@ GetPointAtFirstContentOfLineOrParentHTMLBlockIfFirstContentOfBlock( // If we're formatting a block, we should reformat first ancestor format // block. if (aEditSubAction == EditSubAction::eFormatBlockForHTMLCommand && point.IsContainerElement() && HTMLEditUtils::IsFormatElementForFormatBlockCommand( *point.ContainerAs<Element>())) { point.Set(point.GetContainer()); Loading Loading @@ -836,6 +837,7 @@ static EditorDOMPoint GetPointAfterFollowingLineBreakOrAtFollowingHTMLBlock( // If we're formatting a block, we should reformat first ancestor format // block. if (aEditSubAction == EditSubAction::eFormatBlockForHTMLCommand && point.IsContainerElement() && HTMLEditUtils::IsFormatElementForFormatBlockCommand( *point.ContainerAs<Element>())) { point.SetAfter(point.GetContainer()); Loading editor/libeditor/EditorDOMPoint.h +5 −0 Original line number Diff line number Diff line Loading @@ -278,6 +278,11 @@ class EditorDOMPointBase final { return mParent && mParent->IsInNativeAnonymousSubtree(); } /** * Returns true if the container node is an element node. */ bool IsContainerElement() const { return mParent && mParent->IsElement(); } /** * IsContainerHTMLElement() returns true if the container node is an HTML * element node and its node name is aTag. Loading testing/web-platform/tests/editing/crashtests/formatblock-when-root-is-editing-host.html 0 → 100644 +16 −0 Original line number Diff line number Diff line <!doctype html> <html> <head> <meta charset="utf-8"> <script> "use strict"; document.addEventListener("DOMContentLoaded", () => { document.documentElement.contentEditable = "true"; document.execCommand("formatBlock", false, "h3"); }, {once: true}); </script> </head> <body> text <!-- no-final-newline --> No newline at end of file Loading
editor/libeditor/AutoRangeArray.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -665,6 +665,7 @@ GetPointAtFirstContentOfLineOrParentHTMLBlockIfFirstContentOfBlock( // If we're formatting a block, we should reformat first ancestor format // block. if (aEditSubAction == EditSubAction::eFormatBlockForHTMLCommand && point.IsContainerElement() && HTMLEditUtils::IsFormatElementForFormatBlockCommand( *point.ContainerAs<Element>())) { point.Set(point.GetContainer()); Loading Loading @@ -836,6 +837,7 @@ static EditorDOMPoint GetPointAfterFollowingLineBreakOrAtFollowingHTMLBlock( // If we're formatting a block, we should reformat first ancestor format // block. if (aEditSubAction == EditSubAction::eFormatBlockForHTMLCommand && point.IsContainerElement() && HTMLEditUtils::IsFormatElementForFormatBlockCommand( *point.ContainerAs<Element>())) { point.SetAfter(point.GetContainer()); Loading
editor/libeditor/EditorDOMPoint.h +5 −0 Original line number Diff line number Diff line Loading @@ -278,6 +278,11 @@ class EditorDOMPointBase final { return mParent && mParent->IsInNativeAnonymousSubtree(); } /** * Returns true if the container node is an element node. */ bool IsContainerElement() const { return mParent && mParent->IsElement(); } /** * IsContainerHTMLElement() returns true if the container node is an HTML * element node and its node name is aTag. Loading
testing/web-platform/tests/editing/crashtests/formatblock-when-root-is-editing-host.html 0 → 100644 +16 −0 Original line number Diff line number Diff line <!doctype html> <html> <head> <meta charset="utf-8"> <script> "use strict"; document.addEventListener("DOMContentLoaded", () => { document.documentElement.contentEditable = "true"; document.execCommand("formatBlock", false, "h3"); }, {once: true}); </script> </head> <body> text <!-- no-final-newline --> No newline at end of file