From d18add1ecbec9f4fb0c7105d66cdc14a33c08e94 Mon Sep 17 00:00:00 2001
From: Steve Block Procedure for evenly distributing keyframes
A procedure for evenly distributing keyframes with unspecified
positional offsets is provided below.
- Given a list of keyframes whose positional offets are - either a real number in the range [0, 1] or unspecified, - we define such as list as loosely sorted by offset if, for - each keyframe in the list that has a specified offset, the - offset is greater than or equal to the offset of the previous - keyframe in the list with a specified offset, if any. -
Given a list of keyframes, initial keyframe list, - that is loosely sorted by offset we can evenly distribute the - keyframes with unspecified positional offsets between - those frames with specified offsets using the following procedure: + we can evenly distribute the keyframes with unspecified positional offsets + between those frames with specified offsets using the following + procedure:
KeyframeAnimationEffect interface- As a result of the normalization of the list, if frames - is not loosely sorted by offset this effect will not - contribute to the final composited value. -
- +<@@ -7988,8 +7979,6 @@
getFrames.
- 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.
++ We allow keyframe offsets outside [0, 1] so we + should allow timing function offsets outside that + range too for consistency. +
+
- The positional offset of a keyframe is a value in the range
- [0, 1].
+ The positional offset of a keyframe is the point in the
+ time fraction space of the timed item to which this
+ keyframe animation effect belongs at which the property values
+ apply.
The list of keyframes for a keyframe animation effect is
sorted in ascending order by the positional offset of each
@@ -3993,13 +3999,6 @@ Keyframe animation effects
Rather, this is achieved by setting a chain of timing functions
on the timed item (proposal for this is still in the works).
- If, due to a timing function specified on the timed - item from which the time fraction is derived, the time - fraction lies outside the range [0, 1], the specified - keyframe property values are extrapolated to cover the extended - range. -
The behavior when keyframes overlap or have unsupported values
is defined in The unaccumulated animation value of a keyframe animation effect
target property.
+
+
@@ -4088,22 +4099,29 @@
The unaccumulated animation value of a keyframe animation effect
underlying value + value to
add.
- Note that this procedure permits overlapping keyframes. - The behavior is that at the point of overlap the output value jumps to - the value of last defined keyframe at that offset. - For overlapping frames at 0 or 1, the output value for time fractions less than 0 or greater than - or equal to 1 is the value of the first keyframe or the last - keyframe in keyframes respectively. + Note that this procedure permits overlapping keyframes. The + behavior is that at the point of overlap the output value jumps to + the value of last defined keyframe at that offset. For + overlapping frames at the start or end of the list of + keyframes, all but the last and first keyframe + respectively in each overlapping group are ignored.
-- In the presence of certain timing functions, the input time - fraction to an animation effect is not limited to the range [0, 1]. - Currently, however, keyframe offsets are limited to the range - [0, 1] and property values are simply extrapolated for input time - fractions outside this range. We are considering removing this - restriction for the following reasons. -
-- We are considering removing the restriction since cases exist where - it is useful to be able to specify non-linear changes in property - values at time fractions outside the range [0, 1]. -
-- While this effect could be achieved by careful modification of the - timing function, this approach is complex and breaks the model's - separation of timing concerns from animation effects. An example is - an animation which is subject to an 'overshoot' timing function and - which has an effect that sweeps through a non-linear color space. -
-- See section - 4 (Keyframe offsets outside [0, 1]) of minuted discussion from Tokyo - 2013 F2F. -
-Whilst the Web Animations model assumes a sorted list of keyframes with specified positional offsets in the - range [0, 1] many users of the model require a facility for - automatically distributing keyframes when positional offsets are not - provided. + title="positional offset of a keyframe">positional offsets, many + users of the model require a facility for automatically distributing + keyframes when positional offsets are not provided. A procedure for evenly distributing keyframes with unspecified positional offsets is provided below.
@@ -7963,11 +7950,6 @@KeyframeAnimationEffect interfaceBefore passing the list of Keyframes specified in the API to the @@ -7979,16 +7961,6 @@
getFrames.
- Keyframe dictionary
The positional
- offset of the keyframe specified as a number between
- 0.0 and 1.0 inclusive or null.
-
- Keyframes with offsets outside the range [0.0, 1.0] are - ignored when calculating animation values as defined in - . + offset
null.
A null value indicates that the keyframe