Re: [csswg-drafts] [css-values] random() function (#2826)

@emilio was concerned about the design implying a global hash of ident=>random state, as it would imply trouble with parallelizing.

This shouldn't be the case; the "random()" function doesn't actually need to invoke a random generator (and, as far as I can tell, *can't* do so in any reasonable capacity). Instead, it's a hash function + mapping the result into the specified numeric range, relying on the following information only, all of which should be parallelism-friendly afaict:

* whether you're rand-int() or rand-val()
* the custom-ident
* the start and end point (properly canonicalized)
* if `per-element` is specified, some unique identifier from the element in question
* something from the page itself that changes on each page load (so you don't get stable "random" values across refreshes; a timestamp from the document would likely suffice here)

Concerns, @emilio ?

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

Received on Thursday, 28 February 2019 00:25:48 UTC