Re: [csswg-drafts] [css-color-5] RCS channel keywords interaction with calc() is underspecified (#10280)

The CSS Working Group just discussed `[css-color-5] RCS channel keywords interaction with calc() is underspecified`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> ChrisL: About preserving numeric values of keywords<br>
&lt;fantasai> ChrisL: is it parse-time, computed-time, or used-time resolution?<br>
&lt;fantasai> ChrisL: Color 5 doesn't specify<br>
&lt;fantasai> ChrisL: if you do calc(none * 2) what do you get?<br>
&lt;fantasai> ChrisL: does it evaluate to none or nan or what?<br>
&lt;fantasai> ChrisL: no discussion<br>
&lt;fantasai> fserb: is it different from what we just discussed?<br>
&lt;fantasai> ChrisL: seems related<br>
&lt;fantasai> ChrisL: but about whether you preserve calc() explicitly as calc()<br>
&lt;emilio> https://github.com/w3c/csswg-drafts/issues/10211 is part of it, whether `none` should be infectious like `nan` or not<br>
&lt;fantasai> dbaron: I think we have general principle for calc() that we resolve at multiple value stages<br>
&lt;fantasai> dbaron: if you can resolve at earlier stages, you do; if not then preserve to later stages<br>
&lt;fantasai> dbaron: I think that's what happens for &lt;length> calc(), e.g. calc(1in + 5pt) gets resolved immediately<br>
&lt;fantasai> dbaron: but calc(1in + 1em) needs font-size, so resolve it later<br>
&lt;fantasai> dbaron: maybe that applies to some degree here?<br>
&lt;emilio> q+<br>
&lt;lea> q+<br>
&lt;fantasai> emilio: also issue of what does multiplying by none even mean?<br>
&lt;fantasai> emilio: Another issue linked which discussed it a bit<br>
&lt;fantasai> emilio: what I proposed was to make none infectious like nan<br>
&lt;fantasai> emilio: but lea wasn't happy about that<br>
&lt;fantasai> emilio: so designing what to do with none changes when you can resolve some of these calcuations<br>
&lt;fserb> q+<br>
&lt;emilio> s/designing/deciding<br>
&lt;fantasai> lea: Reason is, when you have none<br>
&lt;dbaron> (Yeah, I have no idea what it means to do math on none....but I'm also not following this spec that closely.)<br>
&lt;fantasai> lea: can have e.g. clamp(0.5, none, 0.6)<br>
&lt;fantasai> lea: that means give me value from other color, and clamp it<br>
&lt;fantasai> lea: if it's infectious, that could mean lightness is unrestricted which could make text unreadable<br>
&lt;fantasai> lea: not sure what 'none * 2' means.<br>
&lt;fantasai> lea: if you interpolate with another color, then none becomes value of the other component and then is multiplied<br>
&lt;fantasai> lea: so color-mix() in oklch<br>
&lt;lea> color-mix(in oklch, oklch(calc(none * 2) .1 180), oklch(.5 .1 180)) =<br>
&lt;fantasai> lea: that would produce...<br>
&lt;lea> oklch(1 .1 180)<br>
&lt;fantasai> lea: it's like a late ariable<br>
&lt;fantasai> s/aria/varia/<br>
&lt;fantasai> miriam: for a specific use case, none + 180 in a hue is a common use case<br>
&lt;fantasai> dbaron: just to throw out an example that's awful<br>
&lt;fantasai> dbaron: if you have calc() on none in both colors in a color-mix, need to say what happens<br>
&lt;fantasai> dbaron: presumably none in the result?<br>
&lt;fantasai> lea: I think this was well-defined<br>
&lt;fantasai> lea: if both none-containing expressions, then you use calc-mix() to interpolate until you can resolve the nones<br>
&lt;fantasai> dbaron: but only meaningful if then mixed with something else?<br>
&lt;fantasai> lea: yes, either mix with something not none, or become zero<br>
&lt;fantasai> dbaron: ok<br>
&lt;fantasai> fserb: I think everything inside calc() is context-dependent<br>
&lt;fantasai> fserb: calc(none + 180) going to do something on the other side<br>
&lt;fantasai> fserb: calc has to be resolved before you do relative color syntax<br>
&lt;fantasai> fserb: You cannot leave the relative color syntax without resolving the number<br>
&lt;fantasai> fserb: the number resolves ...<br>
&lt;fantasai> fserb: the number that calc() returns, it depends on that context<br>
&lt;fantasai> fserb: if you converting from anything with a hue, calc(180) you can't keep calc and [missed]<br>
&lt;fantasai> lea: this is confusing<br>
&lt;fantasai> fserb: if you keep calc() means you won't look inside until later on<br>
&lt;fantasai> fserb: to move forward on relative color syntax, it needs to become a number<br>
&lt;dbaron> maybe I'm not ok with that answer... still confused about what color-mix(in oklch, oklch(.5 .1 calc(none + 180)), calc(.3 .1 calc(none + 180)) means...<br>
&lt;fantasai> fserb: it's only meaningful as a number, not as an unresolved calc()<br>
&lt;fantasai> lea: what is the proposal?<br>
&lt;fantasai> fserb: calc() cannot be carried out of relative color syntax<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10280#issuecomment-2162777644 using your GitHub account


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

Received on Wednesday, 12 June 2024 11:30:50 UTC