Re: [csswg-drafts] [css-view-transitions-2] How are auto-generated `view-transition-name`s exposed in JS APIs (#10978)

> Seems weird that it would work when one element is running, but not multiple.

It will never work if the element's name is internal because it was based on node identity. Only id based and explicitly named elements can be targeted directly in CSS or script. Node identity based names must use classes for targeting in CSS and won't have support for script based APIs.

This can be fixed going forward if we have `CSSPseudoElement` IDL. We could add a `getPseudos(class)` type of API to grab all pseudos which have a class. In case the author wants to do a web animation on all of them. The alternate would be to augment all the existing APIs like `getComputedStyle` or `element.animate` to target multiple pseudos given a selector using view transition classes. But I'm not a fan of that, feels like we're continuing to work around the lack of `CSSPseudoElement`.

-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10978#issuecomment-2448766993 using your GitHub account


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

Received on Thursday, 31 October 2024 00:48:09 UTC