Skip to content

[css-view-transitions-2] view-transition-name: auto when matching id should namespace #11614

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

Closed
vmpstr opened this issue Jan 30, 2025 · 7 comments · Fixed by #11930
Closed

[css-view-transitions-2] view-transition-name: auto when matching id should namespace #11614

vmpstr opened this issue Jan 30, 2025 · 7 comments · Fixed by #11930
Labels
css-view-transitions-2 View Transitions; New feature requests Needs Edits

Comments

@vmpstr
Copy link
Member

vmpstr commented Jan 30, 2025

We have a view-transition-name: auto that can use the id attribute from the element as the view transition name. (https://www.w3.org/TR/css-view-transitions-2/#auto-vt-name)

I think it can be confusing if, for example, in the old state we match id=foo and on the other side that pairs with css view-transition-name: foo.

The proposal is to "namespace" id matching. Basically id=foo would only match with id=foo and not with view-transition-name: foo. Or, in other words, names generated by the id attribute can only match elements that have names that are also generated by the id attribute.

@nt1m @noamr fyi

@vmpstr vmpstr added Agenda+ css-view-transitions-2 View Transitions; New feature requests labels Jan 30, 2025
@nt1m
Copy link
Member

nt1m commented Jan 30, 2025

I think this makes sense

@noamr
Copy link
Collaborator

noamr commented Jan 30, 2025

I'm personally happy to resolve on this, perhaps asynchronously since WG meeting time is hard to get.

/cc @jakearchibald
I think this is less footgunny than the previous auto and is perhaps satisfactory.

@vmpstr vmpstr added the Async Resolution: Proposed Candidate for auto-resolve with stated time limit label Jan 30, 2025
@jakearchibald
Copy link
Contributor

I still think this is a bad feature with a bad name. But it was force-shipped.

@astearns astearns removed the Async Resolution: Proposed Candidate for auto-resolve with stated time limit label Feb 4, 2025
@flackr
Copy link
Contributor

flackr commented Feb 4, 2025

Is this name exposed to the developer or does it just look like the transition is named auto?

If it's exposed, what is the name it's exposed as?

@noamr
Copy link
Collaborator

noamr commented Feb 4, 2025

Is this name exposed to the developer or does it just look like the transition is named auto?

If it's exposed, what is the name it's exposed as?

It should not be exposed, as per previous resolutions it would be match-element, but it can also be auto

@fantasai
Copy link
Collaborator

I actually thought this is the behavior we had adopted already. :) I.e. that the ID was used only internally for pairing elements, not otherwise exposed as a view-transition-name.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-view-transitions-2] view-transition-name: auto when matching id should namespace, and agreed to the following:

  • RESOLVED: v-t-name:auto never matches an explicit v-t-name:<ident>
The full IRC log of that discussion <TabAtkins> vmpstr: we added v-t-name:auto
<TabAtkins> vmpstr: matches the VT name based on the element's ID attribute, and acts as match-element otherwise
<TabAtkins> vmpstr: this name isn't exposed anywhere, it's "auto" in serializations
<TabAtkins> vmpstr: but wanted to clarify that the ID ident shouldn't match another VT that specifies a manual ident that happens tob e the same
<TabAtkins> vmpstr: Like `v-t-name: foo` on one element and `v-t-name:auto` on an element with id="foo" shouldn't match
<TabAtkins> astearns: looks like there's agreement in the thread
<TabAtkins> sounds fine to me
<TabAtkins> astearns: anyone in the room actually want the behavior we're prohibiting?
<TabAtkins> no opinion either way, really, happy to defer to editors
<bkardell_> makes sense
<noamr> +1
<TabAtkins> fantasai: I thought that's what we'd adopted originally, that the ID would only be used to link elements together, not something exposeable to other CSS. So this makes sense to me.
<TabAtkins> vmpstr: proposed: v-t-name:auto will never match an explicit v-t-name:<ident>
<TabAtkins> astearns: any objections?
<TabAtkins> RESOLVED: v-t-name:auto never matches an explicit v-t-name:<ident>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-2 View Transitions; New feature requests Needs Edits
Projects
None yet
8 participants