From 6b7830a6772f0b0501cbbd0070430d9f89ffb2c2 Mon Sep 17 00:00:00 2001 From: fantasai Date: Thu, 15 Jun 2023 18:42:36 -0400 Subject: [PATCH 1/9] [web-animations-1] De-dup dfn of associated animation --- web-animations-1/Overview.bs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 7512553e1aa..5ce4c13e884 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2466,14 +2466,13 @@ Animation effects {#animation-effects} that provides a static description of some timed behavior. ### Relationship between animation effects and animations ### {#animation-effects-and-animations} - - 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. +

+ 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 Date: Thu, 15 Jun 2023 18:44:42 -0400 Subject: [PATCH 2/9] [web-animations-1] Describe the high-level model up front This makes it easier to understand what this object is and to contextualize all the definitions that follow. --- web-animations-1/Overview.bs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 5ce4c13e884..fa4350e219a 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2465,8 +2465,23 @@ 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=] + +### 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}

From 850479b658096722ae0cdbe7a14fb47bb164c020 Mon Sep 17 00:00:00 2001 From: fantasai Date: Fri, 16 Jun 2023 16:16:53 -0400 Subject: [PATCH 3/9] [web-animations-1] De-dup and integrate Active Interval section --- web-animations-1/Overview.bs | 106 ++++++++++++++++------------------- 1 file changed, 47 insertions(+), 59 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index fa4350e219a..39788cc0ec1 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2502,79 +2502,67 @@ Animation effects {#animation-effects} Subsequent levels of this specification will define further types of [=animation effects=]. -### The active interval ### {#the-active-interval} +### The active interval, duration, and delays ### {#the-active-interval} -
- - The period that an [=animation effect=] is scheduled to run - is called its [=active interval=]. - Each [=animation effect=] has only one such interval. - - The lower bound of the [=active interval=] typically corresponds - to the [=start time=] of - the [=animation=] associated with this [=animation effect=], - but can be shifted by a [=start delay=] on the [=animation effect=]. - - The upper bound of the interval is determined - by the [=active duration=]. - - The relationship between - the [=start time=], [=start delay=], and [=active duration=] - is illustrated below. - -
- Examples of the effect of the start dela
-             on the endpoints of the active interval -
- Examples of the effect of the [=start delay=] - on the endpoints of 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. -
-
- - An [=end delay=] can also be specified - but is primarily only of use when sequencing animations. - -
- - [=Animation effects=] define an active interval + [=Animation effects=] define an active interval, which is the period of time during which the effect - is scheduled to produce its effect-- - with the exception of [=fill modes=], - which apply outside the [=active interval=]. + is scheduled to produce its effect + (excepting [=fill modes=], + which apply outside the [=active interval=]). + Each [=animation effect=] has only one such interval. The lower bound of the [=active interval=] - is defined by the [=start delay=]. - - 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. + by default corresponds to the [=start time=] of the [=associated animation=], + but can be shifted by the start delay, + which is a signed offset from the [=start time=] of the [=animation=]. - The length of the [=active interval=] is called the [=active duration=], + The length of the [=active interval=] is called the active duration, the calculation of which is defined in [[#calculating-the-active-duration]]. + Its length determines the upper bound of the [=active interval=]. + +
+ + The relationship between + the [=start time=], [=start delay=], and [=active duration=] + is illustrated below. + +
+ Examples of the effect of the start dela
+               on the endpoints of the active interval +
+ Examples of the effect of the [=start delay=] + on the endpoints of 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. +
+
+
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 + + The end time, + of an [=animation effect=] + is the result of evaluating + 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=] = iteration duration × iteration count
From cbdae49d9260aeb3100acba9d6894a3c64aa5ede Mon Sep 17 00:00:00 2001 From: fantasai Date: Sat, 17 Jun 2023 14:07:45 -0400 Subject: [PATCH 4/9] [web-animations-1] DFN the fill modes --- web-animations-1/Overview.bs | 148 ++++++++++++++++------------------- 1 file changed, 68 insertions(+), 80 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 39788cc0ec1..ac0035a3f4f 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2786,23 +2786,71 @@ 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: + +
+ : 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. + +
+ Examples of various fill modes and the states produced. +
+ Examples of various fill modes and the states produced.
+ (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. +
+
+ Note: Authors are discouraged from using [=fill modes=] to produce animations whose effect is applied indefinitely. @@ -2870,65 +2918,7 @@ Fill behavior {#fill-behavior} -### Fill modes ### {#fill-modes} - -
-This section is non-normative - - The effect of each [=fill mode=] is as follows: - - : 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. - - : 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=]. - - For all other times that the animation effect is not [=in play=], - it will have no effect. - - : both - :: - When the animation effect is in its [=animation effect/before phase=], - backwards fill behavior is used. - - When the animation effect is in its [=animation effect/after phase=], - forwards fill behavior is used. - - Some examples of the these fill modes are illustrated below. - -
- Examples of various fill modes and the states produced. -
- Examples of various fill modes and the states produced.
- (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. -
-
- - Note: Setting a fill mode has no bearing on + Note: Setting a [=fill mode=] has no bearing on the endpoints of the [=active interval=] or the boundaries between [[#animation-effect-phases-and-states|phases]] However, the fill mode does have an effect @@ -2938,8 +2928,6 @@ Fill behavior {#fill-behavior} inside the [=animation effect/active phase=] or when a fill is applied. -
- Repeating {#repeating} --------- @@ -3252,8 +3240,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
: If the [=fill mode=] is - backwards or - both, + [=fill mode/backwards=] or [=fill mode/both=], :: Return the result of evaluating max(local timestart delay, 0). @@ -3275,8 +3262,7 @@ Core animation effect calculations {#core-animation-effect-calculations}
: If the [=fill mode=] is - forwards or - both, + [=fill mode/forwards=] or [=fill mode/backwards=], :: Return the result of evaluating max(min(local timestart 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 Date: Sun, 18 Jun 2023 23:59:36 -0400 Subject: [PATCH 5/9] [web-animations-1][editorial] Move time-related sections up This improves the flow of the story we're telling about what an animation effect is and how it works. (See next commit for tweaks on the text; this only moves it.) --- web-animations-1/Overview.bs | 155 +++++++++++++++++------------------ 1 file changed, 77 insertions(+), 78 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index ac0035a3f4f..e1a71c2f97a 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2480,6 +2480,13 @@ Animation effects {#animation-effects} which cause the [=animation effect=] to apply its behavior by driving its [=local time|local time value=] +### 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 @@ -2495,12 +2502,77 @@ 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=] at a given moment + is based on the first matching condition from the following: + +
+ + : If the [=animation effect=] is [=associated with an animation=], + :: + the [=local time=] is the [=animation/current time=] of the [=animation=]. + + : Otherwise, + :: + the [=local time=] is [=unresolved=]. + +
+ +### Time Spaces ### {#iteration-time-space} + +
+This section is non-normative + + In Web Animations all times are relative to some point of reference. + These different points of reference produce different time spaces. + + This can be compared to coordinate spaces + as used in computer graphics. + The zero time of a time space is analogous + to the origin of a coordinate space. + + We can describe animations that repeat + as establishing a new time space + each time the animation repeats: + the iteration time space. + + Iteration time space is a time space + whose zero time is the beginning + of an animation effect's current iteration. + + Within the Web Animations model we also refer to [=active time=], + which is a time relative to the beginning of the active interval. + This time space, however, is internal to the model + and not exposed in the programming interface or in markup. + + These time spaces are illustrated below. + +
+ A comparison of local time, active time, and iteration time. +
+ A comparison of [=local time=], [=active time=], and iteration time + for an animation with an [=iteration duration=] of 1s + and an [=iteration count=] of 2.5. +
+
+ + Note: While the time spaces themselves are not bounded, + Web Animations defines [=active time=] and the [=iteration progress=] + such that they are clamped to a set range as shown in the diagram. + For example, whilst a time of -1 second + is a valid time in active time space, + the procedure for calculating the [=active time=] + defined in [[#calculating-the-active-time]] + will never return a negative value. + + In addition to these time spaces + we can also refer to the document time space, + which is time space of the [=time values=] + of the [=default document timeline=] of the {{Document}} + of the [=current global object=]. +
### The active interval, duration, and delays ### {#the-active-interval} @@ -2563,24 +2635,6 @@ Animation effects {#animation-effects} the 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: - -
- - : If the [=animation effect=] is [=associated with an animation=], - :: - the [=local time=] is the [=animation/current time=] of the [=animation=]. - - : Otherwise, - :: - the [=local time=] is [=unresolved=]. - -
- ### Animation effect phases and states ### {#animation-effect-phases-and-states}
@@ -3032,61 +3086,6 @@ Repeating {#repeating}
-### Iteration time space ### {#iteration-time-space} - -
-This section is non-normative - - In Web Animations all times are relative to some point of reference. - These different points of reference produce different time spaces. - - This can be compared to coordinate spaces - as used in computer graphics. - The zero time of a time space is analogous - to the origin of a coordinate space. - - We can describe animations that repeat - as establishing a new time space - each time the animation repeats: - the iteration time space. - - Iteration time space is a time space - whose zero time is the beginning - of an animation effect's current iteration. - - Within the Web Animations model we also refer to [=active time=], - which is a time relative to the beginning of the active interval. - This time space, however, is internal to the model - and not exposed in the programming interface or in markup. - - These time spaces are illustrated below. - -
- A comparison of local time, active time, and iteration time. -
- A comparison of [=local time=], [=active time=], and iteration time - for an animation with an [=iteration duration=] of 1s - and an [=iteration count=] of 2.5. -
-
- - Note: While the time spaces themselves are not bounded, - Web Animations defines [=active time=] and the [=iteration progress=] - such that they are clamped to a set range as shown in the diagram. - For example, whilst a time of -1 second - is a valid time in active time space, - the procedure for calculating the [=active time=] - defined in [[#calculating-the-active-time]] - will never return a negative value. - - In addition to these time spaces - we can also refer to the document time space, - which is time space of the [=time values=] - of the [=default document timeline=] of the {{Document}} - of the [=current global object=]. -
- ### Interval timing ### {#interval-timing}
From f272afcaabca1940a50fcf993f78f9b606f6337d Mon Sep 17 00:00:00 2001 From: fantasai Date: Mon, 19 Jun 2023 00:56:04 -0400 Subject: [PATCH 6/9] [web-animations-1] Strengthen DFNs for time spaces * give local time a proper DFN * tweak Time Spaces to fit as an overview for more than just the iteration section * use proper dfn markup for the various terms defined in the Time Spaces overview --- web-animations-1/Overview.bs | 76 ++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index e1a71c2f97a..b51030c4dac 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2504,8 +2504,12 @@ Animation effects {#animation-effects} ### 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: + 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:
@@ -2519,45 +2523,75 @@ Animation effects {#animation-effects}
-### Time Spaces ### {#iteration-time-space} +### Time spaces ### {#effect-time-spaces}
This section is non-normative In Web Animations all times are relative to some point of reference. - These different points of reference produce different time spaces. + These different points of reference produce different time spaces. This can be compared to coordinate spaces as used in computer graphics. - The zero time of a time space is analogous + The zero time of a [=time space=] is analogous to the origin of a coordinate space. - We can describe animations that repeat - as establishing a new time space - each time the animation repeats: - the iteration time space. - - Iteration time space is a time space - whose zero time is the beginning - of an animation effect's current iteration. + Within the [=Web Animations model=] + we define progress of an [=animation effect=] on the basis of its [=active time=], + which is a time relative to the beginning of its [=active interval=]-- + thus a time in the [=active time space=]. - Within the Web Animations model we also refer to [=active time=], - which is a time relative to the beginning of the active interval. - This time space, however, is internal to the model + Note: This time space is internal to the model and not exposed in the programming interface or in markup. + We can further describe animations that repeat + as establishing a new [=time space=] + each time the animation repeats: + the [=iteration time space=]. + + The [=animation effect=] thus translates the [=animation/current time=] + provided by the [=associated animation=] + through a series of [=time spaces=]: + * the local time space, + relative to the [=start time=] of the [=associated animation=], + yielding the [=local time=] + * the active time space, + relative to the start of the [=active interval=], + yielding the [=active time=] + * the iteration time space, + relative to the start of the [=animation effect=]’s current iteration, + yielding the iteration time + These time spaces are illustrated below.
A comparison of local time, active time, and iteration time. + 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.">
- A comparison of [=local time=], [=active time=], and iteration time + A comparison of [=local time=], [=active time=], and [=iteration time=] for an animation with an [=iteration duration=] of 1s and an [=iteration count=] of 2.5. + The [=animation/start time=] defined by the [=animation=] + and [=animation effect/end time=] defined by the [=animation effect=] + are also annotated.
+ In addition to these time spaces + we can also refer to the document time space, + which is time space of the [=time values=] + of the [=default document timeline=] of the {{Document}} + of the [=current global object=]. + Note: While the time spaces themselves are not bounded, Web Animations defines [=active time=] and the [=iteration progress=] such that they are clamped to a set range as shown in the diagram. @@ -2566,12 +2600,6 @@ Animation effects {#animation-effects} the procedure for calculating the [=active time=] defined in [[#calculating-the-active-time]] will never return a negative value. - - In addition to these time spaces - we can also refer to the document time space, - which is time space of the [=time values=] - of the [=default document timeline=] of the {{Document}} - of the [=current global object=].
### The active interval, duration, and delays ### {#the-active-interval} From 42d4e451e26fba4952bdb46a2e6b88e8dceac3db Mon Sep 17 00:00:00 2001 From: fantasai Date: Mon, 19 Jun 2023 01:10:34 -0400 Subject: [PATCH 7/9] [web-animations-1][editorial] Restructure Sections: Animation Effect vs Progress Calculations This restructuring sorts various subsections into: * properties of an animation effect -> filed as direct subsections of Animation Effect * transformation of the input time into output progress -> filed as direct subsections of Calculating Progress This way the first section builds up the model of what an Animation Effect *is*, and the second section defines the flow of time through various transformations into an output progress value. (See next commit for integration edits; this only moves text.) --- web-animations-1/Overview.bs | 186 +++++++++++++++++------------------ 1 file changed, 88 insertions(+), 98 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index b51030c4dac..4cca4b9672d 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2868,8 +2868,7 @@ Animation effects {#animation-effects}
-Fill behavior and fill modes {#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. @@ -3010,10 +3009,9 @@ Fill behavior and fill modes {#fill-behavior} inside the [=animation effect/active phase=] or when a fill is applied. -Repeating {#repeating} ---------- +### Repeating ### {#repeating} -### Iteration intervals ### {#iteration-intervals} +#### Iteration intervals #### {#iteration-intervals} It is possible to specify that an animation effect should repeat a fixed number of times or indefinitely. @@ -3063,7 +3061,7 @@ Repeating {#repeating} -### Controlling iteration ### {#controlling-iteration} +#### Controlling iteration #### {#controlling-iteration} The number of times an [=animation effect=] repeats is called its iteration count. @@ -3114,7 +3112,7 @@ Repeating {#repeating} -### Interval timing ### {#interval-timing} +#### Interval timing #### {#interval-timing}
This section is non-normative @@ -3167,8 +3165,83 @@ Repeating {#repeating}
-Core animation effect calculations {#core-animation-effect-calculations} ----------------------------------- +#### Calculating the active duration #### {#calculating-the-active-duration} + + The [=active duration=] is calculated as follows: + +
+ [=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. + +### 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. + +
+ +### 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 progress {#core-animation-effect-calculations} +-------------------- ### Overview ### {#animation-effect-calculations-overview} @@ -3227,32 +3300,11 @@ Core animation effect calculations {#core-animation-effect-calculations} The first step, calculating the [=local time=] is described in [[#local-time-section]]. - Steps 2 to 4 in the diagram are described in the following sections. - Steps 5 and 6 are described in [[#calculating-the-directed-progress]] - and [[#calculating-the-transformed-progress]] respectively. + Steps 2 to 6 in the diagram are described in the following sections. - -### Calculating the active duration ### {#calculating-the-active-duration} - - The [=active duration=] is calculated as follows: - -
- [=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 @@ -3307,7 +3359,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) @@ -3338,7 +3390,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 @@ -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. - -
-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 @@ -3493,21 +3499,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 @@ -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 Date: Mon, 19 Jun 2023 01:41:37 -0400 Subject: [PATCH 8/9] [web-animations-1][editorial] Improve DFNs for direction control and timing function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Integrate normative and non-normative text of “direction control” and give each playback direction value a proper definition. * DFN a term for the effect-wide easing function, and clarify its effect. * DFN “keyframe-specific timing function” for parallelism and easier referencing. --- web-animations-1/Overview.bs | 67 ++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 4cca4b9672d..c70799064b2 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -3190,56 +3190,61 @@ Animation effects {#animation-effects} 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 + : normal :: All iterations are played as specified. - : reverse + : reverse :: All iterations are played in the reverse direction from the way they are specified. - : alternate + : alternate :: Even iterations are played as specified; odd iterations are played in the reverse direction from the way they are specified. - : alternate-reverse + : alternate-reverse :: Even iterations are played in the reverse direction from the way they are specified; odd iterations are played as specified. -
+
+ + 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 Date: Fri, 18 Aug 2023 12:37:38 -0400 Subject: [PATCH 9/9] [web-animations-1] Inline active duration calculation into definition. https://github.com/w3c/csswg-drafts/pull/8985#discussion_r1296611414 --- web-animations-1/Overview.bs | 61 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index c70799064b2..375b5929327 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -2602,23 +2602,15 @@ Animation effects {#animation-effects} will never return a negative value. -### The active interval, duration, and delays ### {#the-active-interval} +### The active interval ### {#the-active-interval} [=Animation effects=] define an active interval, which is the period of time during which the effect is scheduled to produce its effect (excepting [=fill modes=], which apply outside the [=active interval=]). - Each [=animation effect=] has only one such interval. - - The lower bound of the [=active interval=] - by default corresponds to the [=start time=] of the [=associated animation=], - but can be shifted by the start delay, - which is a signed offset from the [=start time=] of the [=animation=]. - - The length of the [=active interval=] is called the active duration, - the calculation of which is defined in [[#calculating-the-active-duration]]. - Its length determines the upper bound of the [=active interval=]. + Each [=animation effect=] has only one such interval, + which is defined by its [=start delay=] and [=active duration=].
@@ -2646,6 +2638,34 @@ Animation effects {#animation-effects}
+#### The start delay #### {#the-start-delay} + + The lower bound of the [=active interval=] + by default corresponds to the [=start time=] of the [=associated animation=], + but can be shifted by the start delay, + which is a signed offset from the [=start time=] of the [=animation=]. + +#### The active duration #### {#the-active-duration} + + The length of the [=active interval=] is called the active duration, + and is determined by the [=iteration duration=] and [=iteration count=] + as defined below. + Its length determines the upper bound of the [=active interval=]. + +
+ [=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. + +#### 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: - -
- [=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. - ### 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=])