Skip to content

Commit

Permalink
[css-animations-2] Add 'auto' as initial value of 'animation-duration'.
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Mar 11, 2023
1 parent 26a6269 commit 2a7cc4b
Showing 1 changed file with 52 additions and 4 deletions.
56 changes: 52 additions & 4 deletions css-animations-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,56 @@ requirement to iterate in reverse.
## The 'animation-duration' property ## {#animation-duration}
The 'animation-duration' property specifies the [=iteration duration=]
of the animation's associated [=animation effect=].
<pre class='propdef'>
Name: animation-duration
Value: [ auto | <<time [0s,∞]>> ]#
Initial: auto
Applies to: all elements
Inherited: no
Percentages: N/A
Computed value: list, each item either a time or the keyword ''animation-duration/auto''
Animation type: not animatable
Canonical order: per grammar
</pre>
The 'animation-duration' property specifies the [=iteration duration=]
of the animation's associated [=animation effect=].
<dl dfn-for=animation-duration dfn-type=value>
<dt><dfn>auto</dfn>
<dd>
For time-driven animations,
equivalent to ''0s''.

This comment has been minimized.

Copy link
@flackr

flackr Mar 29, 2023

Contributor

While this [is the case in web-animations-1](In this level of this specification, the string value auto is treated as the value zero), web-animations-2 specifies that duration auto uses the intrinsic iteration duration which already defines how we get the range length (though needs to be updated to account for rangeStart and rangeEnd), and also defines an intrinsic iteration duration for group and sequence effects.

TLDR; I don't think we should redefine how auto works here, it should just say it sets the iteration duration to auto, possibly with a pointer to the calculations linked above.

For [=scroll-driven animations=],
equivalent to the duration necessary to fill the timeline
in consideration of 'animation-range', 'animation-delay', and 'animation-iteration-count'.
See [[scroll-animations-1#finite-attachment]].
<dt><dfn><<time [0s,∞]>></dfn>
<dd>
For time-driven animations,
specifies the length of time that an animation takes to complete one cycle.
A negative <<time>> is invalid.
If the <<time>> is ''0s'', like the initial value,
the keyframes of the animation have no effect,
but the animation itself still occurs instantaneously.
Specifically, start and end events are fired;
if 'animation-fill-mode' is set to ''backwards'' or ''both'',
the first frame of the animation,
as defined by 'animation-direction',
will be displayed during the 'animation-delay'.
After the 'animation-delay' the last frame of the animation,
as defined by 'animation-direction',
will be displayed if 'animation-fill-mode' is set to ''forwards'' or ''both''.
If 'animation-fill-mode' is set to ''animation-fill-mode/none''
the animation will have no visible effect.
For [=scroll-driven animations=],
treated as ''animation-duration/auto''.
</dl>
## The 'animation-timing-function' property ## {#animation-timing-function}
Expand Down Expand Up @@ -575,7 +623,7 @@ the following effects:
: <dfn><<view()>></dfn>
:: Use the [=view progress timeline=] indicated by the given ''view()'' function.
See [[scroll-animations-1#view-notation]].
</dl>
</dl>
Issue: Make it easier to use 'animation-name' to select the timeline when
Expand Down Expand Up @@ -851,4 +899,4 @@ console.log(anim.playState); // Should be 'running'.
<li>
Requirements on pending style changes are described.
</li>
</ul>
</ul>

0 comments on commit 2a7cc4b

Please sign in to comment.