Skip to content

Commit

Permalink
text-decoration-thickness should support percentages
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=262866

Reviewed by Tim Nguyen.

This change adds support of percentage to text-decoration-thickness [1].

The text-decoration-thickness-interpolation.html is newly added to evaluate interpolation
between various length types. The updated text-decoration-thickness-computed.html
verifies calc() computation with em, %, and px values. And
text-decoration-thickness-calc.html verifies the actual rendering.

Test: imported/w3c/web-platform-tests/css/css-fonts/size-adjust-text-decoration.tentative.html
      imported/w3c/web-platform-tests/css/css-text-decor/animations/discrete-no-interpolation.html
      imported/w3c/web-platform-tests/css/css-text-decor/animations/text-decoration-thickness-interpolation.html
      imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-calc.html
      imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-computed.html
      imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-fixed.html
      imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-valid.html
      imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-decoration-thickness.html

[1] https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-thickness-percentage

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/discrete-no-interpolation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/text-decoration-thickness-interpolation-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/text-decoration-thickness-interpolation.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-calc-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-calc-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-calc.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-computed.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/text-decoration-thickness-expected.txt:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::textDecorationThicknessToCSSValue):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle const):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::initialTextDecorationThickness):
* Source/WebCore/rendering/style/TextDecorationThickness.h:
(WebCore::TextDecorationThickness::createWithAuto):
(WebCore::TextDecorationThickness::createFromFont):
(WebCore::TextDecorationThickness::createWithLength):
(WebCore::TextDecorationThickness::length const):
(WebCore::TextDecorationThickness::resolve const):
(WebCore::TextDecorationThickness::TextDecorationThickness):
(WebCore::operator<<):
(WebCore::TextDecorationThickness::setLengthValue): Deleted.
(WebCore::TextDecorationThickness::lengthValue const): Deleted.
(): Deleted.
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertTextDecorationThickness):

Canonical link: https://commits.webkit.org/269886@main
  • Loading branch information
shivamidow committed Oct 28, 2023
1 parent 577579c commit 4172b60
Show file tree
Hide file tree
Showing 18 changed files with 817 additions and 67 deletions.
4 changes: 0 additions & 4 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -3978,9 +3978,6 @@ webkit.org/b/219735 imported/w3c/web-platform-tests/css/css-fonts/line-gap-overr
webkit.org/b/219735 imported/w3c/web-platform-tests/css/css-fonts/font-face-unicode-range-nbsp.html [ ImageOnlyFailure ]
webkit.org/b/219735 imported/w3c/web-platform-tests/css/css-font-loading/fontface-override-descriptors.html [ ImageOnlyFailure ]

# @font-face: size-adjust and text-decoration
webkit.org/b/206881 imported/w3c/web-platform-tests/css/css-fonts/size-adjust-text-decoration.tentative.html [ ImageOnlyFailure ]

# We intentionally do not want to allow disabling required ligatures, so we don't honor this optional test.
imported/w3c/web-platform-tests/css/css-fonts/font-variant-ligatures-11.optional.html [ ImageOnlyFailure ]

Expand Down Expand Up @@ -4933,7 +4930,6 @@ webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-per
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-009.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html [ ImageOnlyFailure ]

webkit.org/b/214464 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-fixed.html [ ImageOnlyFailure ]
webkit.org/b/214464 imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-thickness-ink-skip-dilation.html [ ImageOnlyFailure ]

webkit.org/b/214465 imported/w3c/web-platform-tests/css/mediaqueries/prefers-color-scheme-svg-image.html [ ImageOnlyFailure ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,34 @@ PASS Web Animations: property <text-decoration-style> from [initial] to [dashed]
PASS Web Animations: property <text-decoration-style> from [initial] to [dashed] at (0.6) should be [dashed]
PASS Web Animations: property <text-decoration-style> from [initial] to [dashed] at (1) should be [dashed]
PASS Web Animations: property <text-decoration-style> from [initial] to [dashed] at (1.5) should be [dashed]
FAIL CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (-0.3) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0.3) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (-0.3) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0.3) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px] assert_equals: expected "123px " but got "auto "
PASS CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (-0.3) should be [123px]
PASS CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0) should be [123px]
PASS CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0.3) should be [123px]
PASS CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px]
PASS CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px]
PASS CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px]
PASS CSS Transitions: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px]
PASS CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (-0.3) should be [123px]
PASS CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0) should be [123px]
PASS CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0.3) should be [123px]
PASS CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px]
PASS CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px]
PASS CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px]
PASS CSS Transitions with transition: all: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px]
PASS CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (-0.3) should be [initial]
PASS CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (0) should be [initial]
PASS CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.3) should be [initial]
FAIL CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px] assert_equals: expected "123px " but got "auto "
PASS CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px]
PASS CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px]
PASS CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px]
PASS CSS Animations: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px]
PASS Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (-0.3) should be [initial]
PASS Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (0) should be [initial]
PASS Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.3) should be [initial]
FAIL Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px] assert_equals: expected "123px " but got "auto "
FAIL Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px] assert_equals: expected "123px " but got "auto "
PASS Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.5) should be [123px]
PASS Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (0.6) should be [123px]
PASS Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (1) should be [123px]
PASS Web Animations: property <text-decoration-thickness> from [initial] to [123px] at (1.5) should be [123px]
PASS CSS Transitions: property <text-emphasis-position> from [initial] to [under right] at (-0.3) should be [under right]
PASS CSS Transitions: property <text-emphasis-position> from [initial] to [under right] at (0) should be [under right]
PASS CSS Transitions: property <text-emphasis-position> from [initial] to [under right] at (0.3) should be [under right]
Expand Down
Loading

0 comments on commit 4172b60

Please sign in to comment.