Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bdb8c44b0b13ad6ac4f63ae86f2476e6f15fb0fa
https://github.com/WebKit/WebKit/commit/bdb8c44b0b13ad6ac4f63ae86f2476e6f15fb0fa
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-06 (Sun, 06 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-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:
-----------
Interpolating a <length-percentage> from a calc() value to a pure <length>
drops the percentage component at progress 1
https://bugs.webkit.org/show_bug.cgi?id=322798
Reviewed by Sam Weinig.
When interpolating a mixed <length-percentage> whose `from` value is a
calc() (i.e. carries both a length and a percentage part) toward a `to`
value that is a pure <length>, the "to" short-circuit in
Blending<LengthPercentage>::blendMixedTypes() fired at progress 1 and
returned blend(0px, to), discarding the percentage part carried inside
`from`'s calc(). This produced e.g. `inset(50px)` instead of the required
`inset(50px calc(0% + 50px) calc(0% + 50px) 50px)` when animating
`offset-path: xywh(10px 10px 200px 100px)` to `inset(50px)` at t=1.
Per the rules for combining mixed dimension-percentage values, both sides
are treated as calc(length + percentage) and each component interpolated
individually, so a percentage component present in `from` must survive to
the result.
The "from" short-circuit already guarded against `from` being a calc()
with `!holdsAlternative<Calc>(from)`; the "to" short-circuit was missing
the corresponding guard, so a calc() `from` incorrectly took it. Both
short-circuits only apply when neither side is a calc(), so hoist that
shared guard into a single enclosing block. A calc() `from` now falls
through to the general Calculation::blend() path that preserves both
components.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-composition-expected.txt:
Progressions.
*
LayoutTests/imported/w3c/web-platform-tests/css/motion/animation/offset-path-interpolation-006-expected.txt:
Progressions.
* Source/WebCore/style/values/primitives/StylePrimitiveNumericTypes+Blending.h:
(WebCore::Style::Blending<LengthPercentage>::blendMixedTypes):
Canonical link: https://commits.webkit.org/320585@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications