Re: [css3-animations] Complex animations

On Mar 28, 2011, at 9:24 AM, Dean Jackson wrote:

> One though we have to get around this particular issue is to add a property such as
> 
> animation-trigger: [some way to reference an animation on an element]
> 
> that would set the start time of an animation to the end of the referenced animation. SMIL supports this nicely, even with simple expressions, but has the advantage that animations apply over the entire document (not just when particular style rules apply). SMIL also handles synchronisation of animations explicitly.
> 
> An issue we (Apple) have noticed over the years implementing animation is that in many cases the author would prefer not to have the animation jump past its first few frames. Unfortunately, the start of an animation may require a re-layout which means that the pause may be significant and cause obvious stutters.

Yeah, you get over constrained if you want both to see every animation frame and to sync animations. We added some logic to WebKit that allows us to synchronize any animation or transition started from the same event cascade at the same time. This is keyed to the rendering of the contents of the layers that are to be animated (assuming some or all of the animations are in layers). So all animation, both layered and non-layered will be synchronized. 

It works pretty well for synchronizing a bunch of animations that are used to build up or tear down some part of the presentation. And you can use animation-delay to enable you to synchronize animations with different relative start times. But that doesn't help you if you want to trigger animations from something other than the start of another. 

I like the idea of animation-trigger, but I don't think it would be enough to trigger just off of the end of an animation. There are many time points that would make interesting triggers. One of the most useful would be triggering at some amount of time before some event is to occur. That's not possible with user events (yet :-) but for things like animation end or iteration you know when they will occur, so triggering at some fixed time before this would be easy. Even more useful would be the ability to trigger on the end of media playback. That way you can say, "I want to trigger 5 seconds before this video ends", and you'll get the right trigger whether the video is 10 seconds or 10 minutes long.

-----
~Chris
cmarrin@apple.com

Received on Monday, 28 March 2011 18:23:11 UTC