Re: [csswg-drafts] [web-animations-2] Enable using Web Animations API with nested pseudo elements (#7469)

The CSS Working Group just discussed `[web-animations-2] Enable using Web Animations API with nested pseudo elements`, and agreed to the following:

* `RESOLVED: The pseudoElement argument to animate() takes any pseudo-element selector, and selects the first matching pseudo-element like querySelector()`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> topic: [web-animations-2] Enable using Web Animations API with nested pseudo elements<br>
&lt;emilio> github: https://github.com/w3c/csswg-drafts/issues/7469<br>
&lt;vmpstr> khush_:<br>
&lt;emilio> khush_: this is about supporting nested pseudos in web-animations API<br>
&lt;emilio> ... there's an option to pass a string that right now is limited to direct descendants of the element<br>
&lt;emilio> ... so you can do `::before` but not `::before::marker`<br>
&lt;emilio> ... proposal is allowing any kind of syntax<br>
&lt;emilio> ... to allow you to select nested pseudos<br>
&lt;emilio> ... you could also use the descendant selector<br>
&lt;emilio> ... which is a nicer syntax to select a pseudo-tree<br>
&lt;emilio> ... there's the question of what to do when it matches multiple selectors<br>
&lt;flackr> q+<br>
&lt;emilio> ... so there's the option to make it invalid, or select the first like querySelector<br>
&lt;emilio> ack flackr<br>
&lt;emilio> flackr: if you can match multiple pseudos, does that mean that we're introducing a case where the pseudo-element can change over time?<br>
&lt;emilio> ... dunno if there are cases like this<br>
&lt;emilio> khush_: I'd say to select the pseudo-element when you make the animate() call<br>
&lt;emilio> ... and animation would terminate, just like you can remove `::before` styles mid-animation and the animation stops<br>
&lt;emilio> flackr: I suspect we should do this in the next lifecycle update so that there's no forced style resolution on `animate()`<br>
&lt;emilio> khush_: that's pre-existing I think, we already do that<br>
&lt;emilio> flackr: also current behavior is that animations keep running when the element disappears, and if it comes back it restarts<br>
&lt;emilio> khush_: not sure<br>
&lt;emilio> flackr: It'd be good to match the existing behavior for single pseudos<br>
&lt;emilio> ... not sure if this complicates matters a bit but there are existing patterns to follow<br>
&lt;Rossen_> q?<br>
&lt;emilio> Rossen_: So for the multiple pseudo case do you think we should stick to querySelector() or...?<br>
&lt;emilio> khush_: I'd say we should do that<br>
&lt;vmpstr> emilio: when you say any selector, what do you mean? you can't put any selector. Is there a syntax to define what exactly will be allowed?<br>
&lt;Rossen_> emilio: when you say "any selector" what do you mean exctly?<br>
&lt;emilio> khush_: when I say any selector I mean anything that targets pseudo-elements, so just `::before::marker`-like selectors and `::before>>=::marker`<br>
&lt;emilio> RESOLVED: The pseudoElement argument to animate() takes any pseudo-element selector, and selects the first matching pseudo-element like querySelector()<br>
&lt;vmpstr> emilio: can we resolve to make it consistent for getComputedStyle and similar<br>
&lt;flackr> +1<br>
&lt;khush_> +1<br>
&lt;emilio> Rossen_: as part of this or in a separate issue?<br>
&lt;emilio> emilio: Ideally while we're at it, but happy to defer<br>
&lt;emilio> Rossen_: let's have it in a separate issue<br>
&lt;oriol> For getComputedStyle there is https://github.com/w3c/csswg-drafts/issues/4456<br>
</details>


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


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

Received on Wednesday, 20 July 2022 16:25:42 UTC