[web-animations] Updating the finish promise in a separate task

Hi,

I'm currently speccing finish/cancel events for animations and I think 
it makes sense to dispatch finish events and also update the finished 
promise in a separate task.

The would mean that something like:

   var anim = elem.animate({...}, 3000);
   anim.currentTime = 5000;
   anim.currentTime = 1000;

would no longer resolve the finished promise immediately since we 
wouldn't check the finished state until the current task had completed.

A more likely use case is something like:

  var anim = elem.animate({...}, 3000);
  anim.currentTime = 5000;
  anim.effect.timing.duration = 10000;

Note that with the current behavior this would resolve the finished 
promise immediately, but if we reverse the last two lines, it would not.

By checking for updates to the finished state in a separate task, 
authors don't need to be so careful about the order in which they update 
animation properties.

This is mostly just a heads up but if anyone has any concerns with this 
please let me know.

Best regards,

Brian

Received on Tuesday, 30 June 2015 04:21:43 UTC