W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2015

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

From: Shane Stephens <shans@google.com>
Date: Thu, 09 Jul 2015 02:30:34 +0000
Message-ID: <CAGTfzwSssHZQ0YO3co-6rPZUxA1vXOeZBuvbK1jFxL4=z0k+Ag@mail.gmail.com>
To: Brian Birtles <bbirtles@mozilla.com>, "public-fx@w3.org" <public-fx@w3.org>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>
> 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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:54 UTC