-
Notifications
You must be signed in to change notification settings - Fork 711
[css-values-5] Should random() function caching key work over used values? #11747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
#11742 would be one solution to this. |
Putting #11742 to the side for now, I don't have a real opinion on how this is resolved. The caching key is just constructed from the arguments to make it more likely that it's page-unique by default. I don't think we really have a defined notion of "equality" for specified values. In theory we could make it based on token streams or source text, if we really wanted it to be stable? |
Checked in a bunch of edits for review and WG approval as part of #11742 which also address this. The function no longer depends on its arguments at all except for the random-caching key; instead we synthesize some aspects of the caching key from the function's environment (the element, the property, this function's index among other random functions in the property value) if necessary. So, assuming we approve the #11742 edits, this issue will be closed as well. |
Right now, it works over used values as specified by https://drafts.csswg.org/css-values-5/#random-caching , but that leads to weird behavior where resizing a window will cause new random values to be computed when viewport units are used: https://bugs.webkit.org/show_bug.cgi?id=287918
cc @tabatkins @weinig @smfr
The text was updated successfully, but these errors were encountered: