Re: [csswg-drafts] [css-pseudo] compat risk for ::selection rules defaulting one highlight color from originating element (#6774)

The CSS Working Group just discussed `Compat risk for ::selection defaulting one color from originating element`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai_> Topic: Compat risk for ::selection defaulting one color from originating element<br>
&lt;fantasai_> github: https://github.com/w3c/csswg-drafts/issues/6774<br>
&lt;delan> https://github.com/w3c/csswg-drafts/issues/2474<br>
&lt;fantasai_> delan: The highlight inheritance and cascade in the spec is a pretty big change compared to processing model in implementations right now<br>
&lt;fantasai_> delan: previously our position was that we consider the compat risk of this big change to be acceptable<br>
&lt;fantasai_> delan: because the old model that exists in old browsers is kindof useless and broken<br>
&lt;fantasai_> delan: the styles don't inherit so you have the set them everywhere, unless writing a really awkward selector<br>
&lt;fantasai_> delan: while implementing in Blink, we found a WPT that broke as a result of turning on highlight inheritance<br>
&lt;fantasai_> delan: unclear if aware of that breakage, are we still happy with the compat risk?<br>
&lt;delan> span { background-color: red; color: fuchsia; }<br>
&lt;fantasai_> delan: what the test did is essentially it has the originating element with colors of fuchsia on red<br>
&lt;delan> span::selection { background-color: green; }<br>
&lt;fantasai_> delan: there's a selection rule that just sets a gree background color<br>
&lt;fantasai_> delan: paired cascade from earlier means that because one of the two highlight properties<br>
&lt;fantasai_> delan: there is no UA default for 'color', so we use whatever color we get normally<br>
&lt;fantasai_> delan: existing model in browsers has ::selection inherit styles from originating element<br>
&lt;fantasai_> delan: so test expects color to be fuchsia<br>
&lt;fantasai_> delan: but now the test fails<br>
&lt;fantasai_> delan: because under new rules, we don't inherit color, it's black<br>
&lt;Rossen_> q?<br>
&lt;fantasai_> fantasai: I think the test is correct, actually, and paired cascading is also correct<br>
&lt;fantasai_> fantasai: inheriting all the way up, should get currentColor, not black<br>
&lt;fantasai_> fantasai: though I'm not sure the spec is clear about that<br>
&lt;fantasai_> emilio: Goes back to currentColor discussion<br>
&lt;fantasai_> emilio: all implementations resolve 'color: currentColor' to an actual color<br>
&lt;fantasai_> emilio: so I think we need to solve the problem of 'initial' and 'currentColor' being different<br>
&lt;fantasai_> emilio: and we need a resolved color<br>
&lt;fantasai_> emilio: I think the computed value is wrong, and it uses a computed color<br>
&lt;fantasai_> emilio: nobody implements that, it has terrible perf implications<br>
&lt;fantasai_> florian: Delan, can you point out to which bit of the spec made you think that you would go to black rather than originating element?<br>
&lt;fantasai_> florian: wondering if it's ambiguous or wrong<br>
&lt;fantasai_> delan: ... value found by inheritance ... do we say what happens when we get to the top?<br>
&lt;fantasai_> delan: I don't think it says what to do if you get all the way to the root<br>
&lt;fantasai_> delan: was it wrong to assume it would work the same way as in the the normal tree?<br>
&lt;fantasai_> emilio: I think the spec is right<br>
&lt;fantasai_> emilio: but if everything worked by spec, color is initial which is currentColor and it would work<br>
&lt;fantasai_> emilio: but that's not how it works right now<br>
&lt;fantasai_> delan: so we'd change spec so that for highlights, we get to root, and have a value we get essentially what currentColor does now<br>
&lt;fantasai_> emilio: per spec should get currentColor as computed value<br>
&lt;fantasai_> emilio: so I think the spec for the color property is wrong<br>
&lt;fantasai_> delan: if we did that for all properties ...<br>
&lt;fantasai_> emilio: I think the only issue is with the color property<br>
&lt;fantasai_> emilio: all current impls store as computed color<br>
&lt;fantasai_> emilio: otherwise need to go figure it out every time resolving a color for a given style<br>
&lt;fantasai_> emilio: I think the spec doesn't reflect that<br>
&lt;fantasai_> emilio: didn't make a difference until now, that we want currentColor to behave specially<br>
&lt;fantasai_> Rossen: so do we need to move this discussion back to GH?<br>
&lt;fantasai_> delan: I suppose these questions are useful and interesting, but I'm not sure they necessarily change the original question, which was do we still want to move to paired cascade<br>
&lt;fantasai_> s/paired cascade/new cascading and inheritance model/<br>
&lt;fantasai_> emilio: I think we want the testcase to continue to pass<br>
&lt;fantasai_> emilio: Depending on how we resolve the issue<br>
&lt;fantasai_> delan: so can take to GH<br>
&lt;fantasai_> emilio: this seems complex enough discussion<br>
&lt;fantasai_> emilio: per spec everything works magically and it's great<br>
&lt;fantasai_> emilio: but I don't think that's reasonable<br>
&lt;fantasai_> emilio: so we should figure out the solution that works as we want<br>
&lt;fantasai_> delan: ok sounds good<br>
</details>


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


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

Received on Wednesday, 15 December 2021 18:37:59 UTC