Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cb1338276a4d9230ca403c295d5fd8c273dc1ffc
https://github.com/WebKit/WebKit/commit/cb1338276a4d9230ca403c295d5fd8c273dc1ffc
Author: Ahmad Saleem <[email protected]>
Date: 2026-04-06 (Mon, 06 Apr 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-variables/variable-reference-perspective-origin-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-variables/variable-reference-perspective-origin.html
M Source/WebCore/css/parser/CSSPropertyParserCustom.h
Log Message:
-----------
perspective-origin fails to resolve var() when used as the second value
https://bugs.webkit.org/show_bug.cgi?id=276121
rdar://131288246
Reviewed by Sam Weinig.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
When parsing `perspective-origin: 50% var(--y)`, consumePositionUnresolved()
successfully parses `50%` as the first component but fails to parse `var()`
as the second. It then falls back to the one-component interpretation,
returning `{50%, center}` and leaving the var() token unconsumed.
consumePerspectiveOriginShorthand() returns true, preventing the substitution
function fallback in consumeStyleProperty() from ever being reached.
Fix by adding a range.atEnd() check in consumePerspectiveOriginShorthand(),
matching the pattern already used by consumeTransformOriginShorthand().
* Source/WebCore/css/parser/CSSPropertyParserCustom.h:
(WebCore::CSS::PropertyParserCustom::consumePerspectiveOriginShorthand):
*
LayoutTests/imported/w3c/web-platform-tests/css/css-variables/variable-reference-perspective-origin-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-variables/variable-reference-perspective-origin.html:
Added.
Canonical link: https://commits.webkit.org/310650@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications