Re: [csswg-drafts] [css-color-4] Parse-time clip of HSL negative saturation for modern syntax? (#9222)

The CSS Working Group just discussed `[css-color-4] Parse-time clip of HSL negative saturation for modern syntax?`, and agreed to the following:

* `RESOLVED: All hsl() clip to non-negative numbers for saturation`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> chris: Long thread because originally about something else, but discovered a problem so about that<br>
&lt;fantasai> chris: CSS Color L3 required that negative saturation be clipped<br>
&lt;fantasai> chris: all implementations do that, tested in css-color-3 tests<br>
&lt;fantasai> chris: We have since decided that we want to round-trip through HSL<br>
&lt;fantasai> chris: which requires representing out-of-gamut colors<br>
&lt;fantasai> chris: and HSL bakes sRGB<br>
&lt;fantasai> chris: Because color-4 said don't clip, and color-3 said clip<br>
&lt;fantasai> chris: UAs interpreted, clip for old syntaxes and don't clip for new syntaxes<br>
&lt;fantasai> chris: There are pros and cons to various approaches<br>
&lt;fantasai> chris: My preference is it's better to not clip in modern syntax, but we need to agree on that<br>
&lt;fantasai> chris: also this is a parse-time clip, values from the stylesheet. If you happen to wander into HSL because of color conversion, then we don't clip<br>
&lt;emilio> q+<br>
&lt;emilio> fantasai: is there a web compat constraint for not clipping in the old syntax?<br>
&lt;emilio> ... could we not clip always?<br>
&lt;fantasai> chris: It's been baked in for so long, it might break some sites ... I haven't checked, but it would be a change<br>
&lt;emilio> chris: it's been there for a while and interoperable<br>
&lt;emilio> fantasai: it's fairly rare to type negative values<br>
&lt;emilio> ... it seems it might be possible to just not clip<br>
&lt;emilio> ... maybe we should try to pursue<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> chris: it's not non-sensical, it just means that you've gone past the axis<br>
&lt;fantasai> astearns: We could resolve on modern syntax, and then check if old syntax could be changed<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: Can you remind me, what status is on colors serializing to rgb?<br>
&lt;fantasai> emilio: IIRC at least some of the HSL syntax serializes to rgb()<br>
&lt;fantasai> emilio: if it serializes to rgb() then it should be consistent and clip<br>
&lt;fantasai> chris: Correct, and that's why for color-mix() when you go through HSL you come out in color() rather than hsl()<br>
&lt;fantasai> emilio: I suggest either do Firefox behavior (always clip) or make modern HSL syntax not serialize to rgb()<br>
&lt;fantasai> emilio: but that does seem more risky<br>
&lt;chris> s/rather than hsl()/rather than rgb()<br>
&lt;fantasai> emilio: because otherwise the color can't round-tirp<br>
&lt;fantasai> s/tirp/trip<br>
&lt;fantasai> chris: Worried about Web-compat for not serializing to rgb()<br>
&lt;fantasai> emilio: I think ideally the color should round-trip.<br>
&lt;fantasai> emilio: div.style.color = div.style.color shouldn't change the color<br>
&lt;fantasai> chris: Would Chrome change to always clip?<br>
&lt;fantasai> [none of the Chrome engineers step up to answer]<br>
&lt;fantasai> chris: Based on legacy syntax tests, we have interop on it<br>
&lt;fantasai> chris: Was going to commit tests for new syntax, and dbaron was unsure when reviewing so we have this issue<br>
&lt;fantasai> matthieud: for color-mix() we still [missed] so we clip<br>
&lt;matthieud> for color-mix, we still output rgb syntax and not color(in srgb...)<br>
&lt;fantasai> emilio: since legacy syntax (and modern) syntax convert to rgb(), more consistent to clip always<br>
&lt;fantasai> chris: I would be OK with that. If you use HSL, you brought this on yourself.<br>
&lt;fantasai> astearns: given no Blink opinion, shall we resolve to clip all HSL syntaxes?<br>
&lt;fantasai> fantasai: All HSL or all HSL except color() ?<br>
&lt;fantasai> chris: color() doesn't affect HSL, this is hsl() only<br>
&lt;fantasai> PROPOSED: All hsl() clip to non-negative numbers<br>
&lt;fantasai> for saturation<br>
&lt;fantasai> RESOLVED: All hsl() clip to non-negative numbers for saturation<br>
</details>


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


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

Received on Wednesday, 14 February 2024 19:01:06 UTC