Skip to content

[CSS] Unprefix text-decoration shorthand - #23121

Closed
mdubet wants to merge 1 commit into
WebKit:mainfrom
mdubet:unprefix-text-decoration-single-commit
Closed

mdubet wants to merge 1 commit into
WebKit:mainfrom
mdubet:unprefix-text-decoration-single-commit

Conversation

@mdubet

@mdubet mdubet commented Jan 23, 2024 •

Copy link
Copy Markdown
Contributor

74b5325

[CSS] Unprefix text-decoration shorthand
https://bugs.webkit.org/show_bug.cgi?id=230083
rdar://83182835

 Reviewed by NOBODY (OOPS!).

 Explanation of why this fixes the bug (OOPS!).

* LayoutTests/TestExpectations:
* LayoutTests/editing/deleting/merge-paragraphs-with-transparent-background-expected.txt:
* LayoutTests/editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt:
* LayoutTests/editing/pasteboard/insert-u-with-text-decoration-none-expected.txt:
* LayoutTests/editing/pasteboard/preserve-underline-color-expected.txt:
* LayoutTests/editing/style/push-down-implicit-styles-mac-expected.txt:
* LayoutTests/editing/style/push-down-implicit-styles-mac.html:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration-expected.txt:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration.html:
* LayoutTests/fast/css/link-alternate-stylesheet-1-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-1.html:
* LayoutTests/fast/css/link-alternate-stylesheet-2-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-2.html:
* LayoutTests/fast/css/link-alternate-stylesheet-3-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-3.html:
* LayoutTests/fast/css/link-alternate-stylesheet-4-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-4.html:
* LayoutTests/fast/css/link-alternate-stylesheet-5-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-5.html:
* LayoutTests/fast/css/link-disabled-attr-expected.txt:
* LayoutTests/fast/css/link-disabled-attr.html:
* LayoutTests/fast/css/style-enumerate-properties-expected.txt:
* LayoutTests/fast/css/style-enumerate-properties.html:
* LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt:
* LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dashed.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted.html:
* LayoutTests/fast/events/before-input-events-prevent-drag-and-drop-expected.txt:
* LayoutTests/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* LayoutTests/fast/events/ondrop-text-html-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-serialization.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-decoration-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/multitest_8001-9000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_1-1000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_1001-2000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_2001-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_1-1000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_2001-last-expected.txt:
* LayoutTests/media/track/webvtt-inline-expected.txt:
* LayoutTests/media/track/webvtt-inline.html:
* LayoutTests/platform/glib/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/strikethrough_1-1000-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/strikethrough_1001-2000-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/strikethrough_2001-last-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/underline_1-1000-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/underline_2001-last-expected.txt:
* LayoutTests/platform/mac/fast/events/ondrop-text-html-expected.txt:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle const):
(WebCore::ComputedStyleExtractor::textDecorationShorthandValue const):
* Source/WebCore/css/ComputedStyleExtractor.h:
* Source/WebCore/css/MutableStyleProperties.cpp:
(WebCore::MutableStyleProperties::setProperty):
* Source/WebCore/css/MutableStyleProperties.h:
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serialize):
* Source/WebCore/css/StyleProperties.cpp:
(WebCore::canUseShorthandForLonghand):
(WebCore::StyleProperties::asTextInternal const):
* Source/WebCore/css/html.css:
(abbr[title], acronym[title]):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleWithResolvedTextDecorations const):
(WebCore::EditingStyle::textDirection const):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::removeEquivalentProperties):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
* Source/WebCore/editing/markup.cpp:
(WebCore::serializePreservingVisualAppearanceInternal):
* Source/WebCore/rendering/style/RenderStyleConstants.h:

74b5325

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ❌ 🧪 wpe-wk2 ❌ 🧪 win-tests
✅ 🧪 webkitperl ❌ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ❌ 🧪 mac-wk1 ❌ 🛠 wpe-cairo
✅ 🧪 api-ios ❌ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ❌ 🧪 mac-AS-debug-wk2 ⏳ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ❌ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@mdubet mdubet self-assigned this Jan 23, 2024
@mdubet mdubet added the CSS Cascading Style Sheets implementation label Jan 23, 2024
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from 040ff91 to 016917f Compare January 23, 2024 21:57

@Loirooriol Loirooriol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked in detail, but this seems similar to 5425a41, which was reverted in https://bugs.webkit.org/show_bug.cgi?id=237412 for perf reasons.

Are you addressing that in a particular way, or just hoping that it will work this time?

Comment thread Source/WebCore/editing/markup.cpp Resolved
Comment thread Source/WebCore/editing/EditingStyle.cpp Resolved
Comment thread Source/WebCore/editing/EditingStyle.cpp Resolved
@mdubet

mdubet commented Jan 23, 2024

Copy link
Copy Markdown
Contributor Author

It's a draft, it's not ready for review yet.

For the perf issue, hopefully the early return should mitigate this (here https://github.com/WebKit/WebKit/pull/23121/files#diff-95930edb6b781ea4a9c186c448fbcf9a40b69ff535c822c96c284a67fb81a89aR1524 )

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 24, 2024
@mdubet mdubet removed the merging-blocked Applied to prevent a change from being merged label Jan 24, 2024
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch 2 times, most recently from 5c32c1b to c3033e9 Compare January 24, 2024 22:39
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 25, 2024
Comment thread Source/WebCore/editing/EditingStyle.cpp Resolved
Comment thread Source/WebCore/editing/EditingStyle.cpp Resolved
Comment thread Source/WebCore/editing/EditingStyle.cpp Resolved
@mdubet mdubet removed the merging-blocked Applied to prevent a change from being merged label Jan 26, 2024
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from c3033e9 to 3b84c58 Compare January 26, 2024 01:03
@webkit-early-warning-system

Copy link
Copy Markdown
Collaborator

Starting EWS tests for 3b84c58. Live statuses available at the PR page, #23121

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 26, 2024
@mdubet mdubet removed the merging-blocked Applied to prevent a change from being merged label Jan 26, 2024
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from 3b84c58 to 024cfc1 Compare January 26, 2024 20:14
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 26, 2024
@mdubet mdubet removed the merging-blocked Applied to prevent a change from being merged label Jan 30, 2024
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from 024cfc1 to 8d36b35 Compare January 30, 2024 00:22
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 30, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 25, 2024
@mdubet mdubet removed the merging-blocked Applied to prevent a change from being merged label Mar 26, 2024
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from edf61d5 to 2cd03bd Compare March 26, 2024 17:33

@karlcow karlcow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing

https://searchfox.org/wubkat/rev/31f53890413ab604b438db03c40f219b25f3ced1/Source/WebCore/css/html.css#111-114

/* FIXME: webkit.org/b/230083 - Remove `-webkit-` from below.  */
abbr[title], acronym[title] {
    -webkit-text-decoration: dotted underline;
}

@karlcow karlcow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the commit it would be good to explain why this doesn't fix the thickness WPT tests.
such as https://wpt.fyi/results/css/css-text-decor/text-decoration-thickness-001.html?label=experimental&label=master&aligned

Some of the failures of WPT are not necessarily related to text-decoration but more on the way this is rendered. This is something to better understand. The test does the right thing, but not with the same final rendering.

We can see that with
https://wpt.fyi/results/css/css-text-decor/text-decoration-thickness-from-font-variable.html?label=master&label=experimental&aligned&q=safari%3Afail
https://wpt.fyi/analyzer?screenshot=sha1%3A1f67b985eafd5f89e8a75d7c1c8f8f6dba456170&screenshot=sha1%3Ae698720bf1a5c61ff02fba46c8e153ff25e4799c

fuziness to adjust?

Some of the tests are failing because of the canonicalization of the values. (order of values). Things like

"line-through underline" instead of "underline line-through" There is a FIXME for this.

Probably it would be good to open bugs for the specific FIXME and make a reference into the code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both Chrome and Firefox have a different behavior than WebKit for -webkit-text-decoration.

For example for:

data:text/html,<div id="test">hello world</div><style></style>

getComputedStyle(document.querySelector("#test")).getPropertyValue('-webkit-text-decoration') returns:

  • Safari before fix: none solid rgb(0, 0, 0)
  • safari after fix: rgb(0, 0, 0)
  • firefox nightly 138.0a1: `` (empty string)
  • chrome canary 136: `` (empty string)

getComputedStyle(document.querySelector("#test")).getPropertyValue('text-decoration') returns:

  • Safari before fix: none
  • safari after fix: rgb(0, 0, 0)
  • firefox nightly 138.0a1: rgb(0, 0, 0)
  • chrome canary 136: none solid rgb(0, 0, 0)

text-decoration per spec

This property is a shorthand for setting text-decoration-line, text-decoration-thickness, text-decoration-style, and text-decoration-color in one declaration. Omitted values are set to their initial values.

  • text-decoration-line initial: none
  • text-decoration-thickness initial: auto
  • text-decoration-style initial: solid
  • text-decoration-color initial: currentcolor

The canonical order is per grammar (order of this list).

That said the specification has no mention of the behavior of -webkit-text-decoration
https://drafts.csswg.org/css-text-decor-4/
I wonder if an issue should be opened about this.

Comment thread Source/WebCore/css/StyleProperties.cpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the logging on purpose here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha! This answers one of my earlier comment.

@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from 2cd03bd to 99b107d Compare March 27, 2025 22:26
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from 99b107d to 7dec104 Compare March 27, 2025 22:28
https://bugs.webkit.org/show_bug.cgi?id=230083
rdar://83182835

 Reviewed by NOBODY (OOPS!).

 Explanation of why this fixes the bug (OOPS!).

* LayoutTests/TestExpectations:
* LayoutTests/editing/deleting/merge-paragraphs-with-transparent-background-expected.txt:
* LayoutTests/editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt:
* LayoutTests/editing/pasteboard/insert-u-with-text-decoration-none-expected.txt:
* LayoutTests/editing/pasteboard/preserve-underline-color-expected.txt:
* LayoutTests/editing/style/push-down-implicit-styles-mac-expected.txt:
* LayoutTests/editing/style/push-down-implicit-styles-mac.html:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration-expected.txt:
* LayoutTests/fast/css/getComputedStyle/getComputedStyle-text-decoration.html:
* LayoutTests/fast/css/link-alternate-stylesheet-1-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-1.html:
* LayoutTests/fast/css/link-alternate-stylesheet-2-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-2.html:
* LayoutTests/fast/css/link-alternate-stylesheet-3-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-3.html:
* LayoutTests/fast/css/link-alternate-stylesheet-4-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-4.html:
* LayoutTests/fast/css/link-alternate-stylesheet-5-expected.txt:
* LayoutTests/fast/css/link-alternate-stylesheet-5.html:
* LayoutTests/fast/css/link-disabled-attr-expected.txt:
* LayoutTests/fast/css/link-disabled-attr.html:
* LayoutTests/fast/css/style-enumerate-properties-expected.txt:
* LayoutTests/fast/css/style-enumerate-properties.html:
* LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-expected.txt:
* LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dashed.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted-dashed.html:
* LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-dotted.html:
* LayoutTests/fast/events/before-input-events-prevent-drag-and-drop-expected.txt:
* LayoutTests/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* LayoutTests/fast/events/ondrop-text-html-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-serialization.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-decoration-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/multitest_8001-9000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_1-1000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_1001-2000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_2001-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_1-1000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_2001-last-expected.txt:
* LayoutTests/media/track/webvtt-inline-expected.txt:
* LayoutTests/media/track/webvtt-inline.html:
* LayoutTests/platform/glib/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/strikethrough_1-1000-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/strikethrough_1001-2000-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/strikethrough_2001-last-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/underline_1-1000-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/editing/run/underline_2001-last-expected.txt:
* LayoutTests/platform/mac/fast/events/ondrop-text-html-expected.txt:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle const):
(WebCore::ComputedStyleExtractor::textDecorationShorthandValue const):
* Source/WebCore/css/ComputedStyleExtractor.h:
* Source/WebCore/css/MutableStyleProperties.cpp:
(WebCore::MutableStyleProperties::setProperty):
* Source/WebCore/css/MutableStyleProperties.h:
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serialize):
* Source/WebCore/css/StyleProperties.cpp:
(WebCore::canUseShorthandForLonghand):
(WebCore::StyleProperties::asTextInternal const):
* Source/WebCore/css/html.css:
(abbr[title], acronym[title]):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleWithResolvedTextDecorations const):
(WebCore::EditingStyle::textDirection const):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::removeEquivalentProperties):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
* Source/WebCore/editing/markup.cpp:
(WebCore::serializePreservingVisualAppearanceInternal):
* Source/WebCore/rendering/style/RenderStyleConstants.h:
@mdubet
mdubet force-pushed the unprefix-text-decoration-single-commit branch from 7dec104 to 74b5325 Compare March 27, 2025 22:59
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 28, 2025
webkit-commit-queue pushed a commit to vitorroriz/WebKit that referenced this pull request Aug 9, 2025
rdar://156011594
https://bugs.webkit.org/show_bug.cgi?id=296097

Reviewed by Ryosuke Niwa and Tim Nguyen.

Currently, text-decoration can only handle text-decoration-line
values, effectively making it a "alias" for it, while
-webkit-text-decoration can handle only 3 of text-decoration longhands.

We are consolidating behavior here, making -webkit-text-decoration an alias
for text-decoration. The property will be the shorthand for all 4 longhands:
- text-decoration-line
- text-decoration-thickness
- text-decoration-style
- text-decoration-color

We need to rebase a bunch of editing-related tests. Since text-decoration was
effectively working as an alias to text-decoration-line, this behavior was assumed
in EditingStyle. The changes here won't really change how things look from a user's
point of view, but in some cases we will serialize, for example, inline style,
"text-decoration: underline" as "text-decoration-line: underline", which actually
make us more aligned with other engine implementations.

While implementing this, I've realized there is a bug when propagating isCurrentColor
for the animation style. This also affect other shorthands, like text-emphasis.
So we are rebasing the animation tests here and aiming to intestigate it at:
https://bugs.webkit.org/show_bug.cgi?id=296914

This is based on the previous attempts from:

* Oriol Brufau (@Loirooriol):
-  https://commits.webkit.org/248000@main (reverted)
* Tim Nguyen (@nt1m):
- WebKit#6466
* Matthieu Dubet (@mdubet)
- WebKit#23121

* LayoutTests/TestExpectations:
* LayoutTests/editing/deleting/delete-line-break-before-underlined-content-expected.txt:
* LayoutTests/editing/deleting/delete-line-break-before-underlined-content-live-range-expected.txt:
* LayoutTests/editing/deleting/deleting-line-break-preserves-underline-color-expected.txt:
* LayoutTests/editing/deleting/deleting-line-break-preserves-underline-color-live-range-expected.txt:
* LayoutTests/editing/deleting/merge-div-from-span-with-style-expected.txt:
* LayoutTests/editing/deleting/merge-div-from-span-with-style-live-range-expected.txt:
* LayoutTests/editing/deleting/merge-paragraph-from-span-with-multiple-text-decoration-expected.txt:
* LayoutTests/editing/deleting/merge-paragraph-from-span-with-multiple-text-decoration-live-range-expected.txt:
* LayoutTests/editing/deleting/merge-paragraph-from-span-with-style-expected.txt:
* LayoutTests/editing/deleting/merge-paragraph-from-span-with-style-live-range-expected.txt:
* LayoutTests/editing/execCommand/inline-style-after-indentoutdent-expected.txt:
* LayoutTests/editing/execCommand/inline-style-after-indentoutdent.html:
* LayoutTests/editing/execCommand/toggle-mixed-text-decorations-expected.txt:
* LayoutTests/editing/execCommand/toggle-mixed-text-decorations.html:
* LayoutTests/editing/pasteboard/insert-text-decoration-expected.txt:
* LayoutTests/editing/pasteboard/insert-u-with-text-decoration-none-expected.txt:
* LayoutTests/editing/pasteboard/preserve-underline-color-expected.txt:
* LayoutTests/editing/style/push-down-implicit-styles-mac-expected.txt:
* LayoutTests/editing/style/push-down-implicit-styles-mac.html:
* LayoutTests/editing/style/push-down-inline-styles-expected.txt:
* LayoutTests/editing/style/push-down-inline-styles.html:
* LayoutTests/fast/css/style-enumerate-properties-expected.txt:
* LayoutTests/fast/css/style-enumerate-properties.html:
* LayoutTests/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-letter-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/first-line-allowed-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-shorthand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/parsing/text-decoration-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-decoration-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/delete_3001-4000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/forwarddelete_3001-4000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/multitest_8001-9000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_1-1000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_1001-2000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/strikethrough_2001-last-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_1-1000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_1001-2000-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/editing/run/underline_2001-last-expected.txt:
* LayoutTests/platform/glib/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serialize):
* Source/WebCore/css/StyleProperties.cpp:
(WebCore::canUseShorthandForLonghand):
* Source/WebCore/css/html.css:
(abbr[title], acronym[title]):
* Source/WebCore/css/parser/CSSPropertyParserCustom.h:
(WebCore::CSS::PropertyParserCustom::consumeSingleShorthand): Deleted.
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::EditingStyle::init):
(WebCore::EditingStyle::styleWithResolvedTextDecorations const):
(WebCore::EditingStyle::collapseTextDecorationProperties):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::EditingStyle::removeEquivalentProperties):
(WebCore::reconcileTextDecorationProperties):
(WebCore::StyleChange::StyleChange):
(WebCore::setTextDecorationProperty):
(WebCore::StyleChange::extractTextStyles):
* Source/WebCore/editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
* Source/WebCore/editing/markup.cpp:
(WebCore::serializePreservingVisualAppearanceInternal):
* Source/WebCore/style/StyleExtractorCustom.h:
(WebCore::Style::isDefaultOrIgnorableTextDecorationLine):
(WebCore::Style::ExtractorCustom::extractTextDecorationShorthand):
(WebCore::Style::ExtractorCustom::extractTextDecorationShorthandSerialization):

Canonical link: https://commits.webkit.org/298456@main
@mdubet

mdubet commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

Fixed in #48158

@mdubet mdubet closed this Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS Cascading Style Sheets implementation merging-blocked Applied to prevent a change from being merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants