Re: [web-animations] does rescheduling create pending task?

Hi Brian,

Thanks for the explanation.

The explanation is perfectly clear, but I'm unable to relate it to the requirement "reschedule that task to run as soon as animation is ready". This doesn't seem to have anything to do with delaying the resolving of the ready promise.

To me it sounds like this: the animation has a pending pause/play task, now you set a new effect to it, you should wait until the new effect's first frame is rendered and then run the task.

So I'm a bit confused when you said it should be better expressed as canceling it. Maybe I misunderstood the meaning of rescheduling?

> What do you mean by effect1 being updated?

I was initially under the impression that running a pending task would cause css properties specified in effect1 to be applied to its target. Now I realize that's wrong, the pending task only updates the animation object. I will ask a different question:

The code example is meant to simulate the rescheduling scenario I had in mind: The animation associated with effect1 is played, but it isn't associated with a timeline, so it has a pending play task. Now the users replace effect1 with effect2, triggering the reschedule step. After the animation has been associated with a timeline, it should be considered ready, At this time, should the pending play task created when animation was associated effect 1 be run to update the animation object? 

> On Apr 10, 2015, at 2:41 PM, Brian Birtles <bbirtles@mozilla.com> wrote:
> 
> Hi Glen,
> 
> On Mon, Mar 16, 2015 at 5:23 PM, Glen Huang <curvedmark@gmail.com <mailto:curvedmark@gmail.com>> wrote:
> When setting the target effect of an animation, the spec says if animation has a pending task, it should be rescheduled to run as soon as the animation is ready. My question is, after the rescheduling, should the animation still be considered as having a pending task?
> 
> The intention there is simply that if, for example, the implementation finished uploading the first frame of the old effect to the compositor and is about to resolve the ready promise when the target effect it changed, it should defer doing that and wait until it has uploaded the (now updated) first frame before resolving the promise. Perhaps that would be better expressed as cancelling the previous task?
>  
> And once the animation is ready, will the animation run two tasks, one for the rescheduled pending task created by previous effect, and another created by the current effect?
> 
> Some example code:
> 
> ```js
> let effect1 = new KeyframeEffect(…);
> let effect2 = new KeyframeEffect(…);
> let anim = new Animation(effect1);
> anim.play();
> anim.effect = effect2;
> anim.timeline = document.timeline;
> ```
> 
> Should effect1 be updated in this case?
> 
> What do you mean by effect1 being updated?
> 
> Thanks,
> 
> Brian

Received on Saturday, 11 April 2015 06:49:02 UTC