Re: [csswg-drafts] [css-pseudo] highlights and decoration propagation (#6829)

The CSS Working Group just discussed `highlights and decoration propagation`, and agreed to the following:

* `RESOLVED: Highlight pseudos continue to inherit the text-decor properties, but do not propagate decorations the normal document.`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: highlights and decoration propagation<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/6829<br>
&lt;TabAtkins> delan: some background, text-decs have this thing called decoration propagation<br>
&lt;TabAtkins> delan: which is normally how descendants ensure they're also decorated<br>
&lt;TabAtkins> delan: the text-dec props aren't inherited normally, they use this propagation instead<br>
&lt;TabAtkins> delan: however, with highlight pseudos, we've saying all properties are inherited, even if they're not normally defined to inherit<br>
&lt;TabAtkins> delan: So how do these two things interact? Do we still have decor propagation anyway?<br>
&lt;TabAtkins> delan: If we do, it seems like you'd get a second underline, which might not be desirable<br>
&lt;TabAtkins> delan: on the other hand, if we say no, then we'll be relying on inheritance to ensure children are decorated, which also has negative side effects<br>
&lt;TabAtkins> delan: So: do decorations propagate into highlight pseudos?<br>
&lt;astearns> ack fantasai_<br>
&lt;TabAtkins> fantasai: I think when decors propagate it's from one element to another, and for highlight pseudos, each piece of a highlight pseudo is applying decors on its own<br>
&lt;TabAtkins> fantasai: so i think they don't propagate if they're set above the highlight pseudo<br>
&lt;TabAtkins> fantasai: say you ahve a &lt;p> with an &lt;em><br>
&lt;TabAtkins> fantasai: If you decor the &lt;p> if propagates to the &lt;em><br>
&lt;TabAtkins> fantasai: if you highlight across it, there'll be two pieces, inside and outside the em<br>
&lt;iank_> what is the interaction when highlights come across an inline which is a stacking-context?<br>
&lt;TabAtkins> fantasai: each one will have an underline decl, you don't want it to be twice. you don't want to propagate since each piece takes care of the underline itself<br>
&lt;TabAtkins> fantasai: I think that's what happens, but might give different results.<br>
&lt;TabAtkins> fantasai: Propagation and inheritance can give different thickness<br>
&lt;TabAtkins> fantasai: but we probably want it to look like a normal underline, so we *do* want it to propagate...<br>
&lt;TabAtkins> delan: for example, a &lt;sup> insdie the &lt;p>. Normally there's a single underline that doesn't jump up. (Blink does jump up, but we do it wrong.)<br>
&lt;TabAtkins> delan: We don't actually do the decorating box, we do an inheritance hack.<br>
&lt;TabAtkins> fantasai: I think what you want is to render as if it's propagated, but the existence of the underline is based on inheritance, but then......<br>
&lt;TabAtkins> fantasai: Dunno if this makes sense. Inherits like every other property, but instead of each part drawing its own, they look up to see if they would propagate from their parent.<br>
&lt;florian> q+<br>
&lt;TabAtkins> fantasai: I think that would get us the results we want.<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: I agree in general. I wonder if it's that bad in the case of highlight pseudos if we do jump up and down.<br>
&lt;TabAtkins> florian: In a whole paragraph with some &lt;sup> you do want something continuous and homogenous.<br>
&lt;TabAtkins> florian: But in highlights it might depend on hwo you get there. If you highlight the whole para, yeah you might want it to be the same. But if you start within the sup, maybe you do want it to be up. And as you drag out to the normal text, maybe the whole highlight moves down, or just the part in the normal text.<br>
&lt;TabAtkins> florian: it's not hierarchical.<br>
&lt;TabAtkins> florian: So if we don't fix the inconsistency for highlights, maybe that's fine, unlike in the normal case.<br>
&lt;TabAtkins> delan: If we rely on inheritance, wouldn't we...<br>
&lt;TabAtkins> delan: Now that I think about it, I'm not sure that saying there's not propagation is really all that feasible.<br>
&lt;TabAtkins> delan: Becuase the parent will draw its decoration, and there will have to be additional work done to ensure that it stops painting its decor when there's a child. that would still require changes to impls.<br>
&lt;TabAtkins> astearns: Ian had a question about fi there's anything interesting in the interaction with stacking contexts?<br>
&lt;TabAtkins> iank_: if you've got an inline which is self-painting, a stacking context, is there any interesting interaction there?<br>
&lt;TabAtkins> delan: It sounds like if we relied on inheritance to "propagate", then that would cause problems.<br>
&lt;TabAtkins> delan: Is how it's supposed to work normally that when you have a stacking context propagation doesn't happen?<br>
&lt;TabAtkins> iank_: Unsure, is why I was asking.<br>
&lt;florian> q+<br>
&lt;TabAtkins> iank_: Is it possible to have inlines that paint independenty from the rest of the inline content, and if there ar eimplications.<br>
&lt;TabAtkins> iank_: Fine if we don't have an answer.<br>
&lt;TabAtkins> fantasai: When you're doing hihglighting normally, if you're hilighting the para and there's an inline-block inside, i don't think you highlight the inline-block, you just skip it or run the line across it, depending.<br>
&lt;TabAtkins> (all the "highlight"s mean underlines)<br>
&lt;TabAtkins> fantasai: So maybe it just makes sense to use the inheritance model even if it doesn't work as well for sups.<br>
&lt;TabAtkins> florian: One thing I wanted to ask - is the worry you  have actually going to pan out like this?<br>
&lt;TabAtkins> florian: Unlike the normal text-decor we're not applying to the whole para.<br>
&lt;fantasai_> fantasai^: because in the case of highlights, we'd want to go into the inline block to indicate what's highlighted<br>
&lt;TabAtkins> florian: If we highliht from the start of the para, thru a superscript, to the end of the para, we actually have three highlight pseudos, right?<br>
&lt;iank_> specificially thinking about inlines which are self painting, e.g. &lt;div>text &lt;span style="position: relative; z-index: 2; opacity: 0.5; background: lime;">self&lt;br>painting&lt;/span><br>
&lt;astearns> q+<br>
&lt;TabAtkins> florian: You're not highlighting the parent "behind" the sup, you're highlighting three adjacent chunks<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> delan: That's how we do it in Blink, we paint chunks.<br>
&lt;TabAtkins> delan: Not sure if that's correct.<br>
&lt;TabAtkins> iank_: at the IFC level we have a data structure that determines where to paint decoarations for the whole IFC<br>
&lt;TabAtkins> iank_: We can chat offline about this.<br>
&lt;TabAtkins> astearns: So what I heard was, there is a reason for text-decors in highlights to render differently than in normal elements<br>
&lt;TabAtkins> astearns: At first I thought this was wrong, but the scenario about starting a highlight in a sup and then dragging out of it, means the highlight decors change as you drag. I think that's wrong, they should be stable as you do the highlight gesture.<br>
&lt;TabAtkins> astearns: So that suggests to me we should only be using inheritance, no propagation.<br>
&lt;TabAtkins> delan: Not sure I follow, that's not a problem outside of highlight land<br>
&lt;fantasai_> astearns++<br>
&lt;TabAtkins> astearns: Outside of highlights you have the decor set on an element, and it propagates to the children, and there's a stable rendering of that<br>
&lt;TabAtkins> astearns: In the highlighting gesture you can get an unstable decoration state if you're using propagation painting rules<br>
&lt;TabAtkins> delan: Agree that's not desirable. What if we went the other way and said they do have propagation, but the decoration properties aren't inherited?<br>
&lt;florian> q+<br>
&lt;astearns> ack astearns<br>
&lt;TabAtkins> delan: Everything else continues inheriting, so things like background-color works. But not text-decor props. Would that work?<br>
&lt;TabAtkins> astearns: I think that might still ahve problems. Say I start a highlight within a sup. How do you assess the propagation rules? You don't know how far up the parent chain to go, so you just propagate from the sup. Now you drag it out, you've got a shared parent, the propagation changes?<br>
&lt;TabAtkins> delan: I think we could use the same rules as for originating elements.<br>
&lt;TabAtkins> delan: Whether you've highlighted something determines whether we actualy paint the decor there.<br>
&lt;TabAtkins> delan: But we actually figur eit out as if highlighted<br>
&lt;astearns> ack astearns<br>
&lt;TabAtkins> florian: Abspos example - if you highlight something that's been absposed elsewhere.<br>
&lt;TabAtkins> florian: Classically, when you underline a para, the abspos child doesn't get underlined.<br>
&lt;TabAtkins> florian: Here if you start the selection in the abspos you want to see the highlight styles in the abspos, and if you drag into the para text you don't want it to suddeny change.<br>
&lt;TabAtkins> florian: In general we're just not highlighting one span of text, we're highlighting lots of bits.<br>
&lt;astearns> s/At first I thought this was wrong/At first I thought the answer was no/<br>
&lt;TabAtkins> delan: That makes sense<br>
&lt;florian> q-<br>
&lt;TabAtkins> astearns: So I think we can get a resolution to have text-decor properties in highlight pseudos inherit only, not propagate any decorations?<br>
&lt;TabAtkins> delan: Sounds good.<br>
&lt;TabAtkins> RESOLVED: Highlight pseudos continue to inherit the text-decor properties, but do not propagate decorations the normal document.<br>
</details>


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


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

Received on Wednesday, 13 April 2022 16:30:25 UTC