Re: [csswg-drafts] [css-pseudo] defaulting ‘color’ in :root highlights (#6774)

The CSS Working Group just discussed `Default color in :root highlight`, and agreed to the following:

* `RESOLVED: Go with Delan's option 2.`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: Default color in :root highlight<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/6774<br>
&lt;delan> https://github.com/w3c/csswg-drafts/issues/6774#issuecomment-1083055006<br>
&lt;TabAtkins> delan: For highlight pseudos, setting color:currentcolor means the color doesn't change when you highlight with that pseudo, compared to the original color underneath<br>
&lt;TabAtkins> delan: Editors agreed this is what should happen if color hasn't been set anywhere for a highlight<br>
&lt;TabAtkins> delan: I think the way this is achieved isn't actually specified. My best interp of Cascade is that we don't actually do that, and the spec says the default color of a highlight pseudo becomes black<br>
&lt;TabAtkins> delan: Three steps<br>
&lt;TabAtkins> delan: First, when you have an inherited property (all props are inherited for highlights), they do the defaulting by way of "inherited value"<br>
&lt;TabAtkins> delan: Second, inherited value is value from parent, unless you're at root, in which case it's initial value<br>
&lt;TabAtkins> delan: Third, initial value of color property is CanvasText<br>
&lt;TabAtkins> delan: Which is generally black (in light mode)<br>
&lt;Rossen_> q?<br>
&lt;TabAtkins> delan: So this raises the question of how to fix it<br>
&lt;TabAtkins> delan: Which step we add an exception for affects what happens when you use initial/inherit/unset<br>
&lt;TabAtkins> delan: One option is to say that for highlights, the initial value isn't CanvasText, it's currentcolor<br>
&lt;TabAtkins> delan: Here if you set color to initial/inherit/unset, they'll become currentcolor<br>
&lt;TabAtkins> delan: Second option is for highlights, the inherited value isn't the initial value at root, but instead currentcolor<br>
&lt;TabAtkins> delan: So when you set color to inherit/unset you get currentcolor, but initial means canvastext<br>
&lt;TabAtkins> delan: I like this the best<br>
&lt;TabAtkins> delan: Third option is to change defaulting for highlight pseudos and say that for root highlights, you don't inherit, we just set the value.<br>
&lt;TabAtkins> delan: So all the keywords would become canvastext<br>
&lt;TabAtkins> delan: Not sure my understanding is correct, but it's how I see things. What should we do?<br>
&lt;TabAtkins> fantasai: That was a great epxlanation of a complicated issue<br>
&lt;Rossen_> ack fantasai<br>
&lt;TabAtkins> fantasai: I think either first or second makes sense to me<br>
&lt;TabAtkins> fantasai: If no one has a reason to do something different your pref makes sense to me. I suspect your pref is the easiest to implement.<br>
&lt;TabAtkins> delan: I think all three are possible to implement. I preferred 2 over 1 because in option 2 you can say color:initial and get black, and I feel like that intuitively makes sense.<br>
&lt;Rossen_> ack emilio<br>
&lt;TabAtkins> emilio: Doesn't 2 change the - fix the weirdness around currentcolor in highlights?<br>
&lt;TabAtkins> emilio: If we change how it inherits doesn't it fix all the shenanigans about what currentcolor means in highlights?<br>
&lt;TabAtkins> emilio: Or is this orthogonal<br>
&lt;TabAtkins> delan: I don't think it does<br>
&lt;TabAtkins> delan: Are you talking about where we have the exception for currentcolor where it means this special thing for highlights?<br>
&lt;TabAtkins> emilio: yes<br>
&lt;TabAtkins> delan: Then no, this actually relies on that.<br>
&lt;TabAtkins> delan: Unless we don't literally use the word "currentcolor" in our fix and just say that it "keeps the same color"<br>
&lt;TabAtkins> delan: But as worded it relies on that currentcolor behavior<br>
&lt;TabAtkins> emilio: More generally, currentcolor refers to the computed value of the color property, how can you inherit it?<br>
&lt;TabAtkins> emilio: In impls the color property is special bc you don't want to resolve currentcolor by walking all the way to the root<br>
&lt;TabAtkins> emilio: and currentcolor disappears at computed value time, before inheritance<br>
&lt;TabAtkins> emilio: But if this is just an impl detail, eh, this just makes color more special, but given previous things we're past that point<br>
&lt;TabAtkins> Rossen_: So hearing some gravity towards options 1 and 2, particular 2 as delan's fave. Is this something we can resolve on?<br>
&lt;TabAtkins> delan: Restating option 2: For ::highlight pseudos, we redefine the "inherited value" of 'color' at the root, so instead of being the initial value (as normal) it is currentcolor.<br>
&lt;fantasai> currentColor does not disappear at computed value time... that's one of the important things about it<br>
&lt;TabAtkins> Rossen_: objections?<br>
&lt;TabAtkins> RESOLVED: Go with Delan's option 2.<br>
&lt;fantasai> WFM<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-1163369830 using your GitHub account


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

Received on Wednesday, 22 June 2022 16:46:13 UTC