Skip to content

Commit eceae64

Browse files
author
Sylvain Galineau
committed
[css-animations] Define 0s duration behavior in animation-duration; 0s duration causes instantaneous execution, even if iteration count is infinite
1 parent 81ad633 commit eceae64

File tree

2 files changed

+28
-35
lines changed

2 files changed

+28
-35
lines changed

css-animations/Overview.bs

+13-15
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,15 @@ The 'animation-duration' property</h3>
431431
If the <<time>> is ''0s'', like the initial value,
432432
the keyframes of the animation have no effect,
433433
but the animation itself still occurs instantaneously.
434-
That is, 'animation-fill-mode' applies as normal,
435-
filling backwards or forwards as appropriate;
436-
start and end events are fired.
434+
Specifically, start and end events are fired; if
435+
'animation-fill-mode' is set to ''backwards'' or
436+
''both'', the first frame of the animation, as defined by
437+
'animation-direction', will be displayed during the
438+
'animation-delay'. Then the last frame of the animation,
439+
as defined by 'animation-direction', will be displayed if
440+
'animation-fill-mode' is set to ''forwards'' or ''both''.
441+
If 'animation-fill-mode' is set to ''animation-fill-mode/none''
442+
then the animation has no visible effect.
437443
</dl>
438444

439445
<h3 id="animation-timing-function">
@@ -498,7 +504,7 @@ The 'animation-iteration-count' property</h3>
498504
<dl dfn-type=value dfn-for=animation-iteration-count>
499505
<dt><dfn>infinite</dfn>
500506
<dd>
501-
The animation will repeat forever.
507+
The animation will repeat forever.
502508

503509
<dt><dfn><<number>></dfn>
504510
<dd>
@@ -509,19 +515,11 @@ The 'animation-iteration-count' property</h3>
509515

510516
<p>A value of ''0'' is valid and, similar to an 'animation-duration'
511517
of ''0s'', causes the animation to occur instantaneously.
512-
Specifically, if 'animation-fill-mode' is set to ''backwards'' or
513-
''both'', the first frame of the animation, as defined by
514-
'animation-direction', will be displayed during the
515-
'animation-delay'. Then the last frame of the animation,
516-
as defined by 'animation-direction', will be displayed if
517-
'animation-fill-mode' is set to ''forwards'' or ''both''.
518-
If 'animation-fill-mode' is set to ''animation-fill-mode/none''
519-
then the animation has no effect.
520-
521-
<p class="issue">If similar to animation-duration:0s, also relates to whether
522-
animation events fire?
523518
</dl>
524519

520+
If the animation has a duration of ''0s'', it will occur instantaneously for any
521+
valid value of 'animation-iteration-count', including ''infinite''.
522+
525523

526524
<h3 id="animation-direction">
527525
The 'animation-direction' property</h3>

css-animations/Overview.html

+15-20
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
162162
<li><a href=#normative><span class=secno></span> Normative References</a>
163163
<li><a href=#informative><span class=secno></span> Informative References</a></ul>
164164
<li><a href=#index><span class=secno></span> Index</a>
165-
<li><a href=#property-index><span class=secno></span> Property index</a>
166-
<li><a href=#issues-index><span class=secno></span>Issues Index</a></ul></div>
165+
<li><a href=#property-index><span class=secno></span> Property index</a></ul></div>
167166

168167

169168

@@ -539,9 +538,15 @@ <h3 class="heading settled heading" data-level=4.3 id=animation-duration><span c
539538
<p> If the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#time-value title="<time>">&lt;time&gt;</a> is <span class=css data-link-type=maybe title=0s>0s</span>, like the initial value,
540539
the keyframes of the animation have no effect,
541540
but the animation itself still occurs instantaneously.
542-
That is, <a class=property data-link-type=propdesc href=#propdef-animation-fill-mode title=animation-fill-mode>animation-fill-mode</a> applies as normal,
543-
filling backwards or forwards as appropriate;
544-
start and end events are fired.
541+
Specifically, start and end events are fired; if
542+
<a class=property data-link-type=propdesc href=#propdef-animation-fill-mode title=animation-fill-mode>animation-fill-mode</a> is set to <a class=css data-link-type=maybe href=#valuedef-backwards title=backwards>backwards</a> or
543+
<a class=css data-link-type=maybe href=#valuedef-both title=both>both</a>, the first frame of the animation, as defined by
544+
<a class=property data-link-type=propdesc href=#propdef-animation-direction title=animation-direction>animation-direction</a>, will be displayed during the
545+
<a class=property data-link-type=propdesc href=#propdef-animation-delay title=animation-delay>animation-delay</a>. Then the last frame of the animation,
546+
as defined by <a class=property data-link-type=propdesc href=#propdef-animation-direction title=animation-direction>animation-direction</a>, will be displayed if
547+
<a class=property data-link-type=propdesc href=#propdef-animation-fill-mode title=animation-fill-mode>animation-fill-mode</a> is set to <a class=css data-link-type=maybe href=#valuedef-forwards title=forwards>forwards</a> or <a class=css data-link-type=maybe href=#valuedef-both title=both>both</a>.
548+
If <a class=property data-link-type=propdesc href=#propdef-animation-fill-mode title=animation-fill-mode>animation-fill-mode</a> is set to <a class=css data-link-for=animation-fill-mode data-link-type=maybe href=#valuedef-none title=none>none</a>
549+
then the animation has no visible effect.
545550
</dl>
546551

547552
<h3 class="heading settled heading" data-level=4.4 id=animation-timing-function><span class=secno>4.4 </span><span class=content>
@@ -582,7 +587,7 @@ <h3 class="heading settled heading" data-level=4.5 id=animation-iteration-count>
582587
<dl data-dfn-for=animation-iteration-count data-dfn-type=value>
583588
<dt><dfn class=css-code data-dfn-for=animation-iteration-count data-dfn-type=value data-export="" id=valuedef-infinite>infinite<a class=self-link href=#valuedef-infinite></a></dfn>
584589
<dd>
585-
The animation will repeat forever.
590+
The animation will repeat forever.
586591

587592
<dt><dfn class=css-code data-dfn-for=animation-iteration-count data-dfn-type=value data-export="" id=valuedef-number><a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#number-value title="<number>">&lt;number&gt;</a><a class=self-link href=#valuedef-number></a></dfn>
588593
<dd>
@@ -593,19 +598,11 @@ <h3 class="heading settled heading" data-level=4.5 id=animation-iteration-count>
593598

594599
<p>A value of <span class=css data-link-type=maybe title=0>0</span> is valid and, similar to an <a class=property data-link-type=propdesc href=#propdef-animation-duration title=animation-duration>animation-duration</a>
595600
of <span class=css data-link-type=maybe title=0s>0s</span>, causes the animation to occur instantaneously.
596-
Specifically, if <a class=property data-link-type=propdesc href=#propdef-animation-fill-mode title=animation-fill-mode>animation-fill-mode</a> is set to <a class=css data-link-type=maybe href=#valuedef-backwards title=backwards>backwards</a> or
597-
<a class=css data-link-type=maybe href=#valuedef-both title=both>both</a>, the first frame of the animation, as defined by
598-
<a class=property data-link-type=propdesc href=#propdef-animation-direction title=animation-direction>animation-direction</a>, will be displayed during the
599-
<a class=property data-link-type=propdesc href=#propdef-animation-delay title=animation-delay>animation-delay</a>. Then the last frame of the animation,
600-
as defined by <a class=property data-link-type=propdesc href=#propdef-animation-direction title=animation-direction>animation-direction</a>, will be displayed if
601-
<a class=property data-link-type=propdesc href=#propdef-animation-fill-mode title=animation-fill-mode>animation-fill-mode</a> is set to <a class=css data-link-type=maybe href=#valuedef-forwards title=forwards>forwards</a> or <a class=css data-link-type=maybe href=#valuedef-both title=both>both</a>.
602-
If <a class=property data-link-type=propdesc href=#propdef-animation-fill-mode title=animation-fill-mode>animation-fill-mode</a> is set to <a class=css data-link-for=animation-fill-mode data-link-type=maybe href=#valuedef-none title=none>none</a>
603-
then the animation has no effect.
604-
605-
<p class=issue id=issue-ef1c522a><a class=self-link href=#issue-ef1c522a></a>If similar to animation-duration:0s, also relates to whether
606-
animation events fire?
607601
</dl>
608602

603+
<p> If the animation has a duration of <span class=css data-link-type=maybe title=0s>0s</span>, it will occur instantaneously for any
604+
valid value of <a class=property data-link-type=propdesc href=#propdef-animation-iteration-count title=animation-iteration-count>animation-iteration-count</a>, including <a class=css data-link-type=maybe href=#valuedef-infinite title=infinite>infinite</a>.
605+
609606

610607
<h3 class="heading settled heading" data-level=4.6 id=animation-direction><span class=secno>4.6 </span><span class=content>
611608
The <a class=property data-link-type=propdesc href=#propdef-animation-direction title=animation-direction>animation-direction</a> property</span><a class=self-link href=#animation-direction></a></h3>
@@ -1339,6 +1336,4 @@ <h2 class="no-num no-ref heading settled heading" id=property-index><span class=
13391336
<tr><th scope=row><a data-property="">animation</a><td>&lt;single-animation&gt;#<td>see individual properties<td>all elements, ::before and ::after pseudo-elements<td>no<td>N/A<td>interactive<td>no<td>per grammar<td>As specified</table></div>
13401337

13411338

1342-
</ul><h2 class="no-num heading settled" id=issues-index><span class=content>Issues Index</span><a class=self-link href=#issues-index></a></h2><div style="counter-reset: issue"><div class=issue>If similar to animation-duration:0s, also relates to whether
1343-
animation events fire?
1344-
<a href=#issue-ef1c522a></a></div></div>
1339+
</ul>

0 commit comments

Comments
 (0)