diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 7512553e1aa..375b5929327 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2465,15 +2465,36 @@ Animation effects {#animation-effects} An animation effect is a [=timing node=] that provides a static description of some timed behavior. -### Relationship between animation effects and animations ### {#animation-effects-and-animations} + 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=] - The [=associated effect=] of an [=animation=], if set, - is a type of [=animation effect=]. - The [=associated effect=] of an [=animation=] - is said to be associated - with that animation. +### Types of animation effects ### {#types-of-animation-effects} + + This specification defines a single type of [=animation effect=]: + [=keyframe effects=]. + Subsequent levels of this specification + will define further types of [=animation effects=]. + +### Associated animation and timeline ### {#animation-effects-and-animations} + + 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|, @@ -2481,107 +2502,186 @@ Animation effects {#animation-effects} if |effect| is [=associated with an animation=] which, in turn, is associated with |timeline|. -### Types of animation effects ### {#types-of-animation-effects} +### Local time ### {#local-time-section} - This specification defines a single type of [=animation effect=]: - [=keyframe effects=]. - Subsequent levels of this specification - will define further types of [=animation effects=]. + The local time of an [=animation effect=] + represents the [=animation/current time=] + provided by its [=associated animation=], + determining the progress of the [=animation effect=]. + At a given moment, + it is based on the first matching condition below: + +
+ [=active duration=] =
+ iteration duration × iteration count
+
+
+ If either the [=iteration duration=] or [=iteration count=] are zero,
+ the [=active duration=] is zero.
- The start delay of an [=animation effect=]
- is a signed offset from the [=start time=] of the [=animation=]
- with which the animation effect is associated.
+ Note: This clarification is needed
+ since the result of infinity multiplied by zero
+ is undefined according to IEEE 754-2008.
- The length of the [=active interval=] is called the [=active duration=],
- the calculation of which is defined in [[#calculating-the-active-duration]].
+#### 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 animations
+ which is primarily of use when sequencing one [=animation effect=]
based on the [=end time=] of another [=animation effect=].
- Although this 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=]
+ 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}
-
- The local time of an [=animation effect=] at a given moment
- is based on the first matching condition from the following:
-
- min
+ attribute in SVG ([[SVG11]], Chapter 19).
### Animation effect phases and states ### {#animation-effect-phases-and-states}
@@ -2788,23 +2888,70 @@ Animation effects {#animation-effects}
-Fill behavior {#fill-behavior}
--------------
+### Fill behavior and fill modes ### {#fill-behavior}
The effect of an [=animation effect=] when it is not [=in play=]
is determined by its fill mode.
+ The effect of each [=fill mode=] is described below:
+
+
- active duration =
- iteration duration × iteration count
-
-
- 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
@@ -3254,8 +3325,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
max(local time − start delay, 0).
@@ -3277,8 +3347,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
max(min(local time − start delay,
@@ -3296,7 +3365,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
-#### 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)
@@ -3327,7 +3396,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
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
@@ -3393,52 +3462,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.
-
-
-This section is non-normative
-
- A non-normative definition of these values is as follows:
-
- : normal
- ::
- All iterations are played as specified.
-
- : reverse
- ::
- All iterations are played in the reverse direction
- from the way they are specified.
-
- : alternate
- ::
- Even iterations are played as specified;
- odd iterations are played in the reverse direction
- from the way they are specified.
-
- : alternate-reverse
- ::
- Even iterations are played in the reverse direction
- from the way they are specified;
- odd iterations are played as specified.
-
-
-
### Calculating the directed progress ### {#calculating-the-directed-progress}
The directed progress is calculated
@@ -3453,19 +3476,21 @@ Direction control {#direction-control}
- : 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,
@@ -3482,21 +3507,6 @@ Direction control {#direction-control}
Otherwise, return
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
@@ -3518,14 +3528,13 @@ Time transformations {#time-transformations}
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.
-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=].
@@ -3747,11 +3756,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
@@ -4248,11 +4259,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,
@@ -4507,7 +4513,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=].
@@ -5191,10 +5197,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=].
@@ -5289,16 +5295,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