W3C home > Mailing lists > Public > www-style@w3.org > December 2009

[css3-animations] running animations before document load event

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 22 Dec 2009 11:51:41 -0500
To: www-style@w3.org
Message-ID: <20091222165141.GA25693@pickering.dbaron.org>
http://dev.w3.org/csswg/css3-animations/#animation-behavior- says:
  # 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.

This seems somewhat problematic to me, since pages often want to be
usefully interactive before the load event has fired.  (For example,
the load event could be delayed due to a slow-loading advertisement
image, or while waiting for the photo in the center of a flickr page
to load, etc.)

That said, I see the value in synchronizing animations that are
specified in the style present when the document loads, so this
behavior seems like it may be a reasonable default (although perhaps
DOMContentLoaded would be a better default).

However, I think there ought to be a mechanism for overriding that
default and allowing animations to start before the document is
fully loaded.

I don't have strong opinions about what that mechanism should be,
other than that it seems like it would have to be an API called from
script.  However, I can think of a number of questions about that
API:
 * should it essentially change the document load time as far as
   animations are concerned, or should it start only animations
   currently present and leave the rest to start when the load event
   fires (or on a later call to this API)?
 * should it allow starting only animations on certain elements or
   element subtrees?
 * should it be possible to restart (on document load, or at another
   time) the animations that were started by such an API?

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Tuesday, 22 December 2009 16:52:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:47:12 GMT