Re: [web-animations] Ordering animations based on when they transition from idle

> I wonder if this proposal is a little bit odd in that we have the
> following two cases:
>
> a) var anim = new CSSAnimation(...);
>     anim.play();
>
> b) elem.style.animation = "...";
>     var anim = elem.getAnimations()[0];
>     elem.style.animation = "";
>     anim.play();
>
> In (a), the priority of anim is based on when the ctor is called but in
> (b) the priority of anim is based on when play() is called.
>
> Would it be more consistent to say that the priority of all
> script-generated animations is based on their first transition from
> idle? And for repurposed CSS animations it is their first transition
> from idle after being disowned by CSS?
>

Yes, there would be more consistency between these two cases. I think that
consistency here is less important than simple ordering semantics that are
separable from playback, though. (As that's what started this discussion,
we've already covered this in some detail, but let me know if you want me
to make the case for why creation ordering is better than play() ordering
again)

There's also an alternative consistency argument: in script, ordering is
based on creation time. But CSS animations aren't created in script, so we
need to define a 'script creation' moment. Ordering of script animations is
always based on script creation.

If we allow script modification of animation timing in the future, then
this naturally extends - script creation would be the first time we modify
any of the animation state from script.

So e.g.
var anim = elem.getAnimations()[0];
anim.timing.duration = 10s; // this is not currently possible :)

Cheers,
    -Shane

Received on Thursday, 9 July 2015 02:31:14 UTC