-
Notifications
You must be signed in to change notification settings - Fork 707
[web-animations-2][css-animations-2]Should an animation-trigger prevent its animation from taking effect until the trigger says so? #11971
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
Thanks filing this! There are several issues here, so let's break this down.
Note that while the trigger has an
My intent by that was that according to the animation's active time calculation
So by that I assumed the animation's effect should be "in effect" and produce an output.
Note that trigger can have a time-based timeline, when the
This is an important observation! I think if what I explained above is in fact correct, then depending on the
Yes. In with the
The whole purpose of this feature is to allow authors to specify an active animation on a target in CSS, and have that animation's effect produce initial output depending on the animation's
So my proposal is the opposite (: I also think we should include these animations in |
No, I believe your wording is correct :) I recognized that I had been thinking about certain details a bit differently than is currently spec’d so I needed to file the issue so we (including the WG) can come to a consensus.
Yes I believe that’s right. If it’s in the before phase and at time zero, it would be “in effect.”
Yeah I think this is in line with what I meant to say. Since, atm, it “can't have ranges applied to it”, when it plays is not dependent on the trigger. And it’ll be this way until we specify time-based range, if we ever do.
Yes I agreed above that it would be “in effect” and included in
I guess your proposal is to delay the point of playing rather than the point of creation. |
Oh, that might be right.
Currently the spec says
And "current" effect is defined as:
So by that this means that while a trigger is in
Yes, exactly.
That's a very good question. I think this well requires additional issues to open! |
I would like it if we could closely match the behavior of Scroll-Driven Animations here. For example, when opening https://scroll-driven-animations.style/demos/image-reveal/css/ for example (and while making sure both images are not in the viewport – you might have to resize your window) and then calling To answer the questions asked at the start of the thread, I would assume that:
I think this boils down to saying that an animation is also relevant when the |
Yes, I think I agree to everything. Just to be clear, we're saying that STA's with a view/scroll
This means their associated effect may not have an actual output in before/after phases of their triggers. |
This sounds good to me! So contrary to my initial position I think triggers should not prevent their animations from having an effect and should be included in The way I'm thinking about it is: say we have an |
Yes, I agree with that. If that needs to be explicit in the spec then we should probably add an issue for that. |
…ations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98
…ations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <kevers@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1439452}
…ations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <kevers@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1439452}
…ations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <kevers@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1439452}
… includes yet-to-trigger animations, a=testonly Automatic update from web-platform-tests [animation-trigger] Ensure getAnimations includes yet-to-trigger animations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <kevers@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1439452} -- wpt-commits: 3325432c158407d73283033f2eb8e9e5457d7924 wpt-pr: 51688
… includes yet-to-trigger animations, a=testonly Automatic update from web-platform-tests [animation-trigger] Ensure getAnimations includes yet-to-trigger animations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <kevers@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1439452} -- wpt-commits: 3325432c158407d73283033f2eb8e9e5457d7924 wpt-pr: 51688
… includes yet-to-trigger animations, a=testonly Automatic update from web-platform-tests [animation-trigger] Ensure getAnimations includes yet-to-trigger animations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <keverschromium.org> Commit-Queue: David Awogbemila <awogbemilachromium.org> Cr-Commit-Position: refs/heads/main{#1439452} -- wpt-commits: 3325432c158407d73283033f2eb8e9e5457d7924 wpt-pr: 51688 UltraBlame original commit: 3efa87b9619fb0828759640ac5448cca7b6ce081
… includes yet-to-trigger animations, a=testonly Automatic update from web-platform-tests [animation-trigger] Ensure getAnimations includes yet-to-trigger animations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <keverschromium.org> Commit-Queue: David Awogbemila <awogbemilachromium.org> Cr-Commit-Position: refs/heads/main{#1439452} -- wpt-commits: 3325432c158407d73283033f2eb8e9e5457d7924 wpt-pr: 51688 UltraBlame original commit: 3efa87b9619fb0828759640ac5448cca7b6ce081
… includes yet-to-trigger animations, a=testonly Automatic update from web-platform-tests [animation-trigger] Ensure getAnimations includes yet-to-trigger animations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <keverschromium.org> Commit-Queue: David Awogbemila <awogbemilachromium.org> Cr-Commit-Position: refs/heads/main{#1439452} -- wpt-commits: 3325432c158407d73283033f2eb8e9e5457d7924 wpt-pr: 51688 UltraBlame original commit: 3efa87b9619fb0828759640ac5448cca7b6ce081
… includes yet-to-trigger animations, a=testonly Automatic update from web-platform-tests [animation-trigger] Ensure getAnimations includes yet-to-trigger animations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <kevers@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1439452} -- wpt-commits: 3325432c158407d73283033f2eb8e9e5457d7924 wpt-pr: 51688
… includes yet-to-trigger animations, a=testonly Automatic update from web-platform-tests [animation-trigger] Ensure getAnimations includes yet-to-trigger animations getAnimations should account for animations which could still be played due to their having a trigger. The current intent is to modify "relevant animations" (which is what getAnimations returns) using the criteria at [1]. [1] w3c/csswg-drafts#11971 (comment) Bug: 406190895, 390314945 Change-Id: I41183fb7ba14df9218ca1360b0f890d666c58f98 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393216 Reviewed-by: Kevin Ellis <kevers@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1439452} -- wpt-commits: 3325432c158407d73283033f2eb8e9e5457d7924 wpt-pr: 51688
I opened another issue specifically regarding interaction of Regarding making an animation relevant, currently the spec says:
So the associated effect may not be
So proposing:
|
Sorry, just catching up on this thread because I was pinged on #12064 (otherwise I've been trying to keep out of the scroll-driven animations and animation triggers discussions so I don't hold things up). The original proposal made sense to me so I'm trying to get on board with the reasoning for the updated proposal (which I think it starting to make sense). Just to check, if I create an If so, I think it will be treated as being "in effect". And why do we need to tweak the definition of "current animation effect" if an idle trigger already ensures that we're in the before phase? Do you mind if we continue this discussion async? I won't be able to join the telcon (timezone). |
In this case, once you attach a trigger it takes care playback for you, so in that case it is "in effect".
You're right, I took that into consideration, that the animation is initially "in effect", but I figured the tweak is necessary for the case where
Sure thing, we have a bunch of open issues in |
Sorry, by "in effect", I mean the Web Animations term, in effect. So, to the extent that such an animation has an effect that is in effect, it should already be relevant, regardless of whether or not it's current.
Oh, I see. I guess that makes sense. Might be worth a note in the spec to remind ourselves in future why we went that route.
Oh, I'm trying to keep off the critical path for all the scroll-driven and triggers work since I have very little time available for spec work. I'm mostly just interested in anything where we're touching the core Web Animations definitions. That said, I think I'm OK with the proposal here so feel free to resolve on it in telcon. |
In the web animations spec, we say that
animation-triggers
shouldplay
,pause
,cancel
, orreverse
their associated animations when their triggering conditions are met. Animations with triggers will remain idle until their trigger takes action on them, meaning these animations will have no visual effect, even e.g. withanimation-fill-mode: both
.NOTE: This only applies to animations with scroll-based triggers, i.e. animations whose trigger has a progress-based timeline (
ScrollTimelines
orViewTimelines
). Since, at the moment, we are only specifying scroll-triggered animations, for a trigger to have any effect, it must have a progress-based timeline. If the trigger’s timeline is not scroll-based it is not affected at all byanimation-trigger
.One of the implications of an animation remaining idle until its trigger says otherwise is that
getAnimations
will not include this animation until its trigger plays it.This means that the trigger has both the jobs of creating and of advancing the animation, which isn’t unlike what
Animation.play
already does. In this demo, when the animation is canceled (it becomes idle), it is no longer included ingetAnimations
, but when play is called, it is again included ingetAnimations
and begins to make progress.So I think there are 2 related questions:
getAnimations
?My proposal for 1. is: Yes. I think the animation should remain idle until its trigger plays it. This is similar to an animation created via the WAAPI. A WAAPI animation remains idle until the author invokes
animation.play
so I think this makesanimation-triggers
function in a manner that is familiar to developers, i.e. the developers can think aboutanimation-triggers
as an automated/CSS means of invoking the playback control APIs. (though maybe this is just one aspect of the broader issue in 11914.My proposal for 2 is: No, it shouldn't be included in
getAnimations
.The text was updated successfully, but these errors were encountered: