From d43538b1300a090f3fa4eaf7bb3969ca68f454ed Mon Sep 17 00:00:00 2001
From: Steve Block Normalizing a timing function position list
to allow timing function offsets outside that range too
for consistency.
+ We could consider relaxing the constraint that the + first and last values are zero and 1, and simply + require that all values are in the range [0, 1]. We + would then prepend and append linear timing + functions as required. +
++ This makes more sense if or when we allow timing + functions to cover input times outside the range [0, + 1]. Assuming that this applied to timing function + chains, the first and last values in the position + list would no longer be restricted to 0 and 1. +
++ It is also possible to control the extent of each link in output + time independently of its length in input time. In particular, + while the start input time must be less than the end input time, + this constraint does not apply to the start and end output + times. This provides greater control and allows complex timing + function chains to be constructed from the primitive timing + functions definded in this spec. +
++ For example, in the following example, the ease-in-out timing + function occupies three-quarters of the input time range and + extends to an output time of 1.5. The ease-in timing function + which follows it therefore occupies the remaining quarter of the + input time and runs from 1.5 to 1.0 in output time. +
+ + The length of each link in input time can be controlled + independently of its extent in output time. +
The mapping of the input range of a timing function chain's @@ -2802,13 +2827,18 @@
+ Each pair in the list specifies the input and output time of the
+ transition point between two adjacent links in a timing
+ function chain.
@@ -2824,7 +2854,9 @@
@@ -2841,10 +2873,11 @@ The procedure when spacing mode is
“align” depends on the timed item to which
@@ -2856,11 +2889,13 @@
- The normalized timing function position list is a list
- of numbers corresponding to the keyframe offsets
- of the keyframe animation effect's list of
- keyframes.
+ The normalized timing function position list is a
+ list of pairs, with length equal to the number of
+ keyframes in the keyframe animation effect.
+ Within each pair, the two values are equal to each other and
+ equal to the
+ keyframe offsets
+ of the corresponding keyframe.
Note that this refers to the keyframe offset values
@@ -2876,10 +2911,11 @@
The normalized timing function position list is a list
- of numbers where each value is the result of traversing the
- path elements in the path animation effect in
- order and calculating the ratio of the path length at the end
- of the path element and the total path length.
+ of pairs, with length equal to the number of
+ path elements in the path animation effect.
+ Within each pair, the two values are equal to each other and
+ equal to the ratio of the path length at the end of the
+ corresponding path element and the total path length.
Path elements that correspond to moveto elements
@@ -2898,35 +2934,38 @@ Normalizing a timing function position list
Normalizing a timing function position list
Normalizing a timing function position list
n
- × 1 ÷ (length - 1).
+ indices beginning at zero, is equal to (n
+ × 1 ÷ (length - 1), n
+ × 1 ÷ (length - 1)).
Normalizing a timing function position list
animation effect,
Normalizing a timing function position list
Normalizing a timing function position list
provided is as follows:
- An implication of the above two conditions is that no - values outside the range [0, 1] are allowed. - If we allow keyframe offsets outside [0, 1] we will need - to allow timing function offsets outside that range too - for consistency. + An implication of the above two conditions is that all + input times must be in the range [0, 1]. If we allow + keyframe offsets outside [0, 1] we will need to allow + timing function offsets outside that range too for + consistency.
We could consider relaxing the constraint that the - first and last values are zero and 1, and simply - require that all values are in the range [0, 1]. We - would then prepend and append linear timing - functions as required. + first and last values are (0, 0) and (1, 1), and + simply require that all input values are in the + range [0, 1]. We would then prepend and append + linear timing functions as required.
This makes more sense if or when we allow timing functions to cover input times outside the range [0, 1]. Assuming that this applied to timing function chains, the first and last values in the position - list would no longer be restricted to 0 and 1. + list would no longer be restricted to input times of + 0 and 1.
- Note that even applying the above procedures, the normalized - timing function position list may not be suitable since it - may not be of the required length (as defined in timing function position list may not be + suitable since it may not be of the required length (as defined + in ). Any difference in lengths is accommodated for by adjusting the @@ -3021,21 +3061,23 @@
start index
- + 1.
+ Let xend be the first value in the pair in
+ timing function position list at start
+ index + 1.
ylocal
= f(xlocal)
+ start
+ index + 1.
xstart + ylocal
- × (xend
- - xstart).
+ ystart + ylocal
+ × (yend
+ - ystart).
PlaybackDirection enumerationEasingTimesInput typedefFor simplicity, throughout this specification EasingTimesInput is used to represent either a list of - values corresponding to a timing function position list or + values or points corresponding to a timing function position list or a SpacingMode from which a timing function position list may be synthesized according to the procedure in .
-
- If we later extend easing times to allow controlling the output
- ranges (i.e. a y value as well), we could achieve
- that by making the type (SpacingMode or
- sequence<double> or sequence<DOMPoint>) or
- something of that sort.
-
- That would be backwards-compatible but would make it hard to
- write code that falls back gracefully.
- An alternative would be to simply add
- getEasingPoints etc.
-
+ Note that to avoid ambiguity when using smoothed with a + step timing function, we define the gradient of a step + timing function to be zero at input values of zero and 1. +
A step timing function may be specified as a string using the following syntax: @@ -3106,6 +3111,43 @@
+ Individual cubic Bézier timing functions within a timing + function chain may be marked as smoothed. + This means that an attempt is made to modify the cubic Bézier curve + to ensure that it is C1-continuous with the previous timing + function in the timing function chain. +
++ Cubic Bézier curves are defined by anchor points and control points. + The first anchor point and control point define a vector which is + tangential to the Bézier at the first anchor point. +
++ When a cubic Bézier curve is smoothed, the first control + point is adjusted such that the vector defined by the first anchor + point and this control point remains unchanged in length, but + changes in direction to match the positive tangent of the curve + defined by the previous timing function in the timing + function chain at local time fraction 1. +
++ If the cubic Bézier curve in question is the first timing + function in a timing function chain, then the first + control point is adjusted such that the vector defined by the first + anchor point and this control point has a gradient of zero. +
++ The above procedure for smoothing is only effective if the first + control point of the cubic Bézier curve is not (0, 0). +
++ If smoothed is applied to any other type of timing + function, it is ignored. +
+@@ -4600,7 +4642,7 @@
The length of a path element is determined, where possible, via - closed-form solutions. For some path elements (e.g. beziers) a + closed-form solutions. For some path elements (e.g. Béziers) a closed-form solution is not generally possible, and approximations should be used.