From 3b046d1a58b29a4c5d45b55169924d0617ac50b5 Mon Sep 17 00:00:00 2001 From: Brian Birtles Date: Fri, 3 Apr 2015 16:54:25 +0900 Subject: [PATCH] Defer custom effects to level 2 This resolves #74 --- Gruntfile.js | 3 +- Overview.src.html | 70 ++++++++++++++++++++++++++++++++++------------- 2 files changed, 53 insertions(+), 20 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 3d9c7fe04cbc..ce671f130233 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -21,7 +21,8 @@ module.exports = function(grunt) { context: { LEVEL: 2, INCLUDE_GROUPS: true, - INCLUDE_ANIMATION_NODE_PLAYBACKRATE: true + INCLUDE_ANIMATION_NODE_PLAYBACKRATE: true, + INCLUDE_CUSTOM_EFFECTS: true } } } diff --git a/Overview.src.html b/Overview.src.html index a92d73e514b9..cf539770f391 100644 --- a/Overview.src.html +++ b/Overview.src.html @@ -192,7 +192,8 @@

Changes since level 1

* group effects and sequence effects, * an animation effect-specific - playback rate. + playback rate, +* custom effects. @@ -603,10 +604,12 @@

Setting the timeline of a animation

1. If previous animation time is resolved, run the procedure to silently set the current time of animation to previous animation time. + 1. Issue: If new timeline is null, we should ensure that custom effects get called with an unresolved time fraction (unless a subsequent change in the same script execution context makes this redundant). + 1. Run the procedure to update an animation's finished state for animation with the did seek flag set to false. @@ -653,11 +656,13 @@

Setting the target effect of an animation passing null as new effect. 1. Let the target effect of animation be new effect. -1. If old effect is not null, queue a task to call any + + +1. If old effect is not null, queue a task to call any custom effects associated with inclusive descendants of - old effect - custom effect associated with old effect - + old effect with an unresolved time fraction.
This is not quite right. If old effect is attached to another @@ -667,6 +672,7 @@

Setting the target effect of an The definition of when custom effects gets called needs to be audited and probably rewritten.

+ 1. Run the procedure to update an animation's finished state for animation with the did seek flag set to false. @@ -877,9 +883,10 @@

Waiting for the target effect

each inclusive descendant of the animation's target effect - including rendering the first frame of any keyframe effect + including rendering the first frame of any keyframe + effect or executing any custom effects associated with an - animation effect. + animation effect. * the animation is associated with a timeline that is not inactive. @@ -1015,8 +1022,10 @@

Playing an animation

1. Set the animation start time of animation to new start time. + 1. Issue: We should queue a task here for sampling custom effects. (This should happen before we resolve the ready promise.) + 1. Resolve animation's current ready promise with animation. 1. Run the procedure to update an animation's finished state for @@ -1088,9 +1097,11 @@

Pausing an animation

1. Make animation's start time unresolved. + 1. Issue: We should queue a task here for sampling custom effects with the final current time. (This should happen before we resolve the ready promise). + 1. Resolve animation's current ready promise with animation. 1. Run the procedure to update an animation's finished state for @@ -1341,17 +1352,18 @@

Cancelling an animation

4. Make animation's hold time unresolved. 5. Make animation's start time unresolved. + + 6. Queue a task to call any custom effects associated with - inclusive descendants of - animation's target effect with an unresolved time fraction. -

- The procedures for calling custom effects needs to be reworked. - Currently they probably involve calling too often for changes that could - be coalesced. -

+ + Issue: The procedures for calling custom effects need to be reworked. + Currently they probably involve calling too often for changes that + could be coalesced. + +

Speed control

@@ -4696,8 +4708,17 @@

Effect accumulation

href="#the-intermediate-effect-value-of-a-keyframe-animation-effect" section>. +

Custom effects

+Issue: This whole feature needs to be revisited. The current thinking is that + rather than having custom effects, we should simply have an + onsample callback on each animation effect. That + would allow, for example, augmenting an existing effect with a function + that performs logging or triggers additional actions at certain times. + With the current arrangement, doing this would require adding a parent + group just to achieve this. +
This section is non-normative In some situations the animation @@ -4831,6 +4852,7 @@

Execution order of custom effects

animation effects
in . Items sorted earlier are executed before those sorted later. + @@ -6827,6 +6849,7 @@

The ComputedKeyframe dicti

+

The EffectCallback callback function

Custom effects can be defined in script by providing an @@ -6880,6 +6903,7 @@

The EffectCallback ca +

The Animatable interface

@@ -7091,6 +7115,7 @@

Script execution and liv + * Changes made to the model using the programming interface do not cause any {{EffectCallback}} functions to be called. @@ -7109,7 +7134,7 @@

Script execution and liv alert(timesCalled); // Displays ‘0’ - + * Changes to specified style, specified attribute values, and the state of the Web Animations model made within the same execution @@ -7164,10 +7189,13 @@

Script execution and liv callbacks for a given top-level browsing context, - must perform a sample including - executing any eligible + must perform a sample + + including executing any eligible custom effects (see ) for all animation effects + section>) + + for all animation effects associated with a timeline that is associated with a document which is the active document of the Changes since last publication

* Renamed animation nodes to animation effects and what were previously known as an animations to keyframe effects. * Deferred group effects (previously known as animation groups) to a subsequent level. + href="https://w3c.github.io/web-animations/level-2/">subsequent level + of this specification. Deferring this feature also lead to the following simplifications. * Deferred the animation effect-specific playback rate since it was considered to be not particularly useful without group effects and @@ -7323,6 +7352,9 @@

Changes since last publication

* Removed motion path animation effects since this functionality can be achieved using the Motion Path Module. +* Deferred custom effects to a subsequent level + of this specification. * Defined that unresolved time values are represented by null. * Added the {{DocumentTimeline}} interface.