- From: Brian Birtles <bbirtles@mozilla.com>
- Date: Thu, 2 Jul 2015 14:05:44 +0900
- To: Shane Stephens <shans@google.com>, "public-fx@w3.org" <public-fx@w3.org>
- Cc: "Tab Atkins Jr." <jackalmage@gmail.com>
On 2015/06/23 8:57, Shane Stephens wrote: > An alternative proposal: > CSS animations use sequence number as priority, and are created in tree- > and list- order. CSS Animations are still prioritized absolutely above > script animations (there are two lists). Changing an animation-name > property triggers an update of all listed sequence numbers. So: > > elem.style.animation = 'a 2s, b 3s, c 4s'; // a: 0, b: 1, c: 2 > let b = elem.getAnimations[1]; > let c = elem.getAnimations[2]; > elem.style.animation = 'a 2s, d 5s'; //a: 3, d: 4 > c.play(); // c promoted to script animation, keeps sequence number > b.play(); // b promoted to script animation, keeps sequence number > elem.getAnimations(); // what is the order here? b,c,a,d > > Script animations have preserved text order in terms of their > *definition* (which is important, see below). I'm trying to work through this (and hopefully implement it) but I think I'm not certain I understand it. Working through an example: elem.style.animation = 'a 2s'; // a: 0; var a = elem.getAnimations()[0]; var b = elem.animate(...); // b: 1; // Currently if a and b target the same property, b will win // (Actually, see below, this is probably wrong.) // Now if I do: elem.style.animation = 'a 2s, c 3s'; // From what I understand of your proposal that would give: // a: 2, c: 3 // i.e. now a beats b simply because we added an animation? Clearly I've misunderstood something. I guess either you're suggesting: a) Updating animation properties triggers a global sequence number rewrite (I hope this isn't the case), or b) Script-animations and CSS animations share the same source of sequence numbers but when we come to prioritize animations we don't use them for prioritizing CSS animations (or at least we *first* sort by script vs CSS, then by document order, then finally by animation-name order which happens to match sequence number order). I'm pretty sure you're suggesting (b) but I want to be sure. I think I was confused because at one point you suggested that the prioritization we do for CSS animations and transitions could be expressed using sequence numbers. Best regards, Brian
Received on Thursday, 2 July 2015 05:06:09 UTC