You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref="#interaction-between-animation-play-state-and-web-animations-API"><spanclass="secno">3.1.1</span><spanclass="content">Interaction between <spanclass="property">animation-play-state</span> and the Web Animations API</span></a>
<h4class="heading settled" data-level="3.1.1" id="interaction-between-animation-play-state-and-web-animations-API"><spanclass="secno">3.1.1. </span><spanclass="content">Interaction between <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a> and the Web Animations API</span><aclass="self-link" href="#interaction-between-animation-play-state-and-web-animations-API"></a></h4>
209
+
<p>Both this specification and the Web Animations specification <adata-link-type="biblio" href="#biblio-web-animations">[WEB-ANIMATIONS]</a> define mechanisms for pause control, specifically the <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a> property, and the <codeclass="idl"><adata-link-type="idl" href="http://www.w3.org/TR/web-animations/#dom-animation-play">play()</a></code> and <codeclass="idl"><adata-link-type="idl" href="http://www.w3.org/TR/web-animations/#dom-animation-pause">pause()</a></code> methods
210
+
respectively.</p>
211
+
<divclass="note" role="note">
212
+
<p>The interaction of these methods can be summarized as follows:</p>
213
+
<ul>
214
+
<lidata-md="">
215
+
<p>Calling <codeclass="idl"><adata-link-type="idl" href="http://www.w3.org/TR/web-animations/#dom-animation-pause">pause()</a></code> is sticky. The animation will remain paused
216
+
until there is a subsequent call to <codeclass="idl"><adata-link-type="idl" href="http://www.w3.org/TR/web-animations/#dom-animation-play">play()</a></code> after which point
217
+
the animation will begin tracking changes to the computed value of the <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a> property on the <adata-link-type="dfn" href="#owning-element">owning element</a> from the next
218
+
moment it becomes newly <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-paused">paused</a>.</p>
219
+
<lidata-md="">
220
+
<p>If the computed <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a> on the <adata-link-type="dfn" href="#owning-element">owning element</a> is <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-paused">paused</a>, calling <codeclass="idl"><adata-link-type="idl" href="http://www.w3.org/TR/web-animations/#dom-animation-play">play()</a></code> will temporarily override the <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a> until it next becomes <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-running">running</a>.</p>
221
+
</ul>
222
+
</div>
223
+
<p>With regards to the pausing, an animation can be considered to be in one of
224
+
five mutually-exclusive states:</p>
225
+
<ulstyle="list-style-type: upper-latin">
226
+
<li>Running
227
+
<li>Running and temporarily overriding <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a>: <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-paused">paused</a>
228
+
<li>Paused and sticky overriding <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a>: <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-running">running</a>
229
+
<li>Paused and sticky overriding <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a>: <aclass="css" data-link-type="maybe" href="https://drafts.csswg.org/css-animations-1/#valdef-animation-play-state-paused">paused</a>
230
+
<li>Paused by <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a>
<p>If any change causes an animation to change from one of the running states (A,
277
+
B) to one of the paused states (C, D, E) the user agent must run the <adata-link-type="dfn" href="https://w3c.github.io/web-animations/#pause-an-animation">pause
278
+
an animation</a> procedure on the animation.</p>
279
+
<p>Likewise, for any change from one of the the paused states to one of the
280
+
running states, the user agent must run the <adata-link-type="dfn" href="https://w3c.github.io/web-animations/#play-an-animation">play an animation</a> procedure
281
+
on the animation. If the change is due to a change in the computed value of <aclass="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-animations-1/#propdef-animation-play-state">animation-play-state</a> (i.e. the transition E → A) the <var>auto-rewind</var> flag for that procedure must be set to false; otherwise
<h3class="no-num heading settled" id="index-defined-here"><spanclass="content">Terms defined by this specification</span><aclass="self-link" href="#index-defined-here"></a></h3>
287
388
<ulclass="indexlist">
288
-
<li><ahref="#dom-animationevent-animationcancel">animationcancel</a><span>, in §3.1</span>
389
+
<li><ahref="#dom-animationevent-animationcancel">animationcancel</a><span>, in §4.1</span>
289
390
<li><ahref="#owning-element">owning element</a><span>, in §2.1</span>
290
391
</ul>
291
392
<h3class="no-num heading settled" id="index-defined-elsewhere"><spanclass="content">Terms defined by reference</span><aclass="self-link" href="#index-defined-elsewhere"></a></h3>
<dd>S. Bradner. <ahref="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <ahref="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
0 commit comments