From 83b8172b3c09e9e8878eb08bf49906a90af9b03f Mon Sep 17 00:00:00 2001 From: Brian Birtles Date: Fri, 3 Apr 2015 15:44:35 +0900 Subject: [PATCH] Initial attempt at supporting negative infinity start delay (issue #48) --- Overview.src.html | 100 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 87 insertions(+), 13 deletions(-) diff --git a/Overview.src.html b/Overview.src.html index c620263..f334d25 100644 --- a/Overview.src.html +++ b/Overview.src.html @@ -1647,10 +1647,14 @@

The active interval

In addition to the start time, an animation effect also has a start delay which is an offset from the start time. +The start delay is represented a real number including positive and +negative infinity. Unlike the start time which is determined by the parent group, the start delay is a property of the animation effect itself. + + The lower bound of the active interval of an animation @@ -1874,11 +1878,19 @@

Animation effect phases and 3. the animation effect's local time is less than the sum of its start delay and active duration. + If the start delay is negative infinity, and the + active duration is positive infinity, the sum of the start + delay and active duration is positive infinity for the purpose + of this comparison. An animation effect is in the after phase if the animation effect's local time is not unresolved and is greater than or equal to the sum of its start delay and active duration. +As with the active phase, if the start delay is negative infinity +and the active duration is positive infinity, then, for the purposes of +this comparison, their sum is positive infinity and, as such, the animation +effect will never enter the after phase. An animation effect is in play if all of the following conditions are met: @@ -2110,6 +2122,12 @@

Controlling iteration

The iteration start is a finite real number greater than or equal to zero. +For an animation effect whose start delay is negative infinity and +iteration count is positive infinity, the iteration start +determines the offset into the current iteration when the local time is +zero. As such, only the fraction portion of the iteration start is +significant in this case. + The behavior of these parameters is defined in the calculations in . @@ -2450,9 +2468,15 @@
Calculating the active time
The active time is based on the local time and start delay. -However, it is only defined when the animation effect should -produce an output and hence depends on its fill mode and -phase +Note that since the start delay may be negative infinity, the +active time may be positive infinity. When the start delay is +positive infinity, the animation effect never enters the active +phase, hence the reverse case of active time becoming negative +infinity never occurs. + +The active time is only a resolved time when the +animation effect should produce an output and hence depends on its +fill mode and phase as well as the phase of its parent group, if any, @@ -2569,7 +2593,18 @@
Calculating the scaled active timeunresolved time value. -2. Return the scaled active time based on the +2. If the active time is positive infinity, return the active + time. + + Note: The active time is only positive infinity in the case of + a start delay of negative infinity and an iteration duration + of infinity. In this case, positive infinity is a reasonable value for + the scaled active time (regardless of the value of the + playback rate) because special + handling of the iteration time is performed in this case + without using the scaled active time. + +3. Return the scaled active time based on the playback rate as follows, @@ -2582,6 +2617,8 @@
Calculating the scaled active timeplayback rate + start offset. + If active time is positive infinity and active duration + : If the playback rate is zero, :: Return start offset. @@ -2607,9 +2644,24 @@
Calculating the iteration time
1. If the scaled active time is unresolved, return unresolved. -2. If the iteration duration is zero, return zero. +2. If the iteration duration is zero or infinity, return zero. + +3. If the start delay is negative infinity, return the result of + evaluating + (animation effect playback rate × local time + + (iteration start % 1) × iteration duration) % + iteration duration. + + + (local time + (iteration start % 1) × + iteration duration) % iteration duration. + + + + Note: In this case the iteration count must be positive infinity or + else the scaled active time would be unresolved. -3. If scaled active time - start +4. If scaled active time - start offset is equal to the repeated duration, active duration, @@ -2618,7 +2670,7 @@
Calculating the iteration time
% 1
is zero, return the iteration duration. -4. Otherwise, return scaled active time +5. Otherwise, return scaled active time % iteration duration.

Calculating the current iteration

@@ -2645,6 +2697,9 @@

Calculating the current iteration

ceil(iteration start + iteration count) - 1
. +1. If the active time is positive infinity, return positive + infinity. + 1. If the iteration time equals the iteration duration, return iteration start + iteration count - 1. @@ -2716,18 +2771,32 @@

Calculating the directed time

1. Let d be the current iteration. - 2. If playback direction is + 2. If d is positive infinity, let d be the + result of evalulating: + +
+ + + floor((playback rate + × local time + + + floor((local time + + + (iteration start % 1) × iteration duration) / + iteration duration)
+ + 3. If playback direction is alternate-reverse increment d by 1. - 3. Issue: There used to be a step here which seemed to be adding + 4. Issue: There used to be a step here which seemed to be adding special handling for filling when the effect ends on a repeat boundary but it seems like that is taken care of by the calcuation of iteration time and current iteration. Is anything actually needed here? - 4. If d % 2 == 0, let the + 5. If d % 2 == 0, let the current direction be forwards, otherwise let the current direction be reverse. If d is infinity, let the current direction @@ -3397,6 +3466,9 @@

Calculating the time fraction

+: If the iteration duration is positive infinity, +:: Return iteration start % 1. + : Otherwise, :: Return transformed time / iteration duration. @@ -5304,7 +5376,7 @@

The AnimationEffectTimingRe
 interface AnimationEffectTimingReadonly {
-    readonly attribute double                             delay;
+    readonly attribute unrestricted double                delay;
     readonly attribute double                             endDelay;
     readonly attribute FillMode                           fill;
     readonly attribute double                             iterationStart;
@@ -5465,7 +5537,7 @@ 

The AnimationEffectTiming in
 interface AnimationEffectTiming : AnimationEffectTimingReadonly {
-    inherit attribute double                             delay;
+    inherit attribute unrestricted double                delay;
     inherit attribute double                             endDelay;
     inherit attribute FillMode                           fill;
     inherit attribute double                             iterationStart;
@@ -5549,7 +5621,7 @@ 

The AnimationEffectTimingProp
 dictionary AnimationEffectTimingProperties {
-    double                             delay = 0;
+    unrestricted double                delay = 0;
     double                             endDelay = 0;
     FillMode                           fill = "auto";
     double                             iterationStart = 0.0;
@@ -7308,6 +7380,8 @@ 

Changes since last publication

asynchronous play/pause/reverse operations. * Renamed animation nodes to animation effects and what were previously known as an animations to keyframe effects. +* Allowed the start delay of an animation effect to be positive + or negative infinity. * Deferred group effects (previously known as animation groups) to a subsequent level. Deferring this feature also lead to the following simplifications.