Skip to content
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

[css-view-transitions-2] Allow auto as a keyword #10922

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

noamr
Copy link
Collaborator

@noamr noamr commented Sep 19, 2024

auto resolves to either the element's ID, or to a unique identifier that is stable for the duration of the transition and is not web-observable.

Resolution: #8320 (comment)
Closes #8320

`auto` resolves to either the element's ID, or to a unique identifier
that is stable for the duration of the transition and is not web-observable.

Resolution: w3c#8320 (comment)
Closes w3c#8320
css-view-transitions-2/Overview.bs Outdated Show resolved Hide resolved
css-view-transitions-2/Overview.bs Outdated Show resolved Hide resolved
css-view-transitions-2/Overview.bs Outdated Show resolved Hide resolved
1. If |element| has an associated [=Element/id=], then return |element|'s [=Element/id=].
1. Return a unique string, which is not a <<custom-ident>>. This string should remain consistent and unique for this element and {{Document}}, at least for the lifetime of |element|'s [=node document=]'s [=active view transition=].

Note: this string is not web-observable, and is used for addressing the element in internal algorithms.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also leave a note that this means for cross-document view transitions, elements using a unique string will turn into exit animations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Actually I need to make a change that keeps the ID check tree-scoped, so will ask for a re-review.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, mind taking another look at the scoping bit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually do we need any scoping text here? It looks like we do that when querying the computed value for view-transition-name here: https://drafts.csswg.org/css-view-transitions-1/#document-scoped-view-transition-name.

So maybe just the change the step 1 here to say, "Let |computed| be the be the element’s document-scoped view transition name." linking back to that algo?

Note to self: A bunch of places like these will need to change for scoped transitions. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because we read the ID. The ID might have a different tree-scope than the style where the view-transition-name property is defined (if it's a ::part), we need to specifically account for that and only read the ID if it's in the same scope.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that would have the same meaning. We do have the other tree scope wording in L1 already

Yea but the way it's written right now it's not clear if it's overriding what's defined in L1.

I don't understand. This is just for auto which is not in L1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just meant that the used value for auto happens after we do a tree scope check on the computed value (defined in L1) right? So should we say that somewhere here, the algorithm right now just says we're using the computed value directly. And returns it for the custom ident case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L1 just says Each [=view transition name=] is a [=tree-scoped name=]. We don't change this, I don't think we need to add anything. The only special thing we do is check that scope vs the element's ID's scope if needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now, let me fix this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[css-view-transitions-2] view-transition-name determined by element
2 participants