Removing/outdent a line from ordered list causes the following list to start with an incorrect number#62938
Conversation
|
EWS run on previous version of this PR (hash 8916351) Details
|
|
EWS run on previous version of this PR (hash 91e0c11) Details
|
pxlcoder
left a comment
There was a problem hiding this comment.
r+ with the one comment addressed.
|
EWS run on previous version of this PR (hash 7513d20) Details
|
Looks like there's some more work needed here. We should not be adding the start attribute if the list already starts at 1.
|
EWS run on previous version of this PR (hash 0c5aafd) Details
|
|
EWS run on previous version of this PR (hash a17f816) Details |
|
EWS run on previous version of this PR (hash cda9543) Details |
|
The latest version of the PR makes an additional change to |
|
EWS run on current version of this PR (hash a385044) Details |
…o start with an incorrect number https://bugs.webkit.org/show_bug.cgi?id=312522 rdar://173537449 Reviewed by Aditya Keerthi. In unlistifyParagraph, there isn't a procedure to set the starting list number after splitting. So, when it calls splitElement() to split the list, this calls Element::cloneElementWithoutChildren which clones all attributes, including the start attribute. For example, if the original list started with 11 and the list is split in the middle, both lists now start with 11. The expectation is when splitting the list, the second list starts from 1. Thus, make a function that splits the list and sets the second starting list number to be 1 if a start attribute was originally provided. Otherwise, don't do anything. Now, outdenting, removing list formatting, and entering to create new lines should all have the following list start with 1. Additionally, add layout tests for the cases to confirm the correct starting list numbers. For outdenting and remove list formatting, both go down the same code path so there is only one test. * LayoutTests/editing/execCommand/break-out-of-list-resets-start-number-expected.txt: Added. * LayoutTests/editing/execCommand/break-out-of-list-resets-start-number.html: Added. * LayoutTests/editing/execCommand/outdent-list-resets-start-number-expected.txt: Added. * LayoutTests/editing/execCommand/outdent-list-resets-start-number.html: Added. * Source/WebCore/editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::splitListElement): (WebCore::CompositeEditCommand::moveParagraphs): * Source/WebCore/editing/CompositeEditCommand.h: * Source/WebCore/editing/InsertListCommand.cpp: (WebCore::InsertListCommand::unlistifyParagraph): Canonical link: https://commits.webkit.org/311696@main
a385044 to
4216f6e
Compare
|
Committed 311696@main (4216f6e): https://commits.webkit.org/311696@main Reviewed commits have been landed. Closing PR #62938 and removing active labels. |
🛠 vision-apple
4216f6e
a385044