Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 50525f0a0dc7c35bb5627cabaa4d09cf3629619b
https://github.com/WebKit/WebKit/commit/50525f0a0dc7c35bb5627cabaa4d09cf3629619b
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-29 (Tue, 29 Sep 2026)
Changed paths:
M Source/WebCore/editing/ChangeListTypeCommand.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebViewEditActions.mm
Log Message:
-----------
ChangeListTypeCommand leaves a stray type attribute when converting <ul> to
<ol>
https://bugs.webkit.org/show_bug.cgi?id=325343
rdar://188445470
Reviewed by Wenson Hsieh.
When changing a list's type, createNewList() clones the source list's attributes
onto the new list via cloneDataFromElement(), then removeSourceListAttributes()
strips the ones that don't apply to the target. That stripping only removed the
start, type, and reversed attributes on the <ol> to <ul> path. The type
attribute, however, is presentational on both elements but takes non-
interchangeable values ("circle"/"disc"/"square" on <ul> versus
"1"/"a"/"A"/"i"/"I" on <ol>), so converting <ul type="circle"> to an ordered
list produced an invalid <ol type="circle">.
Always remove the type attribute regardless of conversion direction, since the
source value is never valid on the target. start and reversed are <ol>-only, so
they continue to be stripped only on the <ol> to <ul> path.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebViewEditActions.mm
* Source/WebCore/editing/ChangeListTypeCommand.cpp:
(WebCore::removeSourceListAttributes):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebViewEditActions.mm:
(TestWebKitAPI::TEST(WKWebViewEditActions,
ChangeListTypeRemovesIncompatibleAttributes)):
Canonical link: https://commits.webkit.org/322170@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications