Skip to content

[css-values-5] Fix and rename random grammar#13827

Closed
cdoublev wants to merge 1 commit intow3c:mainfrom
cdoublev:patch-1
Closed

[css-values-5] Fix and rename random grammar#13827
cdoublev wants to merge 1 commit intow3c:mainfrom
cdoublev:patch-1

Conversation

@cdoublev
Copy link
Copy Markdown
Collaborator

The random-*() grammar is slightly broken since 33682af.

They now take a <random-key> argument renamed from <random-cache-key>. It still produces auto | <random-name> | fixed <number [0,1)> but <random-name> is left undefined, because its definition and production rule now use <random-cache-key>, which was probably not intentional.

This PR tries to fix this but since fixed <number [0,1)> is not a random (cache) key but a random base value, and since auto produces but is not a random name, and resolves to a random base value, I suggest to introduce <random-base-value> to replace <random-key>.

@fantasai
Copy link
Copy Markdown
Collaborator

fantasai commented Apr 28, 2026

I think this problem is fixed in https://github.com/w3c/csswg-drafts/pull/13845/changes ?

Or is something still broken?

@cdoublev
Copy link
Copy Markdown
Collaborator Author

Yes, it is fixed by #13845.

Not exactly something broken, but some things that generally seem to lack precision:

  • <random-key> produces fixed <number>, which is a random base value, not a random cache name/key
  • the random cache name is built from the <random-cache-key> but is not entirely specified with it

The <random-cache-key> specifies the random cache name

https://drafts.csswg.org/css-values-5/#typedef-random-cache-key

But I assume these will be fixed as you refine these terms and definitions.

@cdoublev cdoublev closed this Apr 29, 2026
@cdoublev cdoublev deleted the patch-1 branch April 29, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants