Skip to content

Commit 3a1cd84

Browse files
committed
[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.)
1 parent 4dc129b commit 3a1cd84

1 file changed

Lines changed: 77 additions & 78 deletions

File tree

web-animations-1/Overview.bs

Lines changed: 77 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,13 @@ Animation effects {#animation-effects}
24802480
which cause the [=animation effect=] to apply its behavior
24812481
by driving its [=local time|local time value=]
24822482

2483+
### Types of animation effects ### {#types-of-animation-effects}
2484+
2485+
This specification defines a single type of [=animation effect=]:
2486+
[=keyframe effects=].
2487+
Subsequent levels of this specification
2488+
will define further types of [=animation effects=].
2489+
24832490
### Associated animation and timeline ### {#animation-effects-and-animations}
24842491

24852492
An [=animation effect=] is
@@ -2495,12 +2502,77 @@ Animation effects {#animation-effects}
24952502
if |effect| is [=associated with an animation=] which, in turn,
24962503
is associated with |timeline|.
24972504

2498-
### Types of animation effects ### {#types-of-animation-effects}
2505+
### Local time ### {#local-time-section}
24992506

2500-
This specification defines a single type of [=animation effect=]:
2501-
[=keyframe effects=].
2502-
Subsequent levels of this specification
2503-
will define further types of [=animation effects=].
2507+
The <dfn>local time</dfn> of an [=animation effect=] at a given moment
2508+
is based on the first matching condition from the following:
2509+
2510+
<div class=switch>
2511+
2512+
: If the [=animation effect=] is [=associated with an animation=],
2513+
::
2514+
the [=local time=] is the [=animation/current time=] of the [=animation=].
2515+
2516+
: Otherwise,
2517+
::
2518+
the [=local time=] is [=unresolved=].
2519+
2520+
</div>
2521+
2522+
### Time Spaces ### {#iteration-time-space}
2523+
2524+
<div class=informative-bg>
2525+
<em>This section is non-normative</em>
2526+
2527+
In Web Animations all times are relative to some point of reference.
2528+
These different points of reference produce different <em>time spaces</em>.
2529+
2530+
This can be compared to coordinate spaces
2531+
as used in computer graphics.
2532+
The zero time of a time space is analogous
2533+
to the origin of a coordinate space.
2534+
2535+
We can describe animations that repeat
2536+
as establishing a new time space
2537+
each time the animation repeats:
2538+
the <em>iteration time space</em>.
2539+
2540+
<em>Iteration time space</em> is a time space
2541+
whose zero time is the beginning
2542+
of an animation effect's current iteration.
2543+
2544+
Within the Web Animations model we also refer to [=active time=],
2545+
which is a time relative to the beginning of the active interval.
2546+
This time space, however, is internal to the model
2547+
and not exposed in the programming interface or in markup.
2548+
2549+
These time spaces are illustrated below.
2550+
2551+
<figure>
2552+
<img src="images/time-spaces.svg" width="600"
2553+
alt="A comparison of local time, active time, and iteration time.">
2554+
<figcaption>
2555+
A comparison of [=local time=], [=active time=], and iteration time
2556+
for an animation with an [=iteration duration=] of 1s
2557+
and an [=iteration count=] of 2.5.
2558+
</figcaption>
2559+
</figure>
2560+
2561+
Note: While the time spaces themselves are not bounded,
2562+
Web Animations defines [=active time=] and the [=iteration progress=]
2563+
such that they are clamped to a set range as shown in the diagram.
2564+
For example, whilst a time of -1 second
2565+
is a valid time in <em>active time space</em>,
2566+
the procedure for calculating the [=active time=]
2567+
defined in [[#calculating-the-active-time]]
2568+
will never return a negative value.
2569+
2570+
In addition to these time spaces
2571+
we can also refer to the <em>document time space</em>,
2572+
which is time space of the [=time values=]
2573+
of the [=default document timeline=] of the {{Document}}
2574+
of the [=current global object=].
2575+
</div>
25042576

25052577
### The active interval, duration, and delays ### {#the-active-interval}
25062578

@@ -2563,24 +2635,6 @@ Animation effects {#animation-effects}
25632635
the <a href="https://www.w3.org/TR/SVG/animate.html#MinAttribute"><code>min</code></a>
25642636
attribute in SVG ([[SVG11]], Chapter 19).
25652637

2566-
2567-
### Local time ### {#local-time-section}
2568-
2569-
The <dfn>local time</dfn> of an [=animation effect=] at a given moment
2570-
is based on the first matching condition from the following:
2571-
2572-
<div class=switch>
2573-
2574-
: If the [=animation effect=] is [=associated with an animation=],
2575-
::
2576-
the [=local time=] is the [=animation/current time=] of the [=animation=].
2577-
2578-
: Otherwise,
2579-
::
2580-
the [=local time=] is [=unresolved=].
2581-
2582-
</div>
2583-
25842638
### Animation effect phases and states ### {#animation-effect-phases-and-states}
25852639

25862640
<div class=informative-bg>
@@ -3032,61 +3086,6 @@ Repeating {#repeating}
30323086

30333087
</div>
30343088

3035-
### Iteration time space ### {#iteration-time-space}
3036-
3037-
<div class=informative-bg>
3038-
<em>This section is non-normative</em>
3039-
3040-
In Web Animations all times are relative to some point of reference.
3041-
These different points of reference produce different <em>time spaces</em>.
3042-
3043-
This can be compared to coordinate spaces
3044-
as used in computer graphics.
3045-
The zero time of a time space is analogous
3046-
to the origin of a coordinate space.
3047-
3048-
We can describe animations that repeat
3049-
as establishing a new time space
3050-
each time the animation repeats:
3051-
the <em>iteration time space</em>.
3052-
3053-
<em>Iteration time space</em> is a time space
3054-
whose zero time is the beginning
3055-
of an animation effect's current iteration.
3056-
3057-
Within the Web Animations model we also refer to [=active time=],
3058-
which is a time relative to the beginning of the active interval.
3059-
This time space, however, is internal to the model
3060-
and not exposed in the programming interface or in markup.
3061-
3062-
These time spaces are illustrated below.
3063-
3064-
<figure>
3065-
<img src="images/time-spaces.svg" width="600"
3066-
alt="A comparison of local time, active time, and iteration time.">
3067-
<figcaption>
3068-
A comparison of [=local time=], [=active time=], and iteration time
3069-
for an animation with an [=iteration duration=] of 1s
3070-
and an [=iteration count=] of 2.5.
3071-
</figcaption>
3072-
</figure>
3073-
3074-
Note: While the time spaces themselves are not bounded,
3075-
Web Animations defines [=active time=] and the [=iteration progress=]
3076-
such that they are clamped to a set range as shown in the diagram.
3077-
For example, whilst a time of -1 second
3078-
is a valid time in <em>active time space</em>,
3079-
the procedure for calculating the [=active time=]
3080-
defined in [[#calculating-the-active-time]]
3081-
will never return a negative value.
3082-
3083-
In addition to these time spaces
3084-
we can also refer to the <em>document time space</em>,
3085-
which is time space of the [=time values=]
3086-
of the [=default document timeline=] of the {{Document}}
3087-
of the [=current global object=].
3088-
</div>
3089-
30903089
### Interval timing ### {#interval-timing}
30913090

30923091
<div class=informative-bg>

0 commit comments

Comments
 (0)