@@ -92,8 +92,7 @@ The syntax for specifying a [=timing function=] is as follows:
92
92
<div class="prod"> <dfn type><timing-function></dfn> =
93
93
''linear'' |
94
94
<<cubic-bezier-timing-function>> |
95
- <<step-timing-function>> |
96
- <<frames-timing-function>> </div>
95
+ <<step-timing-function>> </div>
97
96
98
97
99
98
The linear timing function: ''linear'' {#linear-timing-function-section}
@@ -227,10 +226,15 @@ Some example step timing functions are illustrated below.
227
226
</figure>
228
227
229
228
A [=step timing function=] is defined by a non-zero positive number of
230
- <dfn>steps</dfn> , and a <dfn>step position</dfn> property that may be either
231
- <a value for="steps()">start</a> or <a value for="steps()">end</a> .
232
-
233
- At the exact point where a step occurs the result of the function is
229
+ <dfn>steps</dfn> , and a <dfn>step position</dfn> property that may one of:
230
+ <a value for="steps()">jump-start</a> ,
231
+ <a value for="steps()">jump-end</a> ,
232
+ <a value for="steps()">jump-none</a> , or
233
+ <a value for="steps()">jump-both</a> , or the legacy
234
+ <a value for="steps()">start</a> or
235
+ <a value for="steps()">end</a> values.
236
+
237
+ At the exact point where a step occurs, the result of the function is
234
238
conceptually the top of the step. However, an additional <dfn>before flag</dfn>
235
239
passed as input to the [=step timing function=] , if true, will cause the
236
240
result of the function to correspond to the bottom of the step at the step
@@ -242,7 +246,12 @@ and [=before flag=] as follows:
242
246
1. Calculate the <var> current step</var> as <code> floor([=input progress
243
247
value=] × [=steps=] )</code> .
244
248
245
- 1. If the [=step position=] property is <a value for="steps()">start</a> ,
249
+ 1. If the [=step position=] property is one of:
250
+
251
+ * <a value for="steps()">jump-start</a> ,
252
+ * <a value for="steps()">start</a> , or
253
+ * <a value for="steps()">jump-both</a> ,
254
+
246
255
increment <var> current step</var> by one.
247
256
248
257
1. If <em> both</em> of the following conditions are true:
@@ -257,30 +266,43 @@ and [=before flag=] as follows:
257
266
1. If [=input progress value=] ≥ 0 and <var> current step</var> < 0,
258
267
let <var> current step</var> be zero.
259
268
269
+ 1. Calculate |jumps| based on the [=step position=] as follows:
270
+
271
+ : <a value for="steps()">jump-start</a> ,
272
+ <a value for="steps()">start</a> ,
273
+ <a value for="steps()">jump-end</a> , or
274
+ <a value for="steps()">end</a>
275
+ :: [=steps=]
276
+ : <a value for="steps()">jump-none</a>
277
+ :: [=steps=] - 1
278
+ : <a value for="steps()">jump-both</a>
279
+ :: [=steps=] + 1
280
+
260
281
1. If [=input progress value=] ≤ 1 and <var> current step</var> >
261
- [=steps=] , let <var> current step</var> be [=steps=] .
282
+ |jumps| , let <var> current step</var> be |jumps| .
262
283
263
284
<div class=note>
264
285
265
- Steps 4 and 5 in this procedure ensure that given an [=input progress
286
+ Steps 5 and 6 in this procedure ensure that given an [=input progress
266
287
value=] in the range [0, 1] , a step timing function does not produce an
267
288
[=output progress value=] outside that range.
268
289
269
290
For example, although mathematically we might expect that a step timing
270
291
function with a [=step position=] of <a value for="steps()">start</a>
271
- would step up when the [=input progress value=] is 1, intuitively, when we
272
- apply such a timing function to a forwards-filling animation, we expect
273
- it to produce an [=output progress value=] of 1 as the animation fills
274
- forwards.
292
+ would step up (i.e. beyond 1) when the [=input progress value=] is 1,
293
+ intuitively,
294
+ when we apply such a timing function to a forwards-filling animation,
295
+ we expect it to produce an [=output progress value=] of 1
296
+ as the animation fills forwards.
275
297
276
298
A similar situation arises for a step timing function with a [=step
277
299
position=] of <a value for="steps()">end</a> when applied to an animation
278
300
during its delay phase.
279
301
280
302
</div>
281
303
282
- 1. The [=output progress value=] is <code><var> current step</var>
283
- / [=steps=] </code> .
304
+ 1. The [=output progress value=] is <code><var> current step</var> /
305
+ |jumps| </code> .
284
306
285
307
<div class=example>
286
308
@@ -308,10 +330,16 @@ the result of the timing function will correspond to the top of the first step.
308
330
309
331
The syntax for specifying a step timing function is as follows:
310
332
311
- <div class="prod"> <dfn type><step-timing-function></dfn> =
333
+ <div class="prod">
334
+ <dfn type><step-position></dfn> =
335
+ ''jump-start'' | ''jump-end'' |
336
+ ''jump-none'' | ''jump-both'' |
337
+ ''start'' | ''end''
338
+
339
+ <dfn type><step-timing-function></dfn> =
312
340
''step-start'' | ''step-end'' |
313
341
<span class="atom"> <a lt="steps()" function>steps</a> (<<integer>> [,
314
- [ ''start'' | ''end'' ] ]?)</span></div>
342
+ <<step-position>> ]?)</span></div>
315
343
316
344
The meaning of each value is as follows:
317
345
@@ -321,69 +349,27 @@ The meaning of each value is as follows:
321
349
:: Equivalent to steps(1, start);
322
350
: <dfn>step-end</dfn>
323
351
:: Equivalent to steps(1, end);
324
- : <dfn function lt="steps()">steps(<integer>[, [ start | end ] ]?)</dfn>
352
+ : <dfn function lt="steps()">steps(<integer>[, <step-position> ]?)</dfn>
325
353
:: Specifies a <a>step timing function</a> .
326
- The first parameter specifies the number of intervals in the function.
327
- It must be a positive integer greater than 0.
328
- The second parameter, which is optional, is
329
- either the value <dfn value for="steps()">start</dfn> or <dfn value
330
- for="steps()"> end</dfn> , and specifies the [=step position=] .
331
- If the second parameter is omitted, it is given the value ''end'' .
332
354
333
- </dl>
334
-
335
- Frames timing functions: ''frames()'' {#frames-timing-functions}
336
- ----------------------------------------------------------------
337
-
338
- A <dfn>frames timing function</dfn> is a type of <a>timing function</a>
339
- that divides the input time into a specified number of intervals of equal
340
- length, each of which is associated with an <a>output progress value</a> of
341
- increasing value.
342
- The difference between a [=frames timing function=] and a [=step timing
343
- function=] is that a frames timing function returns the [=output progress
344
- values=] 0 and 1 for an equal portion of the [=input progress values=] in
345
- the range [0, 1] .
346
- This makes it suitable, for example, for using in animation loops where the
347
- animation should display the first and last frame of the animation for an equal
348
- amount of time as each other frame during each loop.
349
-
350
- Some example frames timing functions are illustrated below.
351
-
352
- <figure>
353
- <img src="frames-timing-func-examples.svg" width="500"
354
- alt="Example frames timing functions.">
355
- <figcaption>
356
- Example frames timing functions.
357
- In each case the domain is the input progress whilst the range
358
- represents the output progress produced by the function.
359
- </figcaption>
360
- </figure>
361
-
362
- A [=frames timing function=] is defined by an integral number of
363
- <dfn>frames</dfn> greater than one.
364
-
365
- As with [=step timing functions=] , at the exact point where a step occurs the
366
- result of the function is conceptually the top of the step.
367
-
368
- The [=output progress value=] is calculated from the [=input progress value=]
369
- as follows:
370
-
371
- 1. Calculate the <var> current frame</var> as <code> floor([=input progress
372
- value=] × [=frames=] )</code> .
373
-
374
- 1. Let the initial [=output progress value=] be <code><var> current frame</var>
375
- / ([=frames=] - 1)</code> .
355
+ The first parameter specifies the number of intervals in the function.
356
+ It must be a positive integer greater than 0
357
+ unless the second parameter is <a value for="steps()">jump-none</a>
358
+ in which case it must be a positive integer greather than 1.
376
359
377
- 1. If [=input progress value=] ≤ 1 and [=output progress value=] > 1,
378
- let [=output progress value=] be 1.
360
+ The second parameter, which is optional, specifies the [=step position=]
361
+ using one of the following values:
379
362
380
- The syntax for specifying a frames timing function is as follows:
363
+ * <dfn value for="steps()">jump-start</dfn>
364
+ * <dfn value for="steps()">jump-end</dfn>
365
+ * <dfn value for="steps()">jump-none</dfn>
366
+ * <dfn value for="steps()">jump-both</dfn>
367
+ * <dfn value for="steps()">start</dfn>
368
+ * <dfn value for="steps()">end</dfn>
381
369
382
- <div class="prod"> <dfn type><frames-timing-function></dfn> =
383
- <span class="atom"> <dfn lt="frames()" function>frames(<<integer>>)</dfn> </span></div>
370
+ If the second parameter is omitted, it is given the value ''end'' .
384
371
385
- The parameter to the function specifies the number of [=frames=] .
386
- It must be a positive integer greater than 1.
372
+ </dl>
387
373
388
374
389
375
Serialization {#serializing-a-timing-function}
@@ -401,11 +387,12 @@ defined in [[CSSOM]] with the following additional requirements:
401
387
''steps()'' function or either of the ''step-start'' or ''step-end''
402
388
keywords, are serialized as follows:
403
389
404
- 1. If the [=step position=] is ''end'' , serialize
390
+ 1. If the [=step position=] is ''jump-end'' or '' end'' , serialize
405
391
as <a lt="steps()" function>steps(<integer>)</a> .
406
392
407
393
2. Otherwise, serialize as <a lt="steps()"
408
- function>steps(<integer>, start)</a> .
394
+ function>steps(<integer>, <step-position>)</a> .
395
+
409
396
410
397
Acknowledgements {#acknowledgements}
411
398
================
0 commit comments