From 6b7830a6772f0b0501cbbd0070430d9f89ffb2c2 Mon Sep 17 00:00:00 2001
From: fantasai
+ An [=animation effect=] is
+ associated with an animation
+ when the effect is that animation’s [=associated effect=].
At a given moment,
- an [=animation effect=] can be [=associated with an animation|associated=]
+ an [=animation effect=] can be [=associated animation|associated=]
with at most one [=animation=].
An [=animation effect=], |effect|,
@@ -4248,11 +4247,6 @@ Combining effects {#combining-effects}
of any two [=keyframe effects=] |A| and |B| within an [=effect stack=]
is established by comparing their properties as follows:
- 1. Let the associated animation of an animation effect
- be the [=animation=] [=associated with an animation|associated=]
- with the [=animation effect=].
-
1. Sort |A| and |B|
by applying the following conditions in turn
until the order is resolved,
From 058c4b83bd2420bd845dde15bb6ed24954548934 Mon Sep 17 00:00:00 2001
From: fantasai
+ All [=animation effects=] have the following properties:
+ * an [=active interval=],
+ determined by its [=start delay=] and [=active duration=],
+ defining the time interval during which its behavior takes effect
+ * an [=iteration duration=], [=iteration count=], and [=iteration start=]
+ defining how its behavior repeats within that interval
+ * a [=playback direction=] applying to each iteration,
+ to allow reversing the timing of effects within an iteration
+ * a [=fill mode=] defining the application of effects
+ [=before phase|before=]/[=after phase|after=] its [=active interval=]
+ * optionally, an [=animation effect/associated animation=]
+ and through it, optionally, an [=associated with a timeline|associated timeline=],
+ which cause the [=animation effect=] to apply its behavior
+ by driving its [=local time|local time value=]
+
+### Associated animation and timeline ### {#animation-effects-and-animations}
+
An [=animation effect=] is
associated with an animation
@@ -2487,10 +2502,6 @@ Animation effects {#animation-effects}
Subsequent levels of this specification
will define further types of [=animation effects=].
- All types of [=animation effects=]
- define a number of common properties
- which are described in the following sections.
-
### The active interval ### {#the-active-interval}
-
- (a) An animation effect with no delay;
- the [=start time=] and beginning of the [=active interval=]
- are coincident.
- (b) An animation effect with a positive delay;
- the beginning of the [=active interval=]
- is deferred by the delay.
- (c) An animation effect with a negative delay;
- the beginning of the [=active interval=]
- is brought forward by the delay.
-
+
+ (a) An animation effect with no delay;
+ the [=start time=] and beginning of the [=active interval=]
+ are coincident.
+ (b) An animation effect with a positive delay;
+ the beginning of the [=active interval=]
+ is deferred by the delay.
+ (c) An animation effect with a negative delay;
+ the beginning of the [=active interval=]
+ is brought forward by the delay.
+ max(start delay + active duration + end delay, 0).
+
+ Note: Although the [=end delay=] is typically only useful
+ in combination with sequence effects
which are introduced in a subsequent level of this specification,
it is included here for the purpose of representing
the min
attribute in SVG ([[SVG11]], Chapter 19).
- The end time of an [=animation effect=]
- is the result of evaluating
- max(start delay + active duration + end delay, 0).
### Local time ### {#local-time-section}
@@ -3236,7 +3224,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
The [=active duration=] is calculated as follows:
- active duration =
+ [=active duration=] =
From cbdae49d9260aeb3100acba9d6894a3c64aa5ede Mon Sep 17 00:00:00 2001
From: fantasai iteration duration × iteration count
+ : none
+ ::
+ The animation effect has no effect when it is not [=in play=].
+
+ : forwards
+ ::
+ When the animation effect is in the [=animation effect/after phase=],
+ the animation effect will produce the same [=iteration progress=] value
+ as the last moment it is scheduled to be [=in play=].
+
+ For all other times that the animation effect is not [=in play=],
+ it will have no effect.
- The possible [=fill modes=] are:
+ : backwards
+ ::
+ When the animation effect is in the [=animation effect/before phase=],
+ the animation effect will produce the same [=iteration progress=] value
+ as the earliest moment that it is scheduled to be [=in play=].
- * none,
- * forwards,
- * backwards, and
- * both.
+ For all other times that the animation effect is not [=in play=],
+ it will have no effect.
- The normative definition of these modes
+ : both
+ ::
+ When the animation effect is in its [=animation effect/before phase=],
+ [=fill mode/backwards=] fill behavior is used.
+
+ When the animation effect is in its [=animation effect/after phase=],
+ [=fill mode/forwards=] fill behavior is used.
+
+
+
+ The normative effect of these modes
is incorporated in the calculation of the [=active time=]
in [[#calculating-the-active-time]].
+ Some examples of the these [=fill modes=] are illustrated below.
+
+
+
+ (a) fill mode [=fill mode/none=].
+ The animation effect has no effect outside its active phase.
+ (b) fill mode [=fill mode/forwards=].
+ After the active phase has finished,
+ the [=iteration progress=] value continues to maintain a fill value.
+ (c) fill mode [=fill mode/backwards=].
+ The animation effect produces a fill value
+ until the start of the active phase.
+ (d) fill mode [=fill mode/both=].
+ Both before and after the active phase
+ the animation effect produces a fill value.
+
-
- (a) fill mode "none".
- The animation effect has no effect outside its active phase.
- (b) fill mode "forwards".
- After the active phase has finished,
- the [=iteration progress=] value continues to maintain a fill value.
- (c) fill mode "backwards".
- The animation effect produces a fill value
- until the start of the active phase.
- (d) fill mode "both".
- Both before and after the active phase
- the animation effect produces a fill value.
-
: If the [=fill mode=] is
- backwards or
- both,
+ [=fill mode/backwards=] or [=fill mode/both=],
::
Return the result of evaluating
-#### Calculating the overall progress #### {#calculating-the-overall-progress}
+### Calculating the overall progress ### {#calculating-the-overall-progress}
The overall progress describes
the number of iterations that have completed (including partial iterations)
@@ -3338,7 +3390,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
max(local time − start delay, 0).
@@ -3275,8 +3262,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
max(min(local time − start delay,
@@ -4500,7 +4486,7 @@ Side effects of animation {#side-effects-section}
a [=stacking context=] will be created for the [=effect target=]
so long as the [=animation=] is in the [=animation effect/before phase=],
the [=animation effect/active phase=] or,
- if it has a [=fill mode=] of "forwards" or "both",
+ if it has a [=fill mode=] of [=fill mode/forwards=] or [=fill mode/both=],
the [=animation effect/after phase=].
@@ -5184,10 +5170,10 @@ The {{AnimationEffect}} interface {#the-animationeffect-interface}
: If the [=animation effect=] to which the fill mode is being applied
is a [=keyframe effect=],
::
- Use {{FillMode/none}} as the [=fill mode=].
+ Use [=fill mode/none=] as the [=fill mode=].
: Otherwise,
- :: Use {{FillMode/both}} as the [=fill mode=].
+ :: Use [=fill mode/both=] as the [=fill mode=].
@@ -5282,16 +5268,18 @@ The {{AnimationEffect}} interface {#the-animationeffect-interface}
enum FillMode { "none", "forwards", "backwards", "both", "auto" };
+ Represents an [=animation effect=]’s [=fill mode=].
+
: none
- :: No fill.
+ :: No fill. ([=Fill mode=] [=fill mode/none=].)
: forwards
- :: Fill forwards.
+ :: Fill [=fill mode/forwards=].
: backwards
- :: Fill backwards.
+ :: Fill [=fill mode/backwards=].
: both
- :: Fill backwards and forwards.
+ :: Fill [=fill mode/both=] backwards and forwards.
: auto
:: No fill.
In a subsequent level of this specification, this may produce
From 5fce5953b49a85d380896d610eab048b80adfc38 Mon Sep 17 00:00:00 2001
From: fantasai
+
min
attribute in SVG ([[SVG11]], Chapter 19).
-
-### Local time ### {#local-time-section}
-
- The local time of an [=animation effect=] at a given moment
- is based on the first matching condition from the following:
-
-
-
+ alt="A comparison of local time, active time, and iteration time.
+ Local time crosses zero at the start time of the animation,
+ and rises linearly.
+ Active time is zero until the start of the active interval,
+ at which point it rises linearly to the end time,
+ beyond which it remains at its maximum value.
+ Iteration time is likewise zero until the start of the active interval,
+ and rises linearly,
+ but restarts at zero at the start of every new iteration,
+ and remains at its halfway point from the end time onward.">
+ [=active duration=] =
+
+
+ If either the [=iteration duration=] or [=iteration count=] are zero,
+ the [=active duration=] is zero.
+
+ Note: This clarification is needed
+ since the result of infinity multiplied by zero
+ is undefined according to IEEE 754-2008.
+
+### Direction control ### {#direction-control}
+
+ [=Animation effects=] can also be configured
+ to run iterations in alternative directions
+ using direction control.
+ For this purpose, [=animation effects=] have
+ a playback direction parameter
+ which takes one of the following values:
+
+ * normal,
+ * reverse,
+ * alternate, or
+ * alternate-reverse.
+
+ The semantics of these values are incorporated into
+ the calculation of the [=directed progress=] which follows.
+
+iteration duration × iteration count
+
- [=active duration=] =
-
-
- If either the [=iteration duration=] or [=iteration count=] are zero,
- the [=active duration=] is zero.
-
- Note: This clarification is needed
- since the result of infinity multiplied by zero
- is undefined according to IEEE 754-2008.
-
-### Transforming the local time ### {#transforming-the-local-time}
-
-#### Calculating the active time #### {#calculating-the-active-time}
+### Calculating the active time ### {#calculating-the-active-time}
The active time is based on the [=local time=] and [=start delay=].
However, it is only defined
@@ -3307,7 +3359,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
iteration duration × iteration count
- overall progress + iteration start.
-#### Calculating the simple iteration progress #### {#calculating-the-simple-iteration-progress}
+### Calculating the simple iteration progress ### {#calculating-the-simple-iteration-progress}
The simple iteration progress
is a fraction of the progress through the current iteration
@@ -3404,52 +3456,6 @@ Core animation effect calculations {#core-animation-effect-calculations}
1. Otherwise, return floor(overall progress).
-Direction control {#direction-control}
------------------
-
- [=Animation effects=] can also be configured
- to run iterations in alternative directions
- using direction control.
- For this purpose, [=animation effects=] have
- a playback direction parameter
- which takes one of the following values:
-
- * normal,
- * reverse,
- * alternate, or
- * alternate-reverse.
-
- The semantics of these values are incorporated into
- the calculation of the [=directed progress=] which follows.
-
-1.0 − simple iteration progress.
-Time transformations {#time-transformations}
---------------------
-
- It is often desirable to control the rate
- at which an [=animation effect=] progresses.
- For example, easing the rate of animation
- can create a sense of momentum and produce a more natural effect.
- The CSS Easing Functions Module [[!CSS-EASING-1]]
- defines [=timing functions=] for this purpose.
-
- [=Animation effects=] have
- one [=timing function=] associated with them.
- The default [=timing function=]
- is the [=linear timing function=].
-
### Calculating the transformed progress ### {#calculating-the-transformed-progress}
The transformed progress is calculated
@@ -3533,10 +3524,9 @@ Time transformations {#time-transformations}
passing [=directed progress=] as the input progress value
and |before flag| as the before flag.
-The iteration progress {#the-iteration-progress}
-----------------------
+### Yielding the iteration progress ### {#the-iteration-progress}
- The iteration progress of an [=animation effect=]
+ The final output iteration progress of an [=animation effect=]
is simply its [=transformed progress=].
From d8d188a4c436002ba3c68641448b64854940af18 Mon Sep 17 00:00:00 2001
From: fantasai
- The semantics of these values are incorporated into
- the calculation of the [=directed progress=] which follows.
-
-
+
+ The semantics of these values are incorporated into
+ the calculation of the [=directed progress=]
+ in [[#calculating-the-directed-progress]].
-### Time transformations ### {#time-transformations}
+### Easing (effect timing transformations) ### {#time-transformations}
It is often desirable to control the rate
at which an [=animation effect=] progresses.
For example, easing the rate of animation
can create a sense of momentum and produce a more natural effect.
- The CSS Easing Functions Module [[!CSS-EASING-1]]
+ The CSS Easing Functions Module
defines [=timing functions=] for this purpose.
+ [[!CSS-EASING-1]]
- [=Animation effects=] have
- one [=timing function=] associated with them.
- The default [=timing function=]
+ [=Animation effects=] each have
+ an effect timing function,
+ which is a [=timing function=]
+ used to transform progress across the entirety of each iteration.
+ See [[#calculating-the-transformed-progress]].
+
+ The default [=effect timing function=]
is the [=linear timing function=].
+ Note: Specific [[#types-of-animation-effects|types of animation effects]]
+ may provide additional time transformations.
+ For example, [=keyframe effects=] can provide
+ [=keyframe-specific timing functions=]
+ that can apply a [=timing function=]
+ specifically between two adjacent keyframes.
+
Calculating progress {#core-animation-effect-calculations}
--------------------
@@ -3470,19 +3475,21 @@ Calculating progress {#core-animation-effect-calculations}
- : If [=playback direction=] is
normal,
+ : If [=playback direction=] is [=playback direction/normal=],
::
Let the |current direction| be forwards.
- : If [=playback direction=] is reverse,
+ : If [=playback direction=] is [=playback direction/reverse=],
::
Let the |current direction| be reverse.
- : Otherwise,
+ : Otherwise
+ (the [=playback direction=] is
+ [=playback direction/alternate=] or [=playback direction/alternate-reverse=])p,
::
1. Let |d| be the [=current iteration index=].
- 1. If [=playback direction=] is alternate-reverse
+ 1. If [=playback direction=] is [=playback direction/alternate-reverse=]
increment |d| by 1.
1. If d % 2 == 0,
@@ -3520,7 +3527,7 @@ Calculating progress {#core-animation-effect-calculations}
and going forwards is false.
1. Return the result of evaluating
- the [=animation effect=]’s [=timing function=]
+ the [=effect timing function=]
passing [=directed progress=] as the input progress value
and |before flag| as the before flag.
@@ -3748,11 +3755,13 @@ Keyframe effects {#keyframe-effects}
or have unsupported values is defined in
[[#the-effect-value-of-a-keyframe-animation-effect]].
- Each keyframe also has a [=timing function=] associated with it
+ Each keyframe also has a keyframe-specific timing function
+ associated with it, which is a [=timing function=]
that is applied to the period of time between
the keyframe on which it is specified
and the next keyframe in the list.
- The [=timing function=] specified on the last keyframe in the list
+
+ Note: The [=timing function=] specified on the last keyframe in the list
is never applied.
Each [=keyframe=] may have a keyframe-specific composite operation
From 7b3a173885c4d96254ba0b008497bb8da41ebeb6 Mon Sep 17 00:00:00 2001
From: fantasai
+ [=active duration=] =
+
+
+ If either the [=iteration duration=] or [=iteration count=] are zero,
+ the [=active duration=] is zero.
+
+ Note: This clarification is needed
+ since the result of infinity multiplied by zero
+ is undefined according to IEEE 754-2008.
+
+#### The end delay and animation effect end time #### {#the-end-delay}
+
Similar to the [=start delay=],
an [=animation effect=] also has an end delay,
which is primarily of use when sequencing one [=animation effect=]
@@ -3165,22 +3185,6 @@ Animation effects {#animation-effects}
-#### Calculating the active duration #### {#calculating-the-active-duration}
-
- The [=active duration=] is calculated as follows:
-
- iteration duration × iteration count
+
- [=active duration=] =
-
-
- If either the [=iteration duration=] or [=iteration count=] are zero,
- the [=active duration=] is zero.
-
- Note: This clarification is needed
- since the result of infinity multiplied by zero
- is undefined according to IEEE 754-2008.
-
### Direction control ### {#direction-control}
[=Animation effects=] can also be configured
@@ -3273,9 +3277,6 @@ Calculating progress {#core-animation-effect-calculations}
- The process for calculating the [=active duration=]
- is normatively defined in [[#calculating-the-active-duration]].
-
Having established the [=active duration=],
the process for transforming an [=animation effect=]’s [=local time=]
into its [=transformed progress=] ([=iteration progress=])
iteration duration × iteration count
-