WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
287918
random() with viewport units changes on every layout
https://bugs.webkit.org/show_bug.cgi?id=287918
Summary
random() with viewport units changes on every layout
Simon Fraser (smfr)
Reported
2025-02-18 17:22:04 PST
Created
attachment 474283
[details]
Test case Load the attached testcase, with `random()` enabled, and resize the window. Note that the stars move around with every resize. This is surprising.
Attachments
Test case
(948 bytes, text/html)
2025-02-18 17:22 PST
,
Simon Fraser (smfr)
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-02-18 17:22:35 PST
<
rdar://problem/145102437
>
Sam Weinig
Comment 2
2025-02-19 08:48:32 PST
I believe this is behaving correctly per the current spec as the random caching keys are calculated from the "used values", so each time the window is resized, the used values for the viewport units change, and thus a new random value is selected. See
https://drafts.csswg.org/css-values-5/#random-caching
Whether this behavior is good / expected is another story. WebKit is the first to implement, so feedback to the editors on this makes sense to me.
Tim Nguyen (:ntim)
Comment 3
2025-02-19 09:16:22 PST
I filed
https://github.com/w3c/csswg-drafts/issues/11747
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug