Skip to content

[web-animations-1] Export dfns to expose the effect target of an animation #8001

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
jakearchibald opened this issue Nov 3, 2022 · 5 comments · Fixed by #8105
Closed

[web-animations-1] Export dfns to expose the effect target of an animation #8001

jakearchibald opened this issue Nov 3, 2022 · 5 comments · Fixed by #8105

Comments

@jakearchibald
Copy link
Contributor

In the view transitions spec we want to write prose about the element being animated by a specific animation.

It feels like the right prose would be something like:

  1. Let effect be animation's associated effect.
  2. If effect is a keyframe effect, and effect's effect target's target element is…

If that's correct, I propose:

  • Export keyframe effect.
  • Create a proper association between "effect target" and "keyframe effect". A lot of prose right now talks about an effect's effect target, but there's no defined association between the two. This association will be exported.
  • Export effect target, and its target element and target pseudo-selector.
@birtles
Copy link
Contributor

birtles commented Nov 4, 2022

In the view transitions spec we want to write prose about the element being animated by a specific animation.

The text for getAnimations might be useful here:

Returns the set of relevant Animation objects that contain at least one animation effect whose effect target is this object

Or are you trying to go in the other direction? An Animation can target 0..n (pseudo-)elements so I guess it depends on the specific prose in mind.

@jakearchibald
Copy link
Contributor Author

Ohh, the getAnimations prose might work out. I'll give it a go, cheers!

An Animation can target 0..n (pseudo-)elements

Ohhh, I thought the hierarchy was "animation has a single animation effect, if that's a keyframe effect, it has a single effect target". When can it target more than one?

@jakearchibald
Copy link
Contributor Author

jakearchibald commented Nov 4, 2022

The getAnimations stuff looks good. Could you export:

Or, create a new exported algorithm for getting the animations for an element + optional pseudo.

Maybe the latter is better, so if getAnimations needs updating, other specs trying to do the same thing won't need to update too.

@birtles
Copy link
Contributor

birtles commented Nov 5, 2022

An Animation can target 0..n (pseudo-)elements

Ohhh, I thought the hierarchy was "animation has a single animation effect, if that's a keyframe effect, it has a single effect target". When can it target more than one?

With a group effect or sequence effect from Web Animations level 2. These don't exist yet but the spec has always tried to accommodate their future addition.

That, and the fact that an Animation can have a null effect are why there's not really a concept of "the element targeted by an Animation".

@birtles birtles closed this as completed in 37484f7 Nov 5, 2022
@birtles
Copy link
Contributor

birtles commented Nov 5, 2022

Or, create a new exported algorithm for getting the animations for an element + optional pseudo.

Maybe the latter is better, so if getAnimations needs updating, other specs trying to do the same thing won't need to update too.

Oh now I saw this comment 🤦

I'll see what I can do but I might not get it before I go away. Feel free to make up a PR for it if you have time though!

@birtles birtles reopened this Nov 5, 2022
birtles added a commit to birtles/csswg-drafts that referenced this issue Nov 19, 2022
jakearchibald pushed a commit to jakearchibald/csswg-drafts that referenced this issue Jan 16, 2023
jakearchibald pushed a commit to jakearchibald/csswg-drafts that referenced this issue Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants