<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>333268</bug_id>
          
          <creation_ts>2026-11-26 22:43:06 -0800</creation_ts>
          <short_desc>[css-values-5 random()] Support `ua-early-` random cache names</short_desc>
          <delta_ts>2026-11-28 06:49:07 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/65846</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Nguyen (:ntim)">ntim</reporter>
          <assigned_to name="Tim Nguyen (:ntim)">ntim</assigned_to>
          <cc>koivisto</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2286284</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2026-11-26 22:43:06 -0800</bug_when>
    <thetext>https://drafts.csswg.org/css-values-5/#random-caching

&quot;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-&quot;early&quot; usage (that is, the &quot;early&quot; usage counts up from 1, then non-&quot;early&quot; 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).&quot;

WebKit doesn&apos;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(&quot;a&quot; random(1, 1000000)), ident(&quot;b&quot; random(1, 1000000));

  and the ident() and the plain random() share a value here:

    grid-row-start: random(1, 1000000) ident(&quot;a&quot; random(1, 1000000));

  In a shorthand, every longhand also gets a different value, e.g. grid-area: ident(&quot;a&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2286285</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-11-26 22:43:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/193726897&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2286308</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2026-11-26 23:37:01 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/82376</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2286664</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2026-11-27 22:54:37 -0800</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/65846</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2286675</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2026-11-27 23:01:20 -0800</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/65846</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2286792</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-11-28 06:49:05 -0800</bug_when>
    <thetext>Committed 328008@main (1657f731e4c5): &lt;https://commits.webkit.org/328008@main&gt;

Reviewed commits have been landed. Closing PR #82376 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>