Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 838aa54e7185d3d312d982ac6523f6a29e70d9a8
https://github.com/WebKit/WebKit/commit/838aa54e7185d3d312d982ac6523f6a29e70d9a8
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-06 (Sun, 06 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/text-decoration-thickness-interpolation-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/text-underline-offset-interpolation-expected.txt
M
Source/WebCore/style/values/text-decoration/StyleTextDecorationThickness.cpp
M Source/WebCore/style/values/text-decoration/StyleTextDecorationThickness.h
M Source/WebCore/style/values/text-decoration/StyleTextUnderlineOffset.cpp
M Source/WebCore/style/values/text-decoration/StyleTextUnderlineOffset.h
Log Message:
-----------
text-decoration-thickness and text-underline-offset don't preserve
percentages when interpolating
https://bugs.webkit.org/show_bug.cgi?id=322800
Reviewed by Sam Weinig.
Both `text-decoration-thickness` (auto | from-font | <length-percentage>)
and `text-underline-offset` (auto | <length-percentage>) had custom
Blending implementations that called resolve(), flattening the value to a
pixel float and returning it as a Fixed length. This discarded the
percentage (and calc()) nature of the value, so e.g. animating from 100%
to 0% produced 16px, 11.2px, ... instead of 100%, 70%, ..., and mixed
values like 16px to 0% never produced the expected calc(0% + 16px). Their
canBlend() also compared resolve() results, so two differently-represented
values that happened to resolve to the same pixel amount were incorrectly
treated as non-interpolable.
Both properties are just a <length-percentage> plus keywords, so let them
use the standard PrimitiveNumericOrKeyword-derived blending instead of a
bespoke implementation:
- text-underline-offset already derived from PrimitiveNumericOrKeyword, so
its custom Blending is removed entirely.
- text-decoration-thickness is changed to derive from
PrimitiveNumericOrKeyword<LengthPercentage<>, Keyword::Auto,
Keyword::FromFont> and its custom Blending is removed.
The shared LengthPercentage-or-keyword blending interpolates the numeric
part (preserving percentages and calc()) and flips discretely between
keyword endpoints, which also fixes a latent bug where a from-font to
<length> transition passed the old thickness canBlend() and then hit the
ASSERT in blend().
* Source/WebCore/style/values/text-decoration/StyleTextDecorationThickness.h:
* Source/WebCore/style/values/text-decoration/StyleTextDecorationThickness.cpp:
(WebCore::Style::TextDecorationThickness::resolve const):
* Source/WebCore/style/values/text-decoration/StyleTextUnderlineOffset.h:
* Source/WebCore/style/values/text-decoration/StyleTextUnderlineOffset.cpp:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/text-decoration-thickness-interpolation-expected.txt:
Progressions.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/animations/text-underline-offset-interpolation-expected.txt:
Progressions.
Canonical link: https://commits.webkit.org/320584@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications