Re: [css3-animations] AnimationEvent.elapsedTime "not affected" by animation-delay?

On 03/04/2011, at 4:01 PM, L. David Baron wrote:

> http://dev.w3.org/csswg/css3-animations/#Events-AnimationEvent says:
>  # Note that this value is not affected by the value of
>  # animation-delay.
> 
> That doesn't really help me understand which way to handle
> animation-delay.   Does it mean that the elapsed time counts
> starting from the start of the delay, or starting from the end of
> the delay?  I'm guessing it means from the end of the delay (i.e.,
> when the first iteration began).

Correct. elapsedTime is 0 when the animation really begins to do something.

If you have a positive delay, it's as if elapsedTime begins counting upwards from -delay, and then when it hits 0 you get the event.

> (If that's the case, then what happens when the delay is negative?
> No animationstart event at all, animationstart event with 0
> elapsedTime, or animationstart event with positive elapsedTime?)

Good question. I suggest animationstart with a positive elapsedTime.

Dean

Received on Tuesday, 5 April 2011 00:30:44 UTC