Re: [css3-animations] animation-delay, onload, and animation-fill-mode

On Mar 31, 2011, at 11:36 AM, L. David Baron wrote:

> I'm trying to understand what css3-animations says about how
> 'animation-fill-mode' interacts with animations not starting until
> the document's load event has fired.
> 
> For a start, this bit of the spec:
>  # An ‘animation-delay’ value of ‘0’ means the animation will
>  # execute as soon as it is applied.
>  http://dev.w3.org/csswg/css3-animations/#the-animation-delay-property-
> contradicts this:
>  # The start time of an animation is the latter of two moments: the
>  # time at which the style is resolved that specifies the
>  # animation, or the time the document's load event is fired.
>  http://dev.w3.org/csswg/css3-animations/#animations
> and I presume the former should be fixed.
> 
> Second, the second of the above pieces of text introduces the issue
> that there are times before a document has loaded when the timing
> relative to the start time of the animation is unknown.  It's clear
> to me that for animations with a positive animation-delay, the style
> from the animation does not apply while the document is loading,
> unless animation-fill-mode is 'both' or 'backwards' (in which case I
> presume it should).
> 
> But for animations with a zero or negative animation-delay, should
> the style from the animation apply during the document load, as
> though the current time relative to the animation start were '0', or
> should it not apply as though the current time were a large negative
> number?

We initially put in that text about waiting for the load event to fire to
match SVG animations, but WebKit now just starts animations whenever
it resolves the animation style. Waiting for the load event prevents
authors from running CSS animations as the page is loading, which
seems pointless.

So I think this removes the ambiguity.

Simon

Received on Thursday, 31 March 2011 19:21:46 UTC