Skip to content
This repository was archived by the owner on Jun 7, 2018. It is now read-only.

Commit 1c3415f

Browse files
committed
Fix updates to play state definition.
See issue #196. Commit 9e2053f updated the definition of the play state but it failed to check for pending tasks. As a result, when we are play-pending, we'd report 'paused' since we don't have a resolved start time. I've gone through all the possible states and revised this based on the following chart. Hopefully it's right this time. +---------+-------+------+-------+--------------------------------------+ | Current | Start | Play | Pause | State / Notes | | time | time | task | task | | +---------+-------+------+-------+--------------------------------------+ | o | o | o | o | 'idle' | +---------+-------+------+-------+--------------------------------------+ | o | o | o | x | [1] Normally pausing sets the hold | | | | | | time (current time) but if the | | | | | | timeline is cleared while pending | | | | | | this could happen. | | | | | | We should report 'paused' because | | | | | | we won't be ready until we have a | | | | | | current time to use and at that | | | | | | point we will end up being in the | | | | | | regular paused state: resolved | | | | | | current time, unresolved start time. | +---------+-------+------+-------+--------------------------------------+ | o | o | x | o | [2] Not expected to happen because | | | | | | we don't expect to play without | | | | | | either a start time or hold time | | | | | | (unless we had an aborted pause and | | | | | | the timelineline was cleared?). | | | | | | If this were to happen then | | | | | | presumably we believe we can run the | | | | | | pending play task (or else we would | | | | | | have canceled it) so we should | | | | | | 'running' or 'finished'. | +---------+-------+------+-------+--------------------------------------+ | o | o | x | x | [3] Cannot have two pending tasks at | | | | | | once. | +---------+-------+------+-------+--------------------------------------+ | o | x | o | o | 'idle' | +---------+-------+------+-------+--------------------------------------+ | o | x | o | x | As with [1], 'paused'. | +---------+-------+------+-------+--------------------------------------+ | o | x | x | o | As with [2], 'running' / 'finished'. | +---------+-------+------+-------+--------------------------------------+ | o | x | x | x | As with [3], n/a. | +---------+-------+------+-------+--------------------------------------+ | x | o | o | o | 'paused' | +---------+-------+------+-------+--------------------------------------+ | x | o | o | x | 'paused' | +---------+-------+------+-------+--------------------------------------+ | x | o | x | o | 'running' / 'finished' | +---------+-------+------+-------+--------------------------------------+ | x | o | x | x | As with [3], n/a. | +---------+-------+------+-------+--------------------------------------+ | x | x | o | o | 'running' / 'finished' | +---------+-------+------+-------+--------------------------------------+ | x | x | o | x | 'paused' | +---------+-------+------+-------+--------------------------------------+ | x | x | x | o | 'running' / 'finished' | +---------+-------+------+-------+--------------------------------------+ | x | x | x | x | As with [3], n/a. | +---------+-------+------+-------+--------------------------------------+
1 parent d1a89a8 commit 1c3415f

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

Overview.bs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,8 @@ non-normative description is also provided:
17111711
<div class=informative-bg>
17121712

17131713
: <a lt="idle play state">idle</a>
1714-
:: The <a>current time</a> of the animation is <a>unresolved</a>.
1714+
:: The <a>current time</a> of the animation is <a>unresolved</a> and
1715+
there are no pending tasks.
17151716
In this state the animation has no effect.
17161717
: <a lt="running play state">running</a>
17171718
:: The animation has a resolved <a>current time</a> that changes on each
@@ -1731,17 +1732,24 @@ condition from the following:
17311732

17321733
<div class="switch">
17331734

1734-
: The <a>current time</a> of <var>animation</var> is
1735-
<a>unresolved</a>,
1735+
: <em>All</em> of the following conditions are true:
1736+
* The <a>current time</a> of <var>animation</var> is <a>unresolved</a>,
1737+
<em>and</em>
1738+
* <var>animation</var> does <em>not</em> have <em>either</em>
1739+
a <a>pending play task</a> <em>or</em> a <a>pending pause task</a>,
17361740
:: &rarr; <dfn lt="idle play state">idle</dfn>
1737-
: The <a lt="animation start time">start time</a> of <var>animation</var> is
1738-
<a>unresolved</a>,
1741+
: <em>Either</em> of the following conditions are true:
1742+
* <var>animation</var> has a <a>pending pause task</a>, <em>or</em>
1743+
* <em>both</em> the <a lt="animation start time">start time</a> of
1744+
<var>animation</var> is <a>unresolved</a> <em>and</em> it does
1745+
<em>not</em> have a <a>pending play task</a>,
17391746
:: &rarr; <dfn lt="paused play state">paused</dfn>
1740-
: For <var>animation</var>,
1741-
<a>animation playback rate</a> &gt; 0 and
1742-
<a>current time</a> &ge; <a>target effect end</a>; or<br>
1743-
<a>animation playback rate</a> &lt; 0 and
1744-
<a>current time</a> &le; 0,
1747+
: For <var>animation</var>, <a>current time</a> is <a>resolved</a> and
1748+
<em>either</em> of the following conditions are true:
1749+
* <a>animation playback rate</a> &gt; 0 and
1750+
<a>current time</a> &ge; <a>target effect end</a>; <em>or</em>
1751+
* <a>animation playback rate</a> &lt; 0 and
1752+
<a>current time</a> &le; 0,
17451753
:: &rarr; <dfn lt="finished play state">finished</dfn>
17461754
: Otherwise,
17471755
:: &rarr; <dfn lt="running play state">running</dfn>

0 commit comments

Comments
 (0)