[webkit-changes] [WebKit/WebKit] 97d658: Make sure calling moveParagaph() with proper param...
Ahmad Saleem
noreply at github.com
Tue Jan 3 18:19:55 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 97d658482be252a38bb1128072ec6a3372928605
https://github.com/WebKit/WebKit/commit/97d658482be252a38bb1128072ec6a3372928605
Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
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
More information about the webkit-changes
mailing list