Bug 333268
| Summary: | [css-values-5 random()] Support `ua-early-` random cache names | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Tim Nguyen (:ntim) <ntim> |
| Component: | CSS | Assignee: | Tim Nguyen (:ntim) <ntim> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | koivisto, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://github.com/web-platform-tests/wpt/pull/65846 | ||
Tim Nguyen (:ntim)
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/193726897>
Tim Nguyen (:ntim)
Pull request: https://github.com/WebKit/WebKit/pull/82376
Tim Nguyen (:ntim)
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/65846
Tim Nguyen (:ntim)
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/65846
EWS
Committed 328008@main (1657f731e4c5): <https://commits.webkit.org/328008@main>
Reviewed commits have been landed. Closing PR #82376 and removing active labels.