Re: [csswg-drafts] [web-animations-1] Setting the target effect to null on a play-pending animation should probably not make it paused

Considering a few cases:

a) Animation is running, set target effect to something non-null:
_→ Animation continues running or finishes, depending on length of target effect._

b) Animation is running, set target effect to null:
_→ Animation becomes finished._

However, importantly in the above cases, even if we finish, if we were to subsequently set the target effect to something long enough, we'd resume playback. That is, we can recover from this change.

c) Animation is play-pending, set target effect to something non-null:
_→ Animation remains play-pending, will play once ready._

d) Animation is play-pending, set target effect to null:
_→ The question for this issue._

I have no idea why I suggested clearing the current time (presumably I meant to say hold time). That would make this idle which doesn't match the behavior for any of the other cases.

What if we were to calculate the start time from the hold time (e.g. `start time = timeline time - hold time / playback rate` though possibly with some complexity to handle pending playback rates) such that we end up being finished?

Making it become finished is consistent with (a) and (b). If we later set the target effect to something non-null I think we'd end up playing it--i.e. we can recover from the situation. We'd have effectively skipped the asynchronous playback however. (We *could* make the behavior when setting a non-null target effect on an animation with a null target effect trigger the async play procedure but generally we try to make setting properties not produce async behavior.)

The other option that comes to mind is to simply let the animation remain play-pending until a new target effect is associated with it.

I need to check what happens for pause-pending too.

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2077#issuecomment-404380860 using your GitHub account

Received on Thursday, 12 July 2018 03:50:47 UTC