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

> I don't follow what auto name you are talking about. Do you mean per-element?

The caching key has two pieces - a "name" and a nullable element ID. If you don't provide an ident, the name is auto-generated.

> Anyways, it's actually more than 2x2 because of indexes. Are the grow and shrink ratios set to the same amount?

No, that's the "auto name" I was referring to. Property+index forms the name portion of the key, together. I don't think it's useful to think about property and index separately; neither the current nor previous text treated those as distinct things. The old text didn't pay attention to either; the new text pays attention to both.

> I guess they don't, in order to maximize randomness, and because (I believe?) you can specify a common ident if you want the same amount.

Correct. The two instances have different auto names, so they end up with different values. You can manually specify a shared name if you do want to tie them together.

> So even though omitting the options implies the "weird curve" in the original, I think it's preferable because it directly maps to "varies with". The inverted option kinda maps to "shared with", but it's less straightforward, because it's not obvious that an ident shares among properties and indices but not among elements.

Specifying an ident *almost always* reduces randomness; it's specifying a "shared with" semantic. (The only time it can actually increase randomness is if you specify different idents between two style rules setting the same property; they'd otherwise generate the same auto name and thus share values.) So it matches with the behavior of the keyword; they both increase sharing.

In the previous formulation both the keyword *and* the ident *reduced* sharing. Previously, omitting an ident just used a "blank" ident, so every instance that didn't specify a name was implicitly shared with every other unspecified name. So specifying a name reduced sharing, *and* the keyword reduced sharing.

> [a bunch of examples]

Your final "old" example is wrong. `random(0, 1)` is maximum shared, it's the most different from `random(per-element --flex--1, 0, 1)` that's it's *possible to be*.

Overall you seem to be really overcomplicating this, tho. ^_^ 

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


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

Received on Monday, 10 March 2025 16:36:17 UTC