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

On 2014/10/17 6:26, Sylvain Galineau wrote:
> I took a first simple stab at stating this like so:
>
> 	# Changing the values of animation properties while the animation
> 	# is running has no effect on the amount of time that has elapsed since the
> 	# animation started running i.e. once the animation is running, updates to
> 	# 'animation-delay' have no effect. The remainder of the animation runs
> 	# according to the new animation property values.

I wonder if we really want to go in this direction. It introduces some 
surprising results. For example I suppose that:

   div.style.animation = "anim 2s";
   div.style.animationDelay = "2s";

and:

   div.style.animation = "anim 2s";
   div.clientTop;
   div.style.animationDelay = "2s";

will produce different results since in the first case we'll trigger an 
animation with a 2s delay but in the second case we'll flush style, 
create the animation which starts running immediately, then we'll ignore 
the animation delay when it is set.

That seems surprising to me and easy to trip up on if you're generating 
animations by script and some utility function in your script happens to 
trigger style recalc along the way.

What's the value in preserving the animation start time here? As opposed 
to just letting the animation jump? (Possibly in/out of the active 
interval thus triggering additional events.) After all, it will jump in 
most cases when you update animation-timing-function, 
animation-duration, or animation-direction.

Best regards,

Brian

Received on Friday, 17 October 2014 00:27:29 UTC