Skip to content
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

[css-values-5] Should random() function caching key work over used values? #11747

Open
nt1m opened this issue Feb 19, 2025 · 3 comments
Open

Comments

@nt1m
Copy link
Member

nt1m commented Feb 19, 2025

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

@nt1m nt1m changed the title [css-values-5] Should random() function caching key work over computed values? [css-values-5] Should random() function caching key work over used values? Feb 19, 2025
@Loirooriol
Copy link
Contributor

<length> is absolutized to canonical units at computed-value time, so basing caching on computed values would have the same problem. And basing it on specified values seems weird?

@nt1m
Copy link
Member Author

nt1m commented Feb 19, 2025

#11742 would be one solution to this.

@tabatkins
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants