@@ -136,7 +136,7 @@ an [=input progress value=] and produces an [=output progress value=].
136
136
An [=easing function=] must be a pure function meaning that for a given set of
137
137
inputs, it always produces the same [=output progress value=] .
138
138
139
- The <dfn>input progress value</dfn> is a real number in the range [-∞,
139
+ The <dfn export for="easing function" >input progress value</dfn> is a real number in the range [-∞,
140
140
∞].
141
141
Typically, the [=input progress value=] is in the range [0, 1] but this may
142
142
not be the case when [=easing functions=] are chained together.
@@ -154,7 +154,7 @@ may be outside the range [0, 1].
154
154
155
155
</div>
156
156
157
- The <dfn>output progress value</dfn> is a real number in the
157
+ The <dfn export for="easing function" >output progress value</dfn> is a real number in the
158
158
range [-∞, ∞] .
159
159
160
160
Note: While CSS numbers have a theoretically infinite range
@@ -164,18 +164,18 @@ If easing functions are used outside of the CSS context,
164
164
care must be taken to either correctly handle potential infinities,
165
165
or clamp the [=output progress value=] .
166
166
167
- Some types of easing functions also take an additional boolean <dfn export for="easing function">before flag</dfn> ,
168
- which is defined subsequently.
167
+ Some types of easing functions
168
+ also take an additional boolean <dfn export for="easing function">before flag</dfn> ,
169
+ which indicates the easing has not yet started,
170
+ or is going in reverse and is past the finish.
169
171
170
- This specification defines four types of easing functions whose definitions
171
- follow.
172
+ This specification defines several types of easing functions:
172
173
173
- The syntax for specifying an [=easing function=] is as follows:
174
-
175
- <div class="prod"> <dfn type><easing-function></dfn> =
176
- <<linear-easing-function>> |
177
- <<cubic-bezier-easing-function>> |
178
- <<step-easing-function>> </div>
174
+ <pre class="prod">
175
+ <dfn><easing-function></dfn> = <<linear-easing-function>>
176
+ | <<cubic-bezier-easing-function>>
177
+ | <<step-easing-function>>
178
+ </pre>
179
179
180
180
<wpt>
181
181
timing-functions-syntax-computed.html
@@ -349,15 +349,16 @@ Output</h4>
349
349
return the [=output progress value=]
350
350
of that item.
351
351
352
- 3. If at least one of |points| has an [=input progress value=]
353
- matching |inputProgress|:
352
+ 3. If |inputProgress| matches the [=input progress value=]
353
+ of the first point in |points|,
354
+ and the [=before flag=] is true,
355
+ return the first point's [=output progress value=] .
354
356
355
- * If the [=before flag=] is true,
356
- return the [=output progress value=] of the first such point.
357
- * Otherwise,
358
- return the [=output progress value=] of the last such point.
357
+ 4. If |inputProgress| matches the [=input progress value=]
358
+ of at least one point in |points|,
359
+ return the [=output progress value=] of the last such point.
359
360
360
- 4 . Otherwise, find two [=linear()/control points=] ,
361
+ 5 . Otherwise, find two [=linear()/control points=] in |points| ,
361
362
|A| and |B|,
362
363
which will be used for interpolation:
363
364
@@ -378,7 +379,7 @@ Output</h4>
378
379
and let |B| be the first [=linear()/control point=]
379
380
whose [=input progress value=] is larger than |inputProgress|.
380
381
381
- 5 . Linearly interpolate (or extrapolate) |inputProgress|
382
+ 6 . Linearly interpolate (or extrapolate) |inputProgress|
382
383
along the line defined by |A| and |B|,
383
384
and return the result.
384
385
</div>
@@ -830,32 +831,28 @@ Output</h4>
830
831
perform the following.
831
832
It returns an [=output progress value=] .
832
833
833
- 1. Let |steps| be |func|'s [=steps()/steps=] ,
834
+ 1. If the [=before flag=] is true, return 0.
835
+
836
+ 2. Let |steps| be |func|'s [=steps()/steps=] ,
834
837
and |position| be |func|'s [=steps()/step position=] .
835
838
836
- 2 . Divide the interval [-∞, ∞] into several segments,
839
+ 3 . Divide the interval [-∞, ∞] into several segments,
837
840
each with an associated value,
838
841
as follows:
839
842
840
843
1. [-∞, 0] has the value 0.
841
- 2. [ 1, ∞] has the value 1.
844
+ 2. ( 1, ∞] has the value 1.
842
845
3. [0, 1] is divided into |steps| intervals,
846
+ [0, ...) to [..., 1)
843
847
with their values assigned as defined for the |position|
844
848
(see <<step-position>> ).
845
849
846
- Note: All intervals are inclusive,
847
- so some values are part of two intervals at once.
848
-
849
- 3. If |inputProgress| is in a single interval,
850
- return the associated value for that interval.
851
-
852
- 4. Otherwise, |inputProgress| is in two intervals,
853
- with two associated values
854
- (which might be the same).
850
+ Note: In other words,
851
+ at the boundary between intervals,
852
+ the associated value is the higher value.
855
853
856
- If the [=before flag=] is true,
857
- return the smaller associated value;
858
- otherwise, return the larger associated value.
854
+ 4. Return the associated value
855
+ for the interval that |inputProgress| is in.
859
856
</div>
860
857
861
858
<div class=example>
0 commit comments