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

[web-animations-1] Playing an animation does not account for an inactive timeline #4379

Open
JTensai opened this issue Sep 27, 2019 · 3 comments

Comments

@JTensai
Copy link
Contributor

JTensai commented Sep 27, 2019

https://drafts.csswg.org/web-animations/#playing-an-animation-section

If an animation is supplied an inactive timeline (e.g. a ScrollTimeline using a scroller with style="display:none") it will fail.

Before setting hold_time in play() we need to first check that there is an active timeline. If not, we should not start the animation until the timeline has become active.

@birtles
Copy link
Contributor

birtles commented Sep 30, 2019

I'm not quite sure why that's the expected behavior. I would expect the animation to end up with a hold time of zero and wait there until the timeline is ready. That was at least the desired behavior when we were modeling SVG's document timelines (which are not active until the SVG document fragment's onload event fires).

Perhaps more importantly, how would one differentiate between an animation associated with a timeline that is not playing because the timeline is inactive (but will be as soon as the timeline becomes active) and one that is simply attached to an inactive timeline (and will not play when the timeline becomes active)?

Unless you're saying play() should fail entirely?

@JTensai
Copy link
Contributor Author

JTensai commented Oct 1, 2019

My expectation is based on how AnimationWorklet handles the same situation. There is a WPT test [1] for AnimationWorklet that expects animation.currentTime to return null for the initially inactive timeline. If we return 0 as suggested this would create opposing expectations for systems that should mirror each other. Should the AnimationWorklet test be changed?

[1] https://cs.chromium.org/chromium/src/third_party/blink/web_tests/external/wpt/animation-worklet/inactive-timeline.https.html?l=63

@birtles
Copy link
Contributor

birtles commented Oct 1, 2019

I think that unless we can find a way to differentiate between the two cases I mentioned (second paragraph in my previous comment), we can't easily change this.

There are a bunch of inter-related issues related to timelines and it may be that we do some more comprehensive reworking of timelines we can change this, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants