Re: [csswg-drafts] [view-transitions-2] Add method to get all animations of a ViewTransition object (#9908)

The CSS Working Group just discussed `[view-transitions-2] Add method to get all animations of a ViewTransition object`, and agreed to the following:

* `RESOLVED: Add a pseudoElement option to the element.getAnimations() dict arg. subtree:true/false acts on that pseudo as the root`
* `RESOLVED: Add .transitionRoot readonly property to VT object, reflectring the element hosting the VT.`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> vmpstr: there's some desire to get all the VT animations (the animations associated with the VT pseudos)<br>
&lt;TabAtkins> vmpstr: The proposal started with like adding .getAnimations() to the VT object<br>
&lt;TabAtkins> vmpstr: but the current proposal is to add a pseudo parameter to element.getAnimations()<br>
&lt;vmpstr> document.documentElement.getAnimations({ subtree: true, pseudoElement: "::view-transition" })<br>
&lt;TabAtkins> vmpstr: so that would mean get all the animations in the subtree, that are on the ::view-transition pseudo-element<br>
&lt;TabAtkins> vmpstr: yehonatan also had an idea for a selector filter for these<br>
&lt;TabAtkins> vmpstr: havne't thought thru that yet, but just adding the pseudo property as a first step makes sense<br>
&lt;TabAtkins> vmpstr: we'd also like to add a v-t-root property<br>
&lt;ydaniv> q+<br>
&lt;emilio> q+<br>
&lt;flackr> q+<br>
&lt;khush> q+<br>
&lt;TabAtkins> vmpstr: For now this is always the documentElement, but for scoped transitions it woudl be valuable. Lower priority for now.<br>
&lt;TabAtkins> vmpstr: So with this, you could get the transitioning root for a VT, then  ask for all the animations from that element<br>
&lt;astearns> ack ydaniv<br>
&lt;TabAtkins> ydaniv: If we're adding a pseudo argument, i think the interaction with subtree is a bit funky<br>
&lt;TabAtkins> ydaniv: if it's just to get the animations of *that* pseudo-element, that makes sense on its own<br>
&lt;TabAtkins> ydaniv: but in this case you have an entire subtree under the pseudo, that's why you need subtree?<br>
&lt;TabAtkins> flackr: the pseudo is establishing the root node you're interacting with<br>
&lt;TabAtkins> flackr: so you could use it with subtree:false as well to get just from that pseudo<br>
&lt;TabAtkins> flackr: but with subtree:true it includes the subtree of that pseudo<br>
&lt;TabAtkins> ydaniv: It just seems weird to have somethign special just for a pseudo-element, which takes sort of a selector, and not have a more general api for a selector filter<br>
&lt;TabAtkins> flackr: all fo this is based on pseudo-elements not being properly implemented. element.animate() takes a pseudo, etc. We just don't have an APi to interact with pseudos right now.<br>
&lt;TabAtkins> ydaniv: okay, then no objection.<br>
&lt;flackr> q-<br>
&lt;TabAtkins> bramus: the gist is you're changing the root, not filtering<br>
&lt;astearns> ack emilio<br>
&lt;bramus> TabAtkins: (backs that up in more words)<br>
&lt;TabAtkins> TabAtkins: Right, you just *don't get the animations* on the pseudoes right now<br>
&lt;khush> q-<br>
&lt;TabAtkins> emilio: I think my objection was addressed by rob, wondered if it needed to work with subtree:false. but that makes sense now.<br>
&lt;TabAtkins> emilio: does anyone know offhand what getAnimations() does for ::before/after/etc with subtree:true?<br>
&lt;TabAtkins> flackr: they're included<br>
&lt;TabAtkins> vmpstr: Yeah, they'r eincluded, but since they're on the documentelement you end up getting *all* the animations on the whole page<br>
&lt;khush> q+<br>
&lt;TabAtkins> emilio: okay, that contradicted what Tab said at first<br>
&lt;TabAtkins> TabAtkins: yeah i was just wrong<br>
&lt;TabAtkins> khush: if you use a pseudo with element.animate(), and that could match multiple pseudos, what do we do with that?<br>
&lt;TabAtkins> khush: should we do the same behavior here?<br>
&lt;TabAtkins> flackr: I think you want it to mean all the ones that match<br>
&lt;bramus> TabAtkins: I dont remember what we did for element.animate but since we are querying here but not taking action it seems fine<br>
&lt;vmpstr> +1<br>
&lt;TabAtkins> seems fine to just return all of them when multiple pseudos match, that is<br>
&lt;TabAtkins> astearns: so summary?<br>
&lt;TabAtkins> vmpstr: Add a pseudoElement option to the element.getAnimations() dict arg<br>
&lt;TabAtkins> vmpstr: And subtree:true/false acts on that pseudo as the root<br>
&lt;TabAtkins> astearns: objections?<br>
&lt;TabAtkins> RESOLVED: Add a pseudoElement option to the element.getAnimations() dict arg. subtree:true/false acts on that pseudo as the root<br>
&lt;TabAtkins> astearns: should we resolve on the how to get the element from the transition object?<br>
&lt;TabAtkins> vmpstr: I don't think it's controversial, so if we could resolve that's great<br>
&lt;ydaniv> read-only property<br>
&lt;TabAtkins> vmpstr: new property on the VT object that's like .transitionRoot<br>
&lt;flackr> q+<br>
&lt;khush> +1 to read-only<br>
&lt;TabAtkins> vmpstr: read-only, returns the element that's hosting the VT<br>
&lt;astearns> ack khush<br>
&lt;astearns> ack flackr<br>
&lt;TabAtkins> flackr: might suggest .target, that's what animations use to say what they're animating<br>
&lt;TabAtkins> vmpstr: sounds fine to me<br>
&lt;TabAtkins> bramus: I'm a bit more of a fan of transition root, but we can talk about it later. I use the term "transition root" when speaking about it, "target" is a little more ambiguous of a term.<br>
&lt;TabAtkins> flackr: we can bikeshed the name. I'm good witha dding the accessor, dont' want to delay.<br>
&lt;bramus> s/but we can talk about it later. I /because when talking about I<br>
&lt;TabAtkins> astearns: so proposed resolution is to add a readonly .transitionRoot to the VT object<br>
&lt;TabAtkins> emilio: what type  does it return?<br>
&lt;TabAtkins> vmpstr: an Element<br>
&lt;TabAtkins> TabAtkins: can you VT on a pseudo-element?<br>
&lt;TabAtkins> vmpstr: No, you ahve to invoke a JS method<br>
&lt;TabAtkins> emilio: sounds good<br>
&lt;TabAtkins> RESOLVED: Add .transitionRoot readonly property to VT object, reflectring the element hosting the VT.<br>
</details>


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


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

Received on Thursday, 13 June 2024 13:08:06 UTC