Re: [csswg-drafts] [css-pseudo] highlight pseudos and non-applicable properties (#7591)

The CSS Working Group just discussed `highlight pseudos and non-applicable properties`, and agreed to the following:

* `RESOLVED: Properties that don't apply on highlight pseudos are ignored`
* `RESOLVED: for the highlight pseudos on the root element, all of the font settings are taken from the element`

<details><summary>The full IRC log of that discussion</summary>
&lt;heycam> Topic: highlight pseudos and non-applicable properties<br>
&lt;heycam> github: https://github.com/w3c/csswg-drafts/issues/7591<br>
&lt;heycam> fantasai: look at the example in the issue<br>
&lt;heycam> ... it's showing a ::highlight with a text-shadow with an offset expressed as 1em<br>
&lt;heycam> ... there's a parent selection pseudo with a font-size:69px, and the actual element has a font-size:42px<br>
&lt;heycam> ... font-size does not apply to ::highlight, so the actual font is going to be 42px<br>
&lt;heycam> ... the question is, when we're computing the value of 1em, are we using the font-size assigned to the selection even though it doesn't apply, and cannot apply, or do we ignore that font-size and use the value from the originating element?<br>
&lt;dandclark> q+<br>
&lt;heycam> s/::highlight/::selection/<br>
&lt;heycam> fantasai: implementations do various things. Blink uses the initial value, which is 16px<br>
&lt;heycam> ... the question is what do we want to do?<br>
&lt;heycam> ... using the actual font-size would give the most expected results from the author perspective<br>
&lt;heycam> dandclark: I agree with that<br>
&lt;Rossen_> ack dandclark<br>
&lt;emilio> q+<br>
&lt;heycam> ... definitely seems the most intuiitive thing here, i.e. the font-size of the originating element<br>
&lt;heycam> ... anything else seems strange to me<br>
&lt;Rossen_> ack emilio<br>
&lt;heycam> emilio: we have precedent for this<br>
&lt;heycam> ... things like ::placeholder already ignore a bunch of properties, and they do so by ignoring the declarations<br>
&lt;heycam> ... so as if the font-size declaration wasn't there<br>
&lt;heycam> ... I htink that's what's being proposed here, and I think that's reasonable<br>
&lt;heycam> fantasai: proposed resolution is we use the actual, effective font-size (and font-family, etc.) here<br>
&lt;heycam> emilio: can we word it as declarations of not supported properties are ignored instead?<br>
&lt;heycam> fantasai: it inherits from the parent selection<br>
&lt;heycam> emilio: that's trickier then<br>
&lt;heycam> fantasai: we can say both things<br>
&lt;heycam> emilio: I think that's weird<br>
&lt;heycam> ... I'd rather keep it simple and ignore the declarations<br>
&lt;heycam> astearns: if we ignore the declarations, and just do the normal inheritance, even though the value is ignored, don't we get what we want?<br>
&lt;heycam> fantasai: you get the initial font-size<br>
&lt;heycam> emilio: or the root element's font-size<br>
&lt;heycam> ... weird to add another source of inputs here<br>
&lt;heycam> Rossen: if we don't do that what makes most sense?<br>
&lt;heycam> ... on one hand we have the default 16px<br>
&lt;heycam> ... that seems less useful<br>
&lt;heycam> astearns: don't understand why we get the initial font-size<br>
&lt;heycam> ... the pseudo is on an element that has a font-size<br>
&lt;heycam> fantasai: but it doesn't inherit from that element<br>
&lt;heycam> ... ::highlight inherits from the parent element's selection<br>
&lt;heycam> ... we rewired highlight inheritance like this<br>
&lt;heycam> Rossen: the intiial font-size, is that because you simply end up with the root size?<br>
&lt;heycam> fantasai: yes<br>
&lt;Rossen_> ack dbaron<br>
&lt;heycam> dbaron: I was just thinking about the desired behavior here<br>
&lt;heycam> ... if you have a selection with text-shadow that's got a 1em in it, and that selection crosses elements with different font sizes, do you actually expect that the shadow has a different offset or spread as the selection crosses those elements?<br>
&lt;heycam> fantasai: maybe, maybe not<br>
&lt;heycam> ... depends on what you were aiming for with the effect<br>
&lt;heycam> ... I think having it be consistent across them is not unreasonable<br>
&lt;heycam> Rossen: what do we do for outline?<br>
&lt;heycam> fantasai: that doesn't inherit<br>
&lt;heycam> dbaron: one of the other factors here is that a principle about selection styling is that you shouldn't get different results depending on where the selection starts<br>
&lt;JakeA> q+<br>
&lt;heycam> ... so if your selection starts further up ancestor, which has a different font-size, versus a narrow selection scoped to a descendant with a different font size, those descendants shouldn't render differently<br>
&lt;heycam> fantasai: I think both proposals follow that principle<br>
&lt;Rossen_> ack JakeA<br>
&lt;heycam> JakeA: is currentColor an issue here? for the same reason?<br>
&lt;heycam> fantasai: currentColor inherits as its own keyowrd, and resolves on each element<br>
&lt;heycam> ... for highlights it has some special behavior<br>
&lt;heycam> ... I think maybe it's just on the color property? it doesn't look as its parent, it looks at its originating element<br>
&lt;heycam> Rossen: I think following David's principle, that principle is satisfied<br>
&lt;heycam> ... from the user's PoV this is arguably what you want<br>
&lt;heycam> ... to Jake's point, if we model this on the same way color / currentColor works ...<br>
&lt;heycam> fantasai: color inherits from the parent selection, not the originating element<br>
&lt;heycam> ... currentColor on all other properties than color, looks at color<br>
&lt;heycam> ... normally color:currentColor is like inherit, but for highlights it takes the originating element's color<br>
&lt;heycam> ... so if you have a highlight where you're only doing say underlining, it gives you a way to "use the original color"<br>
&lt;heycam> ... rather than parent's color<br>
&lt;heycam> Rossen: so for em resolution<br>
&lt;heycam> ... seems like we could have the same behavior<br>
&lt;JakeA> q+<br>
&lt;fantasai> heycam: If you set font-size:inherit...<br>
&lt;fantasai> heycam: analog is, you're using the currentColor keyword on a property other than color, is the analogy is for having em values in some other property<br>
&lt;fantasai> heycam: if you used em values in the font-size property, that's more of an analog to using currentColor in color property<br>
&lt;Rossen_> ack JakeA<br>
&lt;heycam> JakeA: when you talk about the originating element of the highlight<br>
&lt;heycam> ... what happens in the case where the highlight spans multiple elements?<br>
&lt;heycam> fantasai: multiple pieces of highlight, each has an originating element<br>
&lt;heycam> ... if we consider dbaron's comment, making font relative values always resolve against the initial values seems to be most consistent with the principle<br>
&lt;heycam> Rossen: I'd argue from a user PoV that makes no sense<br>
&lt;heycam> ... [something about highlight sizes]<br>
&lt;heycam> fantasai: the size of the highlight doesn't change<br>
&lt;heycam> dbaron: I tend to be in favor of what Elika just proposed<br>
&lt;miriam> q+<br>
&lt;heycam> ... the alternative seems like it would be hard to implement<br>
&lt;fantasai> proposal was that, since having consistent resolution from 1em is not unreasonable in many cases, and is already implemented in Blink, then we should resolve on that<br>
&lt;heycam> ... and I don't think we've heard any good use cases for the alternative, i.e. do people really have demands for em offsetted text-shadow that varies on elements<br>
&lt;heycam> miriam: would it be closer to author intent to use root ems instead of browser default?<br>
&lt;heycam> emilio: that's the behavior you get when you ignore declarations<br>
&lt;Rossen_> ack miriam<br>
&lt;heycam> fantasai: I think the spec is a bit unclear on that<br>
&lt;heycam> ... so whatever we decide here is how we'll clarify it<br>
&lt;heycam> Rossen: hearing consensus forming around Elika's proposal, with using root ems intead of the initial value of font-size<br>
&lt;heycam> ... any other proposals?<br>
&lt;heycam> dandclark: should this be more general than font-size?<br>
&lt;heycam> ... lots of other properties that don't apply to highlights<br>
&lt;heycam> fantasai: we're applying it to all font properties, taken from the root<br>
&lt;heycam> ... all of the decalrations on pseudos that are defined not to apply are ignored<br>
&lt;heycam> fantasai: proposed resolution: declarations on highlight pseudos defined as not applied are ignored, and font properties are all taken from the root element<br>
&lt;heycam> RESOLVED: Properties that don't apply on highlight pseudos are ignored<br>
&lt;heycam> fantasai: I think we say that for the ::selection on the root element (and therefore inheriting down into other highlights), all of the font settings are taken from the root element<br>
&lt;heycam> RESOLVED: for the highlight pseudos on the root element, all of the font settings are taken from the element<br>
</details>


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


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

Received on Thursday, 15 September 2022 16:43:08 UTC