Title: [292219] trunk/Source/WebCore
Revision
292219
Author
[email protected]
Date
2022-04-01 07:11:39 -0700 (Fri, 01 Apr 2022)

Log Message

Abort formatBlock command on null start or end selections
https://bugs.webkit.org/show_bug.cgi?id=238657

Patch by Rob Buis <[email protected]> on 2022-04-01
Reviewed by Wenson Hsieh.

Abort formatBlock command in case selectionForParagraphIteration
returns with a null start or end selection due to inline table specific
adjustments.

* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::doApply):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (292218 => 292219)


--- trunk/Source/WebCore/ChangeLog	2022-04-01 13:12:02 UTC (rev 292218)
+++ trunk/Source/WebCore/ChangeLog	2022-04-01 14:11:39 UTC (rev 292219)
@@ -1,3 +1,17 @@
+2022-04-01  Rob Buis  <[email protected]>
+
+        Abort formatBlock command on null start or end selections
+        https://bugs.webkit.org/show_bug.cgi?id=238657
+
+        Reviewed by Wenson Hsieh.
+
+        Abort formatBlock command in case selectionForParagraphIteration
+        returns with a null start or end selection due to inline table specific
+        adjustments.
+
+        * editing/ApplyBlockElementCommand.cpp:
+        (WebCore::ApplyBlockElementCommand::doApply):
+
 2022-04-01  Youenn Fablet  <[email protected]>
 
         ServiceWorkerRegistration.getNotifications should list all persistent notifications

Modified: trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp (292218 => 292219)


--- trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp	2022-04-01 13:12:02 UTC (rev 292218)
+++ trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp	2022-04-01 14:11:39 UTC (rev 292219)
@@ -78,10 +78,13 @@
     }
 
     VisibleSelection selection = selectionForParagraphIteration(endingSelection());
+
     VisiblePosition startOfSelection = selection.visibleStart();
+    if (startOfSelection.isNull())
+        return;
     VisiblePosition endOfSelection = selection.visibleEnd();
-    ASSERT(!startOfSelection.isNull());
-    ASSERT(!endOfSelection.isNull());
+    if (endOfSelection.isNull())
+        return;
     RefPtr<ContainerNode> startScope;
     int startIndex = indexForVisiblePosition(startOfSelection, startScope);
     RefPtr<ContainerNode> endScope;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to