Re: [csswg-drafts] [css-values-5] Maybe min, max and step should not be part of the random-caching-key (#11742)

> Essentially, if you don't specify a caching key, we throw in a unique identifier and the element identity as the caching key.

This is still hiding the complexity. What, precisely, is the scope of the uniqueness? We need the ID to be stable across styling passes, and across the same style applied by different rules, but we also need it to be different across... some boundary. At minimum, between properties. We probably want multiple uses in the same property to be unrelated, too.

Ah, now that I'm trying to find some text I remembered seeing, I notice you were more specific in the original version of your comment in my email, but editted it to be more generic later. I think your original suggestion is indeed exactly what we'd have to do: construct a key from the property it's used in (recording the shorthand used, before expansion into longhands) + an index for how many random functions precede it in the value. (+ some extra entropy for the pageload itself, so different pages or different visits to the same page are unrelated0)

It would be interesting if we could also bake in some entropy from the token stream itself, so using the same number of random()s on the same property, but changing the rest of the property value in some way, would also result in different values. However, that requires a *very* precise canonicalization of the value into some sort of bytes, and I don't know that it's worthwhile to do so. It should probably be fine to just stick with property+index; you usually won't notice the connection.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11742#issuecomment-2702268200 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 5 March 2025 22:57:48 UTC