Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3aac827e668b4bc6d024e539d55ad1d3e0d17557
https://github.com/WebKit/WebKit/commit/3aac827e668b4bc6d024e539d55ad1d3e0d17557
Author: Ahmad Saleem <[email protected]>
Date: 2026-05-21 (Thu, 21 May 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-composition-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-interpolation-xywh-rect-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/animation/shape-outside-composition-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/motion/animation/offset-path-interpolation-006-expected.txt
M
Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Blending.h
Log Message:
-----------
clip-path interpolation drops calc() form at progress 0 when target is calc()
https://bugs.webkit.org/show_bug.cgi?id=315273
rdar://177606677
Reviewed by Simon Fraser.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
The progress=0 / toIsZero shortcut in Blending<LengthPercentage>::blend bypasses
Calculation::blend when `from` is a pure Length or Percentage and `to` is "not a
Percentage". That is fine when `to` is also pure (the interpolation reduces to a
single-component blend), but when `to` is a calc() value, the shortcut still
fires and returns `from` in pure form — dropping the percentage component the
calc() side contributes to the structure of the result. The animated value then
serializes as `40px` instead of `calc(0% + 40px)`, which is the form the spec
requires for <length-percentage> interpolation when either endpoint is calc().
The symmetric shortcut at progress=1 / fromIsZero already excludes Calc on the
`to` side via `!holdsAlternative<Calc>(to)`. This change adds the same exclusion
to the progress=0 shortcut so the (Length|Percentage, Calc) case falls through
to Calculation::blend, which preserves the calc() form.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-interpolation-xywh-rect-expected.txt:
Progressions
*
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-path-composition-expected.txt:
Ditto
*
LayoutTests/imported/w3c/web-platform-tests/css/css-shapes/animation/shape-outside-composition-expected.txt:
Ditto
*
LayoutTests/imported/w3c/web-platform-tests/css/motion/animation/offset-path-interpolation-006-expected.txt:
Ditto
* Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Blending.h:
(WebCore::Style::Blending<LengthPercentage<R, V>>::blend):
Canonical link: https://commits.webkit.org/313680@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications