W3C home > Mailing lists > Public > www-style@w3.org > September 2014

[css-animations] Proposal for handling changes to animation-* properties while an animation is running

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 9 Sep 2014 09:04:04 -0700
Message-ID: <CAAWBYDC_gAoUNSUhm5kjk6t28X5fY2mxm9CLsOkSZyTY4oBkgA@mail.gmail.com>
To: www-style list <www-style@w3.org>
Currently, the animations spec requires "snapshotting" all the
animation-affecting properties when the animation starts.  We
previously discussed allowing some things to be updated on the fly,
and in today's f2f discussion, we clarified more.

Here's the proposal: just let everything be adjustable.  The start
time of the animation (when the animation starts applying; when value
is adjusted (in the animation-* properties, or in the @keyframes
rule), just recompute what value the animation would be at if it had
always had those values, and start applying that instead.

Event-handling needs to be dealt with here; we propose that start and
end events are fired once, and are guaranteed to fire, even if an
adjustment caused the actual start/end time to never be instantiated.
Iteration events just fire whenever the animation plays through an
iteration boundary; adjusting an animation to "skip" a bunch of
iterations does *not* fire a bunch at once, and if you adjust an
animation to return to an earlier point, the iteration event for a
particular index will fire again.

(More discussion today showed that this idea of how to handle events
appears to generalize well; we can use this as a general rule for how
to resolve "when do events fire in case X".)

Received on Tuesday, 9 September 2014 16:04:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:46 UTC