-
Notifications
You must be signed in to change notification settings - Fork 715
[css-view-transitions-2] How are auto-generated view-transition-name
s exposed in JS APIs
#10978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'd be fine either way. Ideally authors would use the view transition class but I don't see the harm in allowing auto to match any pseudo with an auto generated name. Relates question, what should be the name of the pseudo for Animation objects returned by |
Same opinion as Khushal, maybe @fantasai has more opinions? |
Also, how should |
::view-transition-group(auto)
match view-transition-name: auto
?view-transition-name
s exposed in JS APIs
Exposing these as The net result is that you can end up with multiple |
To clarify my previous comment: I'm fine with exposing as |
@bramus I wonder if the name derived from an attribute should be in a different namespace, e.g. |
The CSS Working Group just discussed
The full IRC log of that discussion<bramus> noamr: how do autogenerated appear in things like getAnimations?<khush> q+ <bramus> … what would these auto-generated ones look like? Aavailble as strings? Or give them a name of `match-element` or `*` or not show them at all? <fantasai> ACTION: Open new issue about whether `auto` exposes the ID from the ID attribute as a view-transition-name for pseudo-element matching <bramus> bramus: and devtools? <astearns> ack khush <bramus> noamr: no, not included <bramus> khush: two options <bramus> … if we decied that id based names ar ehidden from css then it makes sense to hide everything from auto <bramus> … or if name came from id attribute then do expose it but dont expose the identity ones (and expose those as `match-element`) <bramus> q+ <bramus> astearns: the ids that auto uses could be made opaque but if the author uses the attr() fn then they would be exposed? <bramus> khush: thats the complication with hiding ids <bramus> … if you use attr() then you have all those complications of where you get the strings from <astearns> ack bramus <bramus> … can punt on this until we decide how to namespace ids <noamr> q+ <fantasai> bramus: if value derived from ID attribute and expose it, if you have an element with an ID on one page and a different one on a different page with a view-transition-name of hero, then one transitions to the other <fantasai> bramus: would be useful to expose that name <fantasai> bramus: if we fall back to match-element strategy, then show that as match-element <fantasai> bramus: because authors can't target those elements directly <fantasai> bramus: by having match-element there, clearly can't target <bramus> fantasai: q about whether id on one page would match a v-t-n on other is part of the namespacing discussion <bramus> … dont have an opionion on direction <bramus> … if that worked, then we should make pseudos match that <bramus> … but q is then should that work in the first place? <bramus> … do we want to expose the name derived from an id in the first place? no opinion right now. <bramus> … obviously should not expose autogenerated names <astearns> ack noamr <bramus> noamr: strong opinion about keeping things simple… if generated by id its just that name <bramus> … already doing complicated things that look different <bramus> … if the v-t-name comes from an id, then that should be the v-t-n <bramus> … if author dont want that, they should do other things <bramus> … lets keep things flat <khush> q+ <bramus> … regardless we can resolve to use the name `match-element` in `getAnimations` <astearns> ack khush <bramus> khush: since we are going here … my alignment is wit noam on this. keep it simpel and treat them as names <bramus> … dont have author feedback on this though <bramus> … not a super strong opinion <bramus> … if this pattern is adopted like anchor-name and there is no matching concept, do we want to have this namespacing concept across css props then? <bramus> … then VT wont have this own special thing <bramus> q+ <bramus> … concept would make sense across CSS <bramus> fantasai: none of the others have a way of pulling element id <bramus> khush: but can imagine anchor-pos doing the same over time <astearns> ack bramus <noamr> I like that auto === id ? attr(id) : match-element <bramus> bramus: missed <bramus> astearns: but flatness isnt part of the issue <bramus> khush: lets thing about that a bit more <bramus> s/khush/noamr <bramus> noamr: lets resolve on exposing them as `match-element` <bramus> astearns: is ther ea conclict there? <bramus> noamr: its just in getAnimations <bramus> astearns: which is wrapped in a pseudo <bramus> khush: compat risk for users that have used `match-element` <bramus> bramus: dont think anyone has used that yet <bramus> khush: so if you use auto and we use the id attr then we expose the id attr as string, and if we use identity then we expose match-element <bramus> noamr: and tbd if these id-based names are namespaced or not <bramus> astearns: should open an issue that <bramus> khush: can do that <bramus> PROPOSED RESOLUTION: we will use `match-element` in the Animations API when element identity is used <bramus> astearns: objections? <bramus> (silence) <bramus> RESOLVED: [Pending async confirmation] we will use `match-element` in the Animations API when element identity is used |
@khushalsagar filed #11112 for that :) |
The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment. Proposed Resolution: we will use |
I think we should discuss in a call, it'll be a first to have an identifier potentially return animations for multiple pseudo-elements. |
@nt1m before we bring this back to a call, could you go into more detail here about your concerns? |
To be clear, this is about returning |
^ Same for any |
|
^ nothing. It's the equivalent of calling the API with an invalid selector / view-transition-name. |
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 |
Ah this is for serialization, anything seems fine to me for serialization IMO |
I'd be in favor in resolving if it's just for how to serialize (e.g. output). But 👎 to using |
We're on the same page, this is only for output. |
Yea, sorry for the confusion. This is about what shows up when the UA returns a pseudo element name. That said, I do want to make sure we're aligned on the behaviour about input. |
RESOLVED: We will use |
As resolved in the CSSWG, generated pseudo names should be an implementation detail, not web exposed. Retain the info about whether a name was generated, and use it when reflecting the name of the pseudo element. See w3c/csswg-drafts#10978 (comment) Bug: 376458393 Change-Id: Ieada7c0a92d901a0d639221cd44e76e25982b24a
As resolved in the CSSWG, generated pseudo names should be an implementation detail, not web exposed. Retain the info about whether a name was generated, and use it when reflecting the name of the pseudo element. See w3c/csswg-drafts#10978 (comment) Bug: 376458393 Change-Id: Ieada7c0a92d901a0d639221cd44e76e25982b24a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6131124 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1406091}
As resolved in the CSSWG, generated pseudo names should be an implementation detail, not web exposed. Retain the info about whether a name was generated, and use it when reflecting the name of the pseudo element. See w3c/csswg-drafts#10978 (comment) Bug: 376458393 Change-Id: Ieada7c0a92d901a0d639221cd44e76e25982b24a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6131124 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1406091}
…s in getAnimations, a=testonly Automatic update from web-platform-tests Hide view transition auto-generated names in getAnimations As resolved in the CSSWG, generated pseudo names should be an implementation detail, not web exposed. Retain the info about whether a name was generated, and use it when reflecting the name of the pseudo element. See w3c/csswg-drafts#10978 (comment) Bug: 376458393 Change-Id: Ieada7c0a92d901a0d639221cd44e76e25982b24a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6131124 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1406091} -- wpt-commits: 706faf55cc675ac0a6a5895e0634daad9bef3d9c wpt-pr: 50071
…s in getAnimations, a=testonly Automatic update from web-platform-tests Hide view transition auto-generated names in getAnimations As resolved in the CSSWG, generated pseudo names should be an implementation detail, not web exposed. Retain the info about whether a name was generated, and use it when reflecting the name of the pseudo element. See w3c/csswg-drafts#10978 (comment) Bug: 376458393 Change-Id: Ieada7c0a92d901a0d639221cd44e76e25982b24a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6131124 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1406091} -- wpt-commits: 706faf55cc675ac0a6a5895e0634daad9bef3d9c wpt-pr: 50071
Requesting a clarification for this resolution.
Do we want
::view-transition-{group|old|new|image-pair}(auto)
to match pseudo-elements generated from theauto
keywords, or do people need to use only classes to style them?/cc @nt1m @fantasai @khushalsagar @vmpstr
The text was updated successfully, but these errors were encountered: