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

[web-animations] Animation composite order (was: Ordering animations based on when they transition from idle)

From: Brian Birtles <bbirtles@mozilla.com>
Date: Thu, 16 Jul 2015 14:49:10 +0900
To: "public-fx@w3.org" <public-fx@w3.org>
Cc: Kari Pihkala <kari.pihkala@gmail.com>, Shane Stephens <shans@google.com>, "Tab Atkins Jr." <jackalmage@gmail.com>
Message-ID: <55A745D6.9030803@mozilla.com>

Just following up on this thread, Shane and I discussed this a bit on
IRC yesterday and we wonder if we should push ahead with adding the
ability to tweak priorities soon-ish.

A few points we discussed:

* "Priority" may be confused with CSS prioritization. From here on we
   will refer to "composite order".[1]

* We want to avoid an API like z-index for setting composite order.
   See [2] for some extreme examples of how z-index is abused in the

* An API along the lines of ChildNode[3] using reference nodes is
   probably better.

   e.g. animA.compositeAfter(animB);

   Strawman proposal:

     Rewrite sequence numbers so that Animation has the same sequence
     number as refAnim minus 1. No idea what we should do if either
     animation is a CSS animation/transition bound to markup. It might
     throw or we might be able to do something sensible.

     Makes this animation the top of the stack.

   Likewise Animation.compositeAfter (mostly so you can do
   anim.compositeAfter(null) to put it on the *bottom* of the stack.)

   A query method might be needed too, e.g. Animation.isBefore().

With that in mind, I'm ok with using creation-time ordering plus the
quirk we described for repurposed CSS animations/transitions--namely
that their sequence number is reset on their first transition from idle
after being orphaned.

There's still plenty of work to do to try and align all these
definitions but what do you think of this approach?

Best regards,


[1] https://github.com/w3c/web-animations/issues/100
[2] http://reports.quickleft.com/css
[3] https://dom.spec.whatwg.org/#interface-childnode
Received on Thursday, 16 July 2015 05:49:38 UTC

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