Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 97d658482be252a38bb1128072ec6a3372928605
      
https://github.com/WebKit/WebKit/commit/97d658482be252a38bb1128072ec6a3372928605
  Author: Ahmad Saleem <[email protected]>
  Date:   2023-01-03 (Tue, 03 Jan 2023)

  Changed paths:
    A LayoutTests/editing/execCommand/listify-output-crash-expected.txt
    A LayoutTests/editing/execCommand/listify-output-crash.html
    M Source/WebCore/editing/InsertListCommand.cpp

  Log Message:
  -----------
  Make sure calling moveParagaph() with proper parameters in 
InsertListCommand::listifyParagraph()

Make sure calling moveParagaph() with proper parameters in 
InsertListCommand::listifyParagraph()
https://bugs.webkit.org/show_bug.cgi?id=202900

Reviewed by Ryosuke Niwa.

Merge - https://src.chromium.org/viewvc/blink?view=rev&revision=175338

This patch changes InsertListCommand::listifyParagraph() to calculate start and
end positions of paragraph to move before calling moveParagaph().

Before this patch start and end positions are calculated then we insert a list
element, UL/OL, and list item element, LI. These insertion can make start and
end position no longer points paragraph boundary, attached test case causes this
situation.

Calculating start and end positions of paragraph after all DOM tree
modifications ensures we call moveParagraph with valid parameters.

* Source/WebCore/editing/InsertListCommand.cpp:
(InsertListCommand::listifyParagraph): Refactor to update layout before 
selecting new start and end boundaries
* LayoutTests/editing/execCommand/listify-output-crash.html: Add Test Case
* LayoutTests/editing/execCommand/listify-output-crash-expected.txt: Add Test 
Case Expectation

Canonical link: https://commits.webkit.org/258416@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to