W3C home > Mailing lists > Public > public-fx@w3.org > April to June 2015

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

From: Brian Birtles <bbirtles@mozilla.com>
Date: Tue, 30 Jun 2015 13:21:19 +0900
To: "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <5592193F.3000607@mozilla.com>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:54 UTC