RESOLVED FIXED333268
[css-values-5 random()] Support `ua-early-` random cache names
https://bugs.webkit.org/show_bug.cgi?id=333268
Summary [css-values-5 random()] Support `ua-early-` random cache names
Tim Nguyen (:ntim)
Reported 2026-11-26 22:43:06 PST
https://drafts.csswg.org/css-values-5/#random-caching "when evaluated inside of an arbitrary substitution function as part of the substitution process, the prefix is ua-early- rather than just ua-: ua-early-PROPERTY or ua-early-PROPERTY-INDEX. Additionally, if the INDEX portion is included in the ident, it is incremented separately from non-"early" usage (that is, the "early" usage counts up from 1, then non-"early" usage will also count up from 1) and increments across substitutions in the property (that is, multiple different arbitrary substitution functions will use successive indexes, rather than resetting to 1 for each substitution)." WebKit doesn't implement this: - random() inside ident() restarts its index for every ident(), and is keyed like a plain random(). So both idents get the same number here: animation-name: ident("a" random(1, 1000000)), ident("b" random(1, 1000000)); and the ident() and the plain random() share a value here: grid-row-start: random(1, 1000000) ident("a" random(1, 1000000)); In a shorthand, every longhand also gets a different value, e.g. grid-area: ident("a" random(1, 1000000)). - random() inside a typed attr() is re-parsed as an ordinary random() of the final property, instead of getting an early name. ua-early- idents are also rejected when written explicitly, e.g. random(ua-early-margin-1, 1px, 10px). Tests: the ua-early subtests of css/css-values/random-computed.tentative.html (not yet imported), and the ident() subtests of css/css-values/random-in-shorthand.html.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-11-26 22:43:17 PST
Tim Nguyen (:ntim)
Comment 2 2026-11-26 23:37:01 PST
Tim Nguyen (:ntim)
Comment 3 2026-11-27 22:54:37 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/65846
Tim Nguyen (:ntim)
Comment 4 2026-11-27 23:01:20 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/65846
EWS
Comment 5 2026-11-28 06:49:05 PST
Committed 328008@main (1657f731e4c5): <https://commits.webkit.org/328008@main> Reviewed commits have been landed. Closing PR #82376 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.