Skip to content

Commit c87b393

Browse files
committed
Fix the definition of 'animation-fill-mode' as described in http://lists.w3.org/Archives/Public/www-style/2012Jun/0447.html .
1. account for 'reverse' and 'alternate-reverse' animation directions 2. account for the possibility that 'animation-iteration-count' is not an integer
1 parent 4406796 commit c87b393

2 files changed

Lines changed: 48 additions & 23 deletions

File tree

css3-animations/Overview.html

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,23 +1127,38 @@ <h3 id=animation-fill-mode-property><span class=secno>3.9. </span> The
11271127
<p> If the value for ‘<a href="#animation-fill-mode"><code
11281128
class=property>animation-fill-mode</code></a>’ is ‘<code
11291129
class=css>backwards</code>’, then the animation will apply the property
1130-
values defined in its 0% or ‘<code class=property>from</code>
1131-
keyframe as soon as the animation is applied, during the period defined by
1132-
<code class=property>animation-delay</code>’.
1130+
values defined in the keyframe that will start the first iteration of the
1131+
animation, during the period defined by ‘<code
1132+
class=property>animation-delay</code>’. These are either the values of
1133+
the ‘<code class=css>from</code>’ keyframe (when ‘<a
1134+
href="#animation-direction"><code
1135+
class=property>animation-direction</code></a>’ is ‘<a
1136+
href="#normal"><code class=css>normal</code></a>’ or ‘<a
1137+
href="#alternate"><code class=css>alternate</code></a>’) or those of the
1138+
<code class=css>to</code>’ keyframe (when ‘<a
1139+
href="#animation-direction"><code
1140+
class=property>animation-direction</code></a>’ is ‘<a
1141+
href="#reverse"><code class=css>reverse</code></a>’ or ‘<a
1142+
href="#alternate-reverse"><code
1143+
class=css>alternate-reverse</code></a>’).
11331144

11341145
<p> If the value for ‘<a href="#animation-fill-mode"><code
11351146
class=property>animation-fill-mode</code></a>’ is ‘<code
1136-
class=css>forwards</code>’, then the animation will apply the property
1137-
values defined in its last executing keyframe after the final iteration of
1138-
the animation, until the animation style is removed. The last executing
1139-
keyframe is the ‘<code class=property>to</code>’ or ‘<code
1140-
class=css>100%</code>’ keyframe, unless the animation has ‘<a
1141-
href="#animation-direction"><code
1142-
class=property>animation-direction</code></a>’ set to ‘<a
1143-
href="#alternate"><code class=css>alternate</code></a>’ and both a
1144-
finite and even iteration count, in which case it is the ‘<code
1145-
class=property>from</code>’ or ‘<code class=css>0%</code>’ keyframe.
1146-
1147+
class=css>forwards</code>’, then after the animation ends (as determined
1148+
by its ‘<a href="#animation-iteration-count"><code
1149+
class=property>animation-iteration-count</code></a>’), the animation
1150+
will apply the property values for the time the animation ended. When
1151+
<a href="#animation-iteration-count"><code
1152+
class=property>animation-iteration-count</code></a>’ is an integer
1153+
greater than zero, the values applied will be those for the end of the
1154+
last completed iteration of the animation (rather than the values for the
1155+
start of the iteration that would be next). When ‘<a
1156+
href="#animation-iteration-count"><code
1157+
class=property>animation-iteration-count</code></a>’ is zero, the values
1158+
applied will be those that would start the first iteration (just as when
1159+
<a href="#animation-fill-mode"><code
1160+
class=property>animation-fill-mode</code></a>’ is ‘<code
1161+
class=css>backwards</code>’).
11471162

11481163
<p> If the value for ‘<a href="#animation-fill-mode"><code
11491164
class=property>animation-fill-mode</code></a>’ is ‘<code

css3-animations/Overview.src.html

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -827,19 +827,29 @@ <h3 id="animation-fill-mode-property">
827827

828828
<p>
829829
If the value for 'animation-fill-mode' is ''backwards'',
830-
then the animation will apply the property values defined in its 0% or 'from' keyframe
831-
as soon as the animation is applied,
830+
then the animation will apply
831+
the property values defined in the keyframe
832+
that will start the first iteration of the animation,
832833
during the period defined by 'animation-delay'.
834+
These are either the values of the ''from'' keyframe
835+
(when 'animation-direction' is ''normal'' or ''alternate'')
836+
or those of the ''to'' keyframe
837+
(when 'animation-direction' is ''reverse'' or ''alternate-reverse'').
833838

834839
<p>
835840
If the value for 'animation-fill-mode' is ''forwards'',
836-
then the animation will apply the property values defined in its last executing keyframe
837-
after the final iteration of the animation,
838-
until the animation style is removed.
839-
The last executing keyframe is the 'to' or '100%' keyframe,
840-
unless the animation has 'animation-direction' set to ''alternate''
841-
and both a finite and even iteration count,
842-
in which case it is the 'from' or '0%' keyframe.
841+
then after the animation ends
842+
(as determined by its 'animation-iteration-count'),
843+
the animation will apply
844+
the property values for the time the animation ended.
845+
When 'animation-iteration-count' is an integer greater than zero,
846+
the values applied will be
847+
those for the end of the last completed iteration of the animation
848+
(rather than the values for
849+
the start of the iteration that would be next).
850+
When 'animation-iteration-count' is zero,
851+
the values applied will be those that would start the first iteration
852+
(just as when 'animation-fill-mode' is ''backwards'').
843853

844854
<p>
845855
If the value for 'animation-fill-mode' is ''both'',

0 commit comments

Comments
 (0)