@@ -86,7 +86,7 @@ range [-∞, ∞].
8686Some types of timing function also take an additional boolean [=before flag=]
8787input which is defined subsequently.
8888
89- This specification defines three types of timing functions whose definitions
89+ This specification defines four types of timing functions whose definitions
9090follow.
9191
9292
@@ -203,7 +203,7 @@ Step timing functions {#step-timing-functions}
203203
204204A <dfn>step timing function</dfn> is a type of <a>timing function</a>
205205that divides the input time into a specified number of intervals that
206- are equal in duration .
206+ are equal in length .
207207
208208Some example step timing functions are illustrated below.
209209
@@ -301,6 +301,69 @@ The meaning of each value is as follows:
301301
302302</dl>
303303
304+ Frames timing functions {#frames-timing-functions}
305+ -----------------------
306+
307+ A <dfn>frames timing function</dfn> is a type of <a>timing function</a>
308+ that divides the input time into a specified number of intervals of equal
309+ length, each of which is associated with an <a>output progress value</a> of
310+ increasing value.
311+ The difference between a [=frames timing function=] and a [=step timing
312+ function=] is that a frames timing function returns the [=output progress
313+ values=] 0 and 1 for an equal portion of the [=input progress values=] in
314+ the range [0, 1] .
315+ This makes it suitable, for example, for using in animation loops where the
316+ animation should display the first and last frame of the animation for an equal
317+ amount of time as each other frame during each loop.
318+
319+ Some example frames timing functions are illustrated below.
320+
321+ <figure>
322+ <img src="frames-timing-func-examples.svg" width="500"
323+ alt="Example frames timing functions.">
324+ <figcaption>
325+ Example frames timing functions.
326+ In each case the domain is the input progress whilst the range
327+ represents the output progress produced by the function.
328+ </figcaption>
329+ </figure>
330+
331+ A [=frames timing function=] is defined by an integral number of
332+ <dfn>frames</dfn> greater than one.
333+
334+ As with [=step timing functions=] , at the exact point where a step occurs the
335+ result of the function is conceptually the top of the step.
336+ An additional <dfn>after flag</dfn> passed as input to the [=step timing
337+ function=] , if true, will cause the result of the function to correspond to
338+ the bottom of the step at the step point.
339+
340+ The [=output progress value=] is calculated from the [=input progress value=]
341+ and [=after flag=] as follows:
342+
343+ 1. Calculate the <var> current frame</var> as <code> floor([=input progress
344+ value=] × [=frames=] )</code> .
345+
346+ 1. If <em> both</em> of the following conditions are true:
347+
348+ * the [=after flag=] is set, <em> and</em>
349+ * [=input progress value=] × [=frames=] mod 1 equals zero
350+ (that is, if [=input progress value=] × [=frames=] is
351+ integral), then
352+
353+ decrement <var> current frame</var> by one.
354+
355+ 1. The [=output progress value=] is <code><var> current frame</var>
356+ / ([=frames=] - 1)</code> .
357+
358+ The syntax for specifying a frames timing function is as follows:
359+
360+ <div class="prod"> <dfn type><frames-timing-function></dfn> =
361+ <span class="atom"> <dfn lt="frames()" function>frames(<<integer>>)</dfn> </span></div>
362+
363+ The parameter to the function specifies the number of [=frames=] .
364+ It must be a positive integer greater than 1.
365+
366+
304367The <single-timing-function> production {#single-timing-function-production}
305368=============================================
306369
@@ -309,7 +372,8 @@ The syntax for specifying a [=timing function=] is as follows:
309372<div class="prod"> <dfn type><single-timing-function></dfn> =
310373 ''linear'' |
311374 <<cubic-bezier-timing-function>> |
312- <<step-timing-function>> </div>
375+ <<step-timing-function>> |
376+ <<frames-timing-function>> </div>
313377
314378Serialization {#serializing-a-timing-function}
315379-------------
0 commit comments