- From: Brian Birtles <bbirtles@mozilla.com>
- Date: Mon, 19 May 2014 14:19:04 +0900
- To: public-fx@w3.org
(2014/05/19 7:06), Boris Zbarsky wrote: > On 5/18/14, 6:04 AM, Robert O'Callahan wrote: >> On Fri, May 16, 2014 at 8:39 AM, Erik Dahlström <ed@opera.com >> <mailto:ed@opera.com>> wrote: >> >> 1. Why is this a method and not an attribute? E.g 'readonly >> sequence<AnimationPlayer> players'. >> >> WebIDL attributes may not be sequences. >> http://www.w3.org/TR/WebIDL/#idl-attributes > > More importantly, those would be different semantics. Do we want each > get to create a new array object, or to return the same one? That's right. The current intended behavior is to return a new array object each time. That still lets you do some simple operations like check if all animations in the document have finished (e.g. so you can take a screenshot), e.g. var allFinished = document.timeline.getAnimationPlayers().reduce( function(result, player, index) { return index && result || player.finished; }, true); However, we also want to be able to use this for an application that draws a timeline view of all the animations in the document. In order to do a live view, however, we'd really need notifications when that list changes in any way (new animations, removed animations, altered animations, altered order etc.). I'm not sure yet what a good API for that would be yet. I'm also not sure if timelines should really know what things are running against them or if that should be some sort of global lookup (e.g. window.getAnimationPlayers(timeline)). Brian
Received on Monday, 19 May 2014 05:19:34 UTC