Re: [csswg-drafts] [css-view-transitions-1][cssom] Clarify how `getComputedStyle` should be have with view-transition pseudo-elements (#9880)

The CSS Working Group just discussed ``[css-view-transitions-1][cssom] Clarify how `getComputedStyle` should be have with view-transition pseudo-elements``, and agreed to the following:

* `RESOLVED: script APIs (getComputedStyle, WAAPI) only receives a name parameter, no classes or *, and matches an actual initialized vt pseudo`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> noamr: gCS() has a second param of a pseudo-element name<br>
&lt;TabAtkins> noamr: in CSSOM it's not clear how this is suppsoed to behave<br>
&lt;TabAtkins> noamr: it says "get the element that is a pseudo" but that's vague<br>
&lt;TabAtkins> noamr: so what shoudl this return if there is no VT at all<br>
&lt;TabAtkins> noamr: but there is style for VT pseudos<br>
&lt;TabAtkins> noamr: one option is, there's no element here so it returns an empty style decl<br>
&lt;TabAtkins> noamr: Another is to say, yes but if there *was* one this is how it would be styled<br>
&lt;TabAtkins> noamr: it gets more complicated when VT classes are involved...<br>
&lt;TabAtkins> q+<br>
&lt;flackr> q+<br>
&lt;fremy> I don't think you can meaningfully compute that, since you don't know the classes and names<br>
&lt;TabAtkins> noamr: main thing about hypothetical route is that it does coincide with how it works on other pseudos<br>
&lt;TabAtkins> noamr: shoudl probably clarify that in CSSOM<br>
&lt;miriam> ack fantasai<br>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/9880<br>
&lt;emilio> q+<br>
&lt;TabAtkins> fantasai: raising Tim's suggestion from the issue<br>
&lt;TabAtkins> fantasai: gCS() should just support the simple form, with the name, not wildcards or classes. doesn't make sense to gCS() from something not uniquely identifiable<br>
&lt;TabAtkins> khush: so the name must be there. if there's *also* classes, and they don't match, what then?<br>
&lt;emilio> qq+<br>
&lt;TabAtkins> khush: today if you pass a class and id but those aren't being applied to th eelement, what happens?<br>
&lt;schenney> q+<br>
&lt;TabAtkins> emilio: I think we discussed this with ::part(), we might have a resolution on that<br>
&lt;miriam> ack emilio<br>
&lt;Zakim> emilio, you wanted to react to fantasai<br>
&lt;TabAtkins> emilio: don't rmeember if it's to do what elika said (don't return things that aren't uniquely identified) or use the first in tree order to represent it<br>
&lt;TabAtkins> emilio: might be worth looking at that and seeing what we resolve<br>
&lt;flackr> q-<br>
&lt;khush> q+<br>
&lt;TabAtkins> fantasai: you haven't buil the tree yet so there's no order<br>
&lt;fantasai> scribe+<br>
&lt;emilio> ack emilio<br>
&lt;TabAtkins> emilio: if you haven't built it yet, you don't know what to style anyway<br>
&lt;miriam> ack TabAtkins<br>
&lt;fantasai> TabAtkins: I think the easiest answer...<br>
&lt;fantasai> ... we should check up on what we did for ::part, and be consistent<br>
&lt;fantasai> TabAtkins: I'm inclined to the "don't have it work, because doesn't uniquely identify a set of pseudos"<br>
&lt;fantasai> TabAtkins: In general pseudo-element treatment in CSSOM is somewhat nonsensical mishmash of stuff<br>
&lt;fantasai> TabAtkins: I don't think we need to try really hard to make this API work well<br>
&lt;miriam> ack schenney<br>
&lt;TabAtkins> stefan: reason that ::spelling/etc report the pseudo-style on any element is a security/privacy issue, so you can't tell whether there's a spelling error or not. that doesn't apply here<br>
&lt;khush> q?<br>
&lt;miriam> ack fantasai<br>
&lt;TabAtkins> s/stefan/schenny/<br>
&lt;miriam> ack khush<br>
&lt;TabAtkins> khush: +1 to - i don't know what we did for ::part() so that might change - but +1 to idea that if the element wasn't even generated, just give an empty decl. no reason to compute style if the element doesnt' exist<br>
&lt;TabAtkins> khush: a lot of that is dependent on what class/name you've set up, other data only known when the transition si actually happening<br>
&lt;TabAtkins> khush: that bit that Tim raised, if you can't identify the pseudo uniquely<br>
&lt;TabAtkins> khush: then it's better to give no style than to try and guess which of the pseudos<br>
&lt;khush> ::view-transition-group(name.foo)<br>
&lt;noamr> q+<br>
&lt;TabAtkins> khush: in this selector, it's possible that the pseudo that corresponds to "name" doesn't have a .foo, so the selector doesn't match, but if you ask for gCS(..., "name.foo") it wouldn't mamke sense<br>
&lt;miriam> ack noamr<br>
&lt;TabAtkins> khush: so i think this shouldn't match<br>
&lt;fremy> q?<br>
&lt;fremy> q+<br>
&lt;emilio> ftr the discussion happened https://github.com/w3c/csswg-drafts/issues/2149#issuecomment-380386188 and wasn't ::part() but ::slotted()<br>
&lt;emilio> But we resolved that ::slotted() wouldn't work<br>
&lt;TabAtkins> noamr: I like that gCS just takes the actual ident, no arguments<br>
&lt;khush> +1 to noam's suggestion too.<br>
&lt;emilio> q+<br>
&lt;miriam> ack fremy<br>
&lt;TabAtkins> fremy: +1 to what Noam was saying<br>
&lt;miriam> ack emilio<br>
&lt;TabAtkins> emilio: that makes sense, if that has a uniquely identifiable set of styles<br>
&lt;TabAtkins> emilio: I just linked to the discussion i was remembering, it was about ::slotted(), same reasoning<br>
&lt;TabAtkins> emilio: We made this not work for ::slotted for the reasons given by elika and tab - there's no single element it represents, so this would be consistent<br>
&lt;TabAtkins> emilio: Between assuming specifying only the name is uniquely identifiable... i don't mind doing that *or* no VT at all.<br>
&lt;bramus> TabAtkins: if we want to reify this more structured, we need a plurality concept<br>
&lt;bramus> TabAtkins: if want to make plurar, then we can giv eyou list of pseudos<br>
&lt;miriam> q?<br>
&lt;emilio> s/plurar/plural<br>
&lt;TabAtkins> TabAtkins: so gCS() can query singular pseudos, but not plural ones<br>
&lt;bramus> s/plurar/plural/<br>
&lt;noamr> Proposed resolution: getComputedStyle only receives a name parameter, no classes or *, and matches an actual initialized vt pseudo<br>
&lt;khush> q?<br>
&lt;khush> q+<br>
&lt;miriam> ack khush<br>
&lt;TabAtkins> khush: We probably want to extend this to all script APIs - webanim has a similar API<br>
&lt;TabAtkins> miriam: with that clarification, sound reasonable?<br>
&lt;noamr> script APIs (getComputedStyle, WAAPI) only receives a name parameter, no classes or *, and matches an actual initialized vt pseudo<br>
&lt;fantasai> +1<br>
&lt;schenney> FYI gCS(id, :highlight(name) is how highlight work.<br>
&lt;TabAtkins> flackr: +1 to the updated proposal, doesn't make sense for element.animate() to affect multiple pseudos<br>
&lt;TabAtkins> RESOLVED: script APIs (getComputedStyle, WAAPI) only receives a name parameter, no classes or *, and matches an actual initialized vt pseudo<br>
&lt;TabAtkins> (noam will work with me/fantasai to make this more structured in the Pseudo spec)<br>
</details>


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


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

Received on Monday, 12 February 2024 19:30:39 UTC