Skip to content

[scroll-animations-1] Replace timeline-attachment with timeline-scope #7759 #8906

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

Merged
merged 3 commits into from
Jun 6, 2023

Conversation

fantasai
Copy link
Collaborator

@fantasai fantasai commented Jun 1, 2023

Alternative to #8902

@fantasai fantasai force-pushed the timeline-scope branch 3 times, most recently from 8a8c496 to 37e0d6e Compare June 2, 2023 22:00
or if more than one such timeline exists,
instead declares an [=inactive timeline=] with the specified name.

Note: This property has no effect if a matching named timeline
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure? Wouldn't that be a nice way to prevent an ancestor timeline-scope from attaching to a local timeline that needs to stay local?

.ancestor {
  timeline-scope: --t;
}

.child {
  scroll-timeline: --t;
  timeline-scope: --t; /* Forgetaboutit */
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, that would require also specifying that if you set timeline-scope on multiple ancestors, the closest one determines the scope. But actually as currently defined, we pull the scope all the way up to the highest scope with that name. I think this is fine? But in any case if we want to change that, we should open an issue to discuss. :)

Copy link
Contributor

@flackr flackr Jun 5, 2023

Choose a reason for hiding this comment

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

Well, this was certainly my intention all along that it only goes to the nearest ancestor with the scope for that name so that you could set a timeline-scope name for a subtree and not have to worry about an ancestor with the same name name resulting in an ambiguous timeline selection. Apologies if this wasn't clear in the issue:

From #7759 (comment)

The downside is that without the double handshake you would still be contaminating the ancestor timeline namespace with a timeline that was only intended to be used in its subtree - which a developer could avoid by making the subtree also an explicit timeline root for the name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I updated the definition to say that, see new commit.

It does seem like if this is the direction we want to go, we might also want to add:

  • a keyword that blocks all timeline names
  • a keyword that only blocks timeline names defined locally on this element

So I'll open a new issue...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Filed #8915

@fantasai fantasai force-pushed the timeline-scope branch 2 times, most recently from 01df526 to c413c00 Compare June 5, 2023 20:41
Copy link
Member

@andruud andruud left a comment

Choose a reason for hiding this comment

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

This looks good. :-)

Copy link
Member

@andruud andruud left a comment

Choose a reason for hiding this comment

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

This looks good. :-)

EDIT: I somehow managed to double-submit.

@fantasai fantasai merged commit 808c3e8 into w3c:main Jun 6, 2023
@fantasai fantasai deleted the timeline-scope branch June 6, 2023 19:25
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.

3 participants