Skip to content

Commit

Permalink
[web-animations] Support discrete animations on `text-underline-posit…
Browse files Browse the repository at this point in the history
…ion`

https://bugs.webkit.org/show_bug.cgi?id=241177
rdar://94615165

Reviewed by Darin Adler.

It should be animatable according to https://drafts.csswg.org/css-text-decor/#text-underline-position-property

* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/discrete-no-interpolation-expected.txt:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::conservativelyCollectChangedAnimatableProperties const):

Canonical link: https://commits.webkit.org/281245@main
  • Loading branch information
nt1m committed Jul 23, 2024
1 parent b838f8b commit 0797bbb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ PASS Web Animations: property <text-emphasis-style> from [initial] to [dot] at (
PASS Web Animations: property <text-emphasis-style> from [initial] to [dot] at (0.6) should be [dot]
PASS Web Animations: property <text-emphasis-style> from [initial] to [dot] at (1) should be [dot]
PASS Web Animations: property <text-emphasis-style> from [initial] to [dot] at (1.5) should be [dot]
FAIL CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (-0.3) should be [initial] assert_equals: expected "auto " but got "under "
FAIL CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (0) should be [initial] assert_equals: expected "auto " but got "under "
FAIL CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.3) should be [initial] assert_equals: expected "auto " but got "under "
PASS CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (-0.3) should be [initial]
PASS CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (0) should be [initial]
PASS CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.3) should be [initial]
PASS CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.5) should be [under]
PASS CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.6) should be [under]
PASS CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (1) should be [under]
PASS CSS Transitions with transition-behavior:allow-discrete: property <text-underline-position> from [initial] to [under] at (1.5) should be [under]
FAIL CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (-0.3) should be [initial] assert_equals: expected "auto " but got "under "
FAIL CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (0) should be [initial] assert_equals: expected "auto " but got "under "
FAIL CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.3) should be [initial] assert_equals: expected "auto " but got "under "
PASS CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (-0.3) should be [initial]
PASS CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (0) should be [initial]
PASS CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.3) should be [initial]
PASS CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.5) should be [under]
PASS CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (0.6) should be [under]
PASS CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <text-underline-position> from [initial] to [under] at (1) should be [under]
Expand All @@ -240,15 +240,15 @@ PASS CSS Transitions with transition: all: property <text-underline-position> fr
PASS CSS Animations: property <text-underline-position> from [initial] to [under] at (-0.3) should be [initial]
PASS CSS Animations: property <text-underline-position> from [initial] to [under] at (0) should be [initial]
PASS CSS Animations: property <text-underline-position> from [initial] to [under] at (0.3) should be [initial]
FAIL CSS Animations: property <text-underline-position> from [initial] to [under] at (0.5) should be [under] assert_equals: expected "under " but got "auto "
FAIL CSS Animations: property <text-underline-position> from [initial] to [under] at (0.6) should be [under] assert_equals: expected "under " but got "auto "
FAIL CSS Animations: property <text-underline-position> from [initial] to [under] at (1) should be [under] assert_equals: expected "under " but got "auto "
FAIL CSS Animations: property <text-underline-position> from [initial] to [under] at (1.5) should be [under] assert_equals: expected "under " but got "auto "
PASS CSS Animations: property <text-underline-position> from [initial] to [under] at (0.5) should be [under]
PASS CSS Animations: property <text-underline-position> from [initial] to [under] at (0.6) should be [under]
PASS CSS Animations: property <text-underline-position> from [initial] to [under] at (1) should be [under]
PASS CSS Animations: property <text-underline-position> from [initial] to [under] at (1.5) should be [under]
PASS Web Animations: property <text-underline-position> from [initial] to [under] at (-0.3) should be [initial]
PASS Web Animations: property <text-underline-position> from [initial] to [under] at (0) should be [initial]
PASS Web Animations: property <text-underline-position> from [initial] to [under] at (0.3) should be [initial]
FAIL Web Animations: property <text-underline-position> from [initial] to [under] at (0.5) should be [under] assert_equals: expected "under " but got "auto "
FAIL Web Animations: property <text-underline-position> from [initial] to [under] at (0.6) should be [under] assert_equals: expected "under " but got "auto "
FAIL Web Animations: property <text-underline-position> from [initial] to [under] at (1) should be [under] assert_equals: expected "under " but got "auto "
FAIL Web Animations: property <text-underline-position> from [initial] to [under] at (1.5) should be [under] assert_equals: expected "under " but got "auto "
PASS Web Animations: property <text-underline-position> from [initial] to [under] at (0.5) should be [under]
PASS Web Animations: property <text-underline-position> from [initial] to [under] at (0.6) should be [under]
PASS Web Animations: property <text-underline-position> from [initial] to [under] at (1) should be [under]
PASS Web Animations: property <text-underline-position> from [initial] to [under] at (1.5) should be [under]

2 changes: 1 addition & 1 deletion Source/WebCore/animation/CSSPropertyAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3983,6 +3983,7 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
new DiscretePropertyWrapper<OverflowAnchor>(CSSPropertyOverflowAnchor, &RenderStyle::overflowAnchor, &RenderStyle::setOverflowAnchor),
new DiscretePropertyWrapper<TextSpacingTrim>(CSSPropertyTextSpacingTrim, &RenderStyle::textSpacingTrim, &RenderStyle::setTextSpacingTrim),
new DiscretePropertyWrapper<TextAutospace>(CSSPropertyTextAutospace, &RenderStyle::textAutospace, &RenderStyle::setTextAutospace),
new DiscretePropertyWrapper<TextUnderlinePosition>(CSSPropertyTextUnderlinePosition, &RenderStyle::textUnderlinePosition, &RenderStyle::setTextUnderlinePosition),

new DiscretePropertyWrapper<BoxDecorationBreak>(CSSPropertyWebkitBoxDecorationBreak, &RenderStyle::boxDecorationBreak, &RenderStyle::setBoxDecorationBreak),
new DiscretePropertyWrapper<Isolation>(CSSPropertyIsolation, &RenderStyle::isolation, &RenderStyle::setIsolation),
Expand Down Expand Up @@ -4249,7 +4250,6 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
case CSSPropertyTextCombineUpright:
case CSSPropertyTextDecoration:
case CSSPropertyTextDecorationSkip:
case CSSPropertyTextUnderlinePosition:
case CSSPropertyTransition:
case CSSPropertyTransitionBehavior:
case CSSPropertyTransitionDelay:
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/rendering/style/RenderStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,8 @@ void RenderStyle::conservativelyCollectChangedAnimatableProperties(const RenderS
changingProperties.m_properties.set(CSSPropertyScrollbarColor);
if (first.listStyleType != second.listStyleType)
changingProperties.m_properties.set(CSSPropertyListStyleType);
if (first.textUnderlinePosition != second.textUnderlinePosition)
changingProperties.m_properties.set(CSSPropertyTextUnderlinePosition);

// customProperties is handled separately.
// Non animated styles are followings.
Expand Down Expand Up @@ -2101,7 +2103,6 @@ void RenderStyle::conservativelyCollectChangedAnimatableProperties(const RenderS
// touchCalloutEnabled
// lineGrid
// imageRendering
// textUnderlinePosition
// textZoom
// lineSnap
// lineAlign
Expand Down

0 comments on commit 0797bbb

Please sign in to comment.