Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0dafd3d138c2d4427019b7c21b8ca007e3f0a065
      
https://github.com/WebKit/WebKit/commit/0dafd3d138c2d4427019b7c21b8ca007e3f0a065
  Author: Jessica Cheung <[email protected]>
  Date:   2026-06-17 (Wed, 17 Jun 2026)

  Changed paths:
    A 
LayoutTests/editing/execCommand/change-list-type-strips-source-list-attributes-expected.txt
    A 
LayoutTests/editing/execCommand/change-list-type-strips-source-list-attributes.html
    A LayoutTests/editing/execCommand/change-list-type-undo-redo-expected.txt
    A LayoutTests/editing/execCommand/change-list-type-undo-redo.html
    M Source/WebCore/editing/ChangeListTypeCommand.cpp

  Log Message:
  -----------
  [Smart Lists] Convert to Numbered/Bulleted List doesn't change list formatting
https://bugs.webkit.org/show_bug.cgi?id=317188
rdar://178656218

Reviewed by Aditya Keerthi.

Currently, converting list formatting will successfully change the list
type (that is, the tags from <ol> to <ul> and vice versa) but the changed
list still renders as the original/source list type.

This is because when changing the list type, all the attributes are cloned.
So, an ordered list with `start="1" style="list-style-type: decimal;"
class="Apple-decimal-list"` will then become an unordered list with the
same attributes.

To fix this, strip the source list of its type specific attributes in a helper
function. Technically, only removing `list-style-type` is enough to fix this 
issue
but only removing this will cause an unordered list to potentially have a
start attribute and others specific to ordered lists. Thus, for
correctness, remove those attributes. Additionally, if the source list had
an Apple-specific marker class name or `list-style-type`, add the equivalent
for the changed list.

Add layout tests for this change. Add layout tests for the case where the user
converts the list, then undos the action, and redos.

* 
LayoutTests/editing/execCommand/change-list-type-strips-source-list-attributes-expected.txt:
 Added.
* 
LayoutTests/editing/execCommand/change-list-type-strips-source-list-attributes.html:
 Added.
* LayoutTests/editing/execCommand/change-list-type-undo-redo-expected.txt: 
Added.
* LayoutTests/editing/execCommand/change-list-type-undo-redo.html: Added.
* Source/WebCore/editing/ChangeListTypeCommand.cpp:
(WebCore::removeSourceListAttributes):
(WebCore::ChangeListTypeCommand::createNewList):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to