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

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".)

~TJ

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