[html5] r6517 - [giow] (0) Make browsers fire events for all cues, even when they're overloaded, [...]
whatwg at whatwg.org
whatwg at whatwg.org
Mon Aug 22 15:14:40 PDT 2011
Author: ianh
Date: 2011-08-22 15:14:34 -0700 (Mon, 22 Aug 2011)
New Revision: 6517
Modified:
complete.html
index
source
Log:
[giow] (0) Make browsers fire events for all cues, even when they're overloaded, rather that skipping events on skipped cues.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=13622
Modified: complete.html
===================================================================
--- complete.html 2011-08-19 19:51:20 UTC (rev 6516)
+++ complete.html 2011-08-22 22:14:34 UTC (rev 6517)
@@ -239,7 +239,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 19 August 2011</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 22 August 2011</h2>
</hgroup><dl><dt>Multiple-page version:</dt>
<dd><a href=http://www.whatwg.org/specs/web-apps/current-work/complete/>http://www.whatwg.org/specs/web-apps/current-work/complete/</a></dd>
<dt>One-page version:</dt>
@@ -29091,26 +29091,36 @@
agent rushes ahead to "catch up".)
</p>
- <ol><li><p>Let <var title="">current cues</var> be an ordered list of
- <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain
- all the <a href=#text-track-cue title="text track cue">cues</a> of all the <a href=#text-track-hidden title="text track hidden">hidden</a>, <a href=#text-track-showing title="text track
+ <ol><li><p>Let <var title="">current cues</var> be a list of <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain all the
+ <a href=#text-track-cue title="text track cue">cues</a> of all the <a href=#text-track-hidden title="text track hidden">hidden</a>, <a href=#text-track-showing title="text track
showing">showing</a>, or <a href=#text-track-showing-by-default title="text track showing by
default">showing by default</a> <a href=#text-track title="text track">text
tracks</a> of the <a href=#media-element>media element</a> (not the <a href=#text-track-disabled title="text track disabled">disabled</a> ones) whose <a href=#text-track-cue-start-time title="text track cue start time">start times</a> are less than
or equal to the <a href=#current-playback-position>current playback position</a> and whose
<a href=#text-track-cue-end-time title="text track cue end time">end times</a> are greater
- than the <a href=#current-playback-position>current playback position</a>, in <a href=#text-track-cue-order>text
- track cue order</a>.</li>
+ than the <a href=#current-playback-position>current playback position</a>.</li>
- <li><p>Let <var title="">other cues</var> be an ordered list of
- <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain
- all the <a href=#text-track-cue title="text track cue">cues</a> of <a href=#text-track-hidden title="text track hidden">hidden</a>, <a href=#text-track-showing title="text track
+ <li><p>Let <var title="">other cues</var> be a list of <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain all the
+ <a href=#text-track-cue title="text track cue">cues</a> of <a href=#text-track-hidden title="text track
+ hidden">hidden</a>, <a href=#text-track-showing title="text track
showing">showing</a>, and <a href=#text-track-showing-by-default title="text track showing by
default">showing by default</a> <a href=#text-track title="text track">text
tracks</a> of the <a href=#media-element>media element</a> that are not
- present in <var title="">current cues</var>, also in <a href=#text-track-cue-order>text
- track cue order</a>.</li>
+ present in <var title="">current cues</var>.</li>
+ <li><p>Let <var title="">last time</var> be the <a href=#current-playback-position>current
+ playback position</a> at the time this algorithm was last run
+ for this <a href=#media-element>media element</a>, if this is not the first time
+ it has run.</li>
+
+ <li><p>If the <a href=#current-playback-position>current playback position</a> has, since the
+ last time this algorithm was run, only changed through its usual
+ monotonic increase during normal playback, then let <var title="">missed cues</var> be the list of <a href=#text-track-cue title="text track
+ cue">cues</a> in <var title="">other cues</var> whose <a href=#text-track-cue-start-time title="text track cue start time">start times</a> are greater
+ than or equal to <var title="">last time</var> and whose <a href=#text-track-cue-end-time title="text track cue end time">end times</a> are less than or
+ equal to the <a href=#current-playback-position>current playback position</a>. Otherwise, let
+ <var title="">missed cues</var> be an empty list.</li>
+
<li><p>If the time was reached through the usual monotonic increase
of the <a href=#current-playback-position>current playback position</a> during normal
playback, and if the user agent has not fired a <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> event at the
@@ -29131,54 +29141,110 @@
<li><p>If all of the <a href=#text-track-cue title="text track cue">cues</a> in
<var title="">current cues</var> have their <a href=#text-track-cue-active-flag>text track cue
- active flag</a> set, and none of the <a href=#text-track-cue title="text track
+ active flag</a> set, none of the <a href=#text-track-cue title="text track
cue">cues</a> in <var title="">other cues</var> have their
- <a href=#text-track-cue-active-flag>text track cue active flag</a> set, then abort these
+ <a href=#text-track-cue-active-flag>text track cue active flag</a> set, and <var title="">missed cues</var> is empty, then abort these
steps.</li>
- <li><p>If the time was reached through the usual monotonic increase
- of the <a href=#current-playback-position>current playback position</a> during normal
- playback, and there are <a href=#text-track-cue title="text track cue">cues</a> in
- <var title="">other cues</var> that have both their <a href=#text-track-cue-active-flag>text
- track cue active flag</a> set and their <a href=#text-track-cue-pause-on-exit-flag>text track cue
- pause-on-exit flag</a> set, then immediately <a href=#dom-media-pause title=dom-media-pause>pause</a> the <a href=#media-element>media
- element</a>. <!-- "pause" can in theory call load(), but never
- can it do so as part of this invokation, since we wouldn't be in
- this algorithm if the media element was empty. So, no need to couch
- all this in a task. --> (In the other cases, such as explicit
- seeks, playback is not paused by going past the end time of a <a href=#text-track-cue title="text track cue">cue</a>, even if that <a href=#text-track-cue title="text
- track cue">cue</a> has its <a href=#text-track-cue-pause-on-exit-flag>text track cue pause-on-exit
- flag</a> set.)</li>
+ <li>
- <li><p>Let <var title="">affected tracks</var> be a list of <a href=#text-track title="text track">text tracks</a>, initially empty.</li>
+ <p>If the time was reached through the usual monotonic increase of
+ the <a href=#current-playback-position>current playback position</a> during normal playback,
+ and there are <a href=#text-track-cue title="text track cue">cues</a> in <var title="">other cues</var> that have their <a href=#text-track-cue-pause-on-exit-flag>text track cue
+ pause-on-exit flag</a> set and that either have their
+ <a href=#text-track-cue-active-flag>text track cue active flag</a> set or are also in <var title="">missed cues</var>, then immediately <a href=#dom-media-pause title=dom-media-pause>pause</a> the <a href=#media-element>media
+ element</a>. <!-- "pause" can in theory call load(), but never
+ can it do so as part of this invokation, since we wouldn't be in
+ this algorithm if the media element was empty. So, no need to
+ couch all this in a task. --></p>
- <li><p>For each <a href=#text-track-cue title="text track cue">text track
- cue</a> in <var title="">other cues</var> that has its
- <a href=#text-track-cue-active-flag>text track cue active flag</a> set, in list order,
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-exit>exit</code> at the
- <code><a href=#texttrackcue>TextTrackCue</a></code> object, and add the <a href=#text-track-cue title="text
- track cue">cue</a>'s <a href=#text-track>text track</a> to <var title="">affected tracks</var>, if it's not already in the
- list.</li>
+ <p class=note>In the other cases, such as explicit seeks,
+ playback is not paused by going past the end time of a <a href=#text-track-cue title="text track cue">cue</a>, even if that <a href=#text-track-cue title="text
+ track cue">cue</a> has its <a href=#text-track-cue-pause-on-exit-flag>text track cue pause-on-exit
+ flag</a> set.</p>
- <li><p>For each <a href=#text-track-cue title="text track cue">text track
- cue</a> in <var title="">current cues</var> that does not have
- its <a href=#text-track-cue-active-flag>text track cue active flag</a> set, in list order,
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-enter>enter</code> at the
- <code><a href=#texttrackcue>TextTrackCue</a></code> object, and add the <a href=#text-track-cue title="text
- track cue">cue</a>'s <a href=#text-track>text track</a> to <var title="">affected tracks</var>, if it's not already in the
- list.</li>
+ </li>
+ <li>
+
+ <p>Let <var title="">events</var> be a list of <a href=#concept-task title=concept-task>tasks</a>, initially empty. Each <a href=#concept-task title=concept-task>task</a> in this list will be associated
+ with a <a href=#text-track>text track</a>, a <a href=#text-track-cue>text track cue</a>, and
+ a time, which are used to sort the list before the <a href=#concept-task title=concept-task>tasks</a> are queued.</p>
+
+ <p>Let <var title="">affected tracks</var> be a list of <a href=#text-track title="text track">text tracks</a>, initially empty.</p>
+
+ <p>When the steps below say to <dfn id=prepare-an-event>prepare an event</dfn> named
+ <var title="">event</var> for a <a href=#text-track-cue>text track cue</a> <var title="">target</var> with a time <var title="">time</var>, the
+ user agent must run these substeps:</p>
+
+ <ol><li><p>Let <var title="">track</var> be the <a href=#text-track>text
+ track</a> with which the <a href=#text-track-cue>text track cue</a> <var title="">target</var> is associated.</li>
+
+ <li><p>Create a <a href=#concept-task title=concept-task>task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <var title="">event</var>
+ at <var title="">target</var>.</li>
+
+ <li><p>Add to the newly create <a href=#concept-task title=concept-task>task</a> to <var title="">events</var>,
+ associated with the time <var title="">time</var>, the <a href=#text-track>text
+ track</a> <var title="">track</var>, and the <a href=#text-track-cue>text track
+ cue</a> <var title="">target</var>.</li>
+
+ <li><p>Add <var title="">track</var> to <var title="">affected
+ tracks</var>.</li>
+
+ </ol></li>
+
+ <li><p>For each <a href=#text-track-cue title="text track cue">text track cue</a>
+ in <var title="">missed cues</var>, <a href=#prepare-an-event>prepare an event</a>
+ named <code title=event-enter>enter</code> for the
+ <code><a href=#texttrackcue>TextTrackCue</a></code> object with the <a href=#text-track-cue-start-time>text track cue
+ start time</a>.</li>
+
+ <li><p>For each <a href=#text-track-cue title="text track cue">text track cue</a>
+ in <var title="">other cues</var> that either has its <a href=#text-track-cue-active-flag>text
+ track cue active flag</a> set or is in <var title="">missed
+ cues</var>, <a href=#prepare-an-event>prepare an event</a> named <code title=event-exit>exit</code> for the <code><a href=#texttrackcue>TextTrackCue</a></code>
+ object with the <a href=#text-track-cue-end-time>text track cue end time</a>.</li>
+
+ <li><p>For each <a href=#text-track-cue title="text track cue">text track cue</a>
+ in <var title="">current cues</var> that does not have its
+ <a href=#text-track-cue-active-flag>text track cue active flag</a> set, <a href=#prepare-an-event>prepare an
+ event</a> named <code title=event-enter>enter</code> for the
+ <code><a href=#texttrackcue>TextTrackCue</a></code> object with the <a href=#text-track-cue-start-time>text track cue
+ start time</a>.</li>
+
+ <li>
+
+ <p>Sort the <a href=#concept-task title=concept-task>tasks</a> in <var title="">events</var> in ascending time order (<a href=#concept-task title=concept-task>tasks</a> with earlier times
+ first).</p>
+
+ <p>Further sort <a href=#concept-task title=concept-task>tasks</a> in <var title="">events</var> that have the same time by the <a href=#text-track>text
+ track</a> associated with the <a href=#concept-task title=concept-task>tasks</a>, in the same order as the <a href=#text-track title="text track">text tracks</a> appear in the <a href=#media-element>media
+ element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>.</p>
+
+ <p>Further sort <a href=#concept-task title=concept-task>tasks</a> in <var title="">events</var> that have the same time and <a href=#text-track>text
+ track</a> by the <a href=#text-track-cue>text track cue</a> associated with
+ the <a href=#concept-task title=concept-task>tasks</a>, in the same order as
+ the <a href=#text-track-cue title="text track cue">cues</a> were created (so e.g.
+ for cues from a <a href=#webvtt-file>WebVTT file</a>, that would be the order
+ in which the cues were listed in the file).</p>
+
+ </li>
+
+ <li><p><a href=#queue-a-task title="queue a task">Queue</a> each <a href=#concept-task title=concept-task>task</a> in <var title="">events</var>, in
+ list order.</li>
+
+ <li><p>Sort <var title="">affected tracks</var> in the same order
+ as the <a href=#text-track title="text track">text tracks</a> appear in the
+ <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>, and
+ remove duplicates.</p>
+
<li><p>For each <a href=#text-track>text track</a> in <var title="">affected
- tracks</var>, in the order they were added to the list (which will
- match the relative order of the <a href=#text-track title="text track">text
- tracks</a> in the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of
- text tracks</a>), <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-cuechange>cuechange</code> at the
- <code><a href=#texttrack>TextTrack</a></code> object, and, if the <a href=#text-track>text
- track</a> has a corresponding <code><a href=#the-track-element>track</a></code> element, to
- then <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-cuechange>cuechange</code> at the <code><a href=#the-track-element>track</a></code>
+ tracks</var>, in the list order, <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-cuechange>cuechange</code> at the
+ <code><a href=#texttrack>TextTrack</a></code> object, and, if the <a href=#text-track>text track</a>
+ has a corresponding <code><a href=#the-track-element>track</a></code> element, to then <a href=#fire-a-simple-event>fire
+ a simple event</a> named <code title=event-cuechange>cuechange</code> at the <code><a href=#the-track-element>track</a></code>
element as well.</li>
<li><p>Set the <a href=#text-track-cue-active-flag>text track cue active flag</a> of all the
@@ -31684,15 +31750,14 @@
</dl><p>If the <a href=#text-track-mode>text track mode</a> of the <a href=#text-track>text
track</a> that the <code><a href=#texttrack>TextTrack</a></code> object represents is
not the <a href=#text-track-disabled>text track disabled</a> mode, then the <dfn id=dom-texttrack-cues title=dom-TextTrack-cues><code>cues</code></dfn> attribute must
- return a <a href=#live>live</a> <code><a href=#texttrackcuelist>TextTrackCueList</a></code> object
- that represents the subset of the <a href=#text-track-list-of-cues>text track list of
- cues</a> of the <a href=#text-track>text track</a> that the
- <code><a href=#texttrack>TextTrack</a></code> object represents whose <a href=#text-track-cue-start-time title="text
- track cue start time">start times</a> occur before the
- <a href=#earliest-possible-position-when-the-script-started>earliest possible position when the script started</a>, in
- <a href=#text-track-cue-order>text track cue order</a>. Otherwise, it must return
- null. When an object is returned, the same object must be returned
- each time.</p>
+ return a <a href=#live>live</a> <code><a href=#texttrackcuelist>TextTrackCueList</a></code> object that
+ represents the subset of the <a href=#text-track-list-of-cues>text track list of cues</a> of
+ the <a href=#text-track>text track</a> that the <code><a href=#texttrack>TextTrack</a></code> object
+ represents whose <a href=#text-track-cue-start-time title="text track cue start time">start
+ times</a> occur at or after the <a href=#earliest-possible-position-when-the-script-started>earliest possible position
+ when the script started</a>, in <a href=#text-track-cue-order>text track cue
+ order</a>. Otherwise, it must return null. When an object is
+ returned, the same object must be returned each time.</p>
<p>The <dfn id=earliest-possible-position-when-the-script-started>earliest possible position when the script started</dfn>
is whatever the <a href=#earliest-possible-position>earliest possible position</a> was the last
Modified: index
===================================================================
--- index 2011-08-19 19:51:20 UTC (rev 6516)
+++ index 2011-08-22 22:14:34 UTC (rev 6517)
@@ -243,7 +243,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 19 August 2011</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 22 August 2011</h2>
</hgroup><dl><dt><strong>Web developer edition</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
@@ -28958,26 +28958,36 @@
agent rushes ahead to "catch up".)
</p>
- <ol><li><p>Let <var title="">current cues</var> be an ordered list of
- <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain
- all the <a href=#text-track-cue title="text track cue">cues</a> of all the <a href=#text-track-hidden title="text track hidden">hidden</a>, <a href=#text-track-showing title="text track
+ <ol><li><p>Let <var title="">current cues</var> be a list of <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain all the
+ <a href=#text-track-cue title="text track cue">cues</a> of all the <a href=#text-track-hidden title="text track hidden">hidden</a>, <a href=#text-track-showing title="text track
showing">showing</a>, or <a href=#text-track-showing-by-default title="text track showing by
default">showing by default</a> <a href=#text-track title="text track">text
tracks</a> of the <a href=#media-element>media element</a> (not the <a href=#text-track-disabled title="text track disabled">disabled</a> ones) whose <a href=#text-track-cue-start-time title="text track cue start time">start times</a> are less than
or equal to the <a href=#current-playback-position>current playback position</a> and whose
<a href=#text-track-cue-end-time title="text track cue end time">end times</a> are greater
- than the <a href=#current-playback-position>current playback position</a>, in <a href=#text-track-cue-order>text
- track cue order</a>.</li>
+ than the <a href=#current-playback-position>current playback position</a>.</li>
- <li><p>Let <var title="">other cues</var> be an ordered list of
- <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain
- all the <a href=#text-track-cue title="text track cue">cues</a> of <a href=#text-track-hidden title="text track hidden">hidden</a>, <a href=#text-track-showing title="text track
+ <li><p>Let <var title="">other cues</var> be a list of <a href=#text-track-cue title="text track cue">cues</a>, initialized to contain all the
+ <a href=#text-track-cue title="text track cue">cues</a> of <a href=#text-track-hidden title="text track
+ hidden">hidden</a>, <a href=#text-track-showing title="text track
showing">showing</a>, and <a href=#text-track-showing-by-default title="text track showing by
default">showing by default</a> <a href=#text-track title="text track">text
tracks</a> of the <a href=#media-element>media element</a> that are not
- present in <var title="">current cues</var>, also in <a href=#text-track-cue-order>text
- track cue order</a>.</li>
+ present in <var title="">current cues</var>.</li>
+ <li><p>Let <var title="">last time</var> be the <a href=#current-playback-position>current
+ playback position</a> at the time this algorithm was last run
+ for this <a href=#media-element>media element</a>, if this is not the first time
+ it has run.</li>
+
+ <li><p>If the <a href=#current-playback-position>current playback position</a> has, since the
+ last time this algorithm was run, only changed through its usual
+ monotonic increase during normal playback, then let <var title="">missed cues</var> be the list of <a href=#text-track-cue title="text track
+ cue">cues</a> in <var title="">other cues</var> whose <a href=#text-track-cue-start-time title="text track cue start time">start times</a> are greater
+ than or equal to <var title="">last time</var> and whose <a href=#text-track-cue-end-time title="text track cue end time">end times</a> are less than or
+ equal to the <a href=#current-playback-position>current playback position</a>. Otherwise, let
+ <var title="">missed cues</var> be an empty list.</li>
+
<li><p>If the time was reached through the usual monotonic increase
of the <a href=#current-playback-position>current playback position</a> during normal
playback, and if the user agent has not fired a <code title=event-media-timeupdate><a href=#event-media-timeupdate>timeupdate</a></code> event at the
@@ -28998,54 +29008,110 @@
<li><p>If all of the <a href=#text-track-cue title="text track cue">cues</a> in
<var title="">current cues</var> have their <a href=#text-track-cue-active-flag>text track cue
- active flag</a> set, and none of the <a href=#text-track-cue title="text track
+ active flag</a> set, none of the <a href=#text-track-cue title="text track
cue">cues</a> in <var title="">other cues</var> have their
- <a href=#text-track-cue-active-flag>text track cue active flag</a> set, then abort these
+ <a href=#text-track-cue-active-flag>text track cue active flag</a> set, and <var title="">missed cues</var> is empty, then abort these
steps.</li>
- <li><p>If the time was reached through the usual monotonic increase
- of the <a href=#current-playback-position>current playback position</a> during normal
- playback, and there are <a href=#text-track-cue title="text track cue">cues</a> in
- <var title="">other cues</var> that have both their <a href=#text-track-cue-active-flag>text
- track cue active flag</a> set and their <a href=#text-track-cue-pause-on-exit-flag>text track cue
- pause-on-exit flag</a> set, then immediately <a href=#dom-media-pause title=dom-media-pause>pause</a> the <a href=#media-element>media
- element</a>. <!-- "pause" can in theory call load(), but never
- can it do so as part of this invokation, since we wouldn't be in
- this algorithm if the media element was empty. So, no need to couch
- all this in a task. --> (In the other cases, such as explicit
- seeks, playback is not paused by going past the end time of a <a href=#text-track-cue title="text track cue">cue</a>, even if that <a href=#text-track-cue title="text
- track cue">cue</a> has its <a href=#text-track-cue-pause-on-exit-flag>text track cue pause-on-exit
- flag</a> set.)</li>
+ <li>
- <li><p>Let <var title="">affected tracks</var> be a list of <a href=#text-track title="text track">text tracks</a>, initially empty.</li>
+ <p>If the time was reached through the usual monotonic increase of
+ the <a href=#current-playback-position>current playback position</a> during normal playback,
+ and there are <a href=#text-track-cue title="text track cue">cues</a> in <var title="">other cues</var> that have their <a href=#text-track-cue-pause-on-exit-flag>text track cue
+ pause-on-exit flag</a> set and that either have their
+ <a href=#text-track-cue-active-flag>text track cue active flag</a> set or are also in <var title="">missed cues</var>, then immediately <a href=#dom-media-pause title=dom-media-pause>pause</a> the <a href=#media-element>media
+ element</a>. <!-- "pause" can in theory call load(), but never
+ can it do so as part of this invokation, since we wouldn't be in
+ this algorithm if the media element was empty. So, no need to
+ couch all this in a task. --></p>
- <li><p>For each <a href=#text-track-cue title="text track cue">text track
- cue</a> in <var title="">other cues</var> that has its
- <a href=#text-track-cue-active-flag>text track cue active flag</a> set, in list order,
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-exit>exit</code> at the
- <code><a href=#texttrackcue>TextTrackCue</a></code> object, and add the <a href=#text-track-cue title="text
- track cue">cue</a>'s <a href=#text-track>text track</a> to <var title="">affected tracks</var>, if it's not already in the
- list.</li>
+ <p class=note>In the other cases, such as explicit seeks,
+ playback is not paused by going past the end time of a <a href=#text-track-cue title="text track cue">cue</a>, even if that <a href=#text-track-cue title="text
+ track cue">cue</a> has its <a href=#text-track-cue-pause-on-exit-flag>text track cue pause-on-exit
+ flag</a> set.</p>
- <li><p>For each <a href=#text-track-cue title="text track cue">text track
- cue</a> in <var title="">current cues</var> that does not have
- its <a href=#text-track-cue-active-flag>text track cue active flag</a> set, in list order,
- <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named
- <code title=event-enter>enter</code> at the
- <code><a href=#texttrackcue>TextTrackCue</a></code> object, and add the <a href=#text-track-cue title="text
- track cue">cue</a>'s <a href=#text-track>text track</a> to <var title="">affected tracks</var>, if it's not already in the
- list.</li>
+ </li>
+ <li>
+
+ <p>Let <var title="">events</var> be a list of <a href=#concept-task title=concept-task>tasks</a>, initially empty. Each <a href=#concept-task title=concept-task>task</a> in this list will be associated
+ with a <a href=#text-track>text track</a>, a <a href=#text-track-cue>text track cue</a>, and
+ a time, which are used to sort the list before the <a href=#concept-task title=concept-task>tasks</a> are queued.</p>
+
+ <p>Let <var title="">affected tracks</var> be a list of <a href=#text-track title="text track">text tracks</a>, initially empty.</p>
+
+ <p>When the steps below say to <dfn id=prepare-an-event>prepare an event</dfn> named
+ <var title="">event</var> for a <a href=#text-track-cue>text track cue</a> <var title="">target</var> with a time <var title="">time</var>, the
+ user agent must run these substeps:</p>
+
+ <ol><li><p>Let <var title="">track</var> be the <a href=#text-track>text
+ track</a> with which the <a href=#text-track-cue>text track cue</a> <var title="">target</var> is associated.</li>
+
+ <li><p>Create a <a href=#concept-task title=concept-task>task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <var title="">event</var>
+ at <var title="">target</var>.</li>
+
+ <li><p>Add to the newly create <a href=#concept-task title=concept-task>task</a> to <var title="">events</var>,
+ associated with the time <var title="">time</var>, the <a href=#text-track>text
+ track</a> <var title="">track</var>, and the <a href=#text-track-cue>text track
+ cue</a> <var title="">target</var>.</li>
+
+ <li><p>Add <var title="">track</var> to <var title="">affected
+ tracks</var>.</li>
+
+ </ol></li>
+
+ <li><p>For each <a href=#text-track-cue title="text track cue">text track cue</a>
+ in <var title="">missed cues</var>, <a href=#prepare-an-event>prepare an event</a>
+ named <code title=event-enter>enter</code> for the
+ <code><a href=#texttrackcue>TextTrackCue</a></code> object with the <a href=#text-track-cue-start-time>text track cue
+ start time</a>.</li>
+
+ <li><p>For each <a href=#text-track-cue title="text track cue">text track cue</a>
+ in <var title="">other cues</var> that either has its <a href=#text-track-cue-active-flag>text
+ track cue active flag</a> set or is in <var title="">missed
+ cues</var>, <a href=#prepare-an-event>prepare an event</a> named <code title=event-exit>exit</code> for the <code><a href=#texttrackcue>TextTrackCue</a></code>
+ object with the <a href=#text-track-cue-end-time>text track cue end time</a>.</li>
+
+ <li><p>For each <a href=#text-track-cue title="text track cue">text track cue</a>
+ in <var title="">current cues</var> that does not have its
+ <a href=#text-track-cue-active-flag>text track cue active flag</a> set, <a href=#prepare-an-event>prepare an
+ event</a> named <code title=event-enter>enter</code> for the
+ <code><a href=#texttrackcue>TextTrackCue</a></code> object with the <a href=#text-track-cue-start-time>text track cue
+ start time</a>.</li>
+
+ <li>
+
+ <p>Sort the <a href=#concept-task title=concept-task>tasks</a> in <var title="">events</var> in ascending time order (<a href=#concept-task title=concept-task>tasks</a> with earlier times
+ first).</p>
+
+ <p>Further sort <a href=#concept-task title=concept-task>tasks</a> in <var title="">events</var> that have the same time by the <a href=#text-track>text
+ track</a> associated with the <a href=#concept-task title=concept-task>tasks</a>, in the same order as the <a href=#text-track title="text track">text tracks</a> appear in the <a href=#media-element>media
+ element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>.</p>
+
+ <p>Further sort <a href=#concept-task title=concept-task>tasks</a> in <var title="">events</var> that have the same time and <a href=#text-track>text
+ track</a> by the <a href=#text-track-cue>text track cue</a> associated with
+ the <a href=#concept-task title=concept-task>tasks</a>, in the same order as
+ the <a href=#text-track-cue title="text track cue">cues</a> were created (so e.g.
+ for cues from a <a href=#webvtt-file>WebVTT file</a>, that would be the order
+ in which the cues were listed in the file).</p>
+
+ </li>
+
+ <li><p><a href=#queue-a-task title="queue a task">Queue</a> each <a href=#concept-task title=concept-task>task</a> in <var title="">events</var>, in
+ list order.</li>
+
+ <li><p>Sort <var title="">affected tracks</var> in the same order
+ as the <a href=#text-track title="text track">text tracks</a> appear in the
+ <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>, and
+ remove duplicates.</p>
+
<li><p>For each <a href=#text-track>text track</a> in <var title="">affected
- tracks</var>, in the order they were added to the list (which will
- match the relative order of the <a href=#text-track title="text track">text
- tracks</a> in the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of
- text tracks</a>), <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
- simple event</a> named <code title=event-cuechange>cuechange</code> at the
- <code><a href=#texttrack>TextTrack</a></code> object, and, if the <a href=#text-track>text
- track</a> has a corresponding <code><a href=#the-track-element>track</a></code> element, to
- then <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-cuechange>cuechange</code> at the <code><a href=#the-track-element>track</a></code>
+ tracks</var>, in the list order, <a href=#queue-a-task>queue a task</a> to
+ <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-cuechange>cuechange</code> at the
+ <code><a href=#texttrack>TextTrack</a></code> object, and, if the <a href=#text-track>text track</a>
+ has a corresponding <code><a href=#the-track-element>track</a></code> element, to then <a href=#fire-a-simple-event>fire
+ a simple event</a> named <code title=event-cuechange>cuechange</code> at the <code><a href=#the-track-element>track</a></code>
element as well.</li>
<li><p>Set the <a href=#text-track-cue-active-flag>text track cue active flag</a> of all the
@@ -31551,15 +31617,14 @@
</dl><p>If the <a href=#text-track-mode>text track mode</a> of the <a href=#text-track>text
track</a> that the <code><a href=#texttrack>TextTrack</a></code> object represents is
not the <a href=#text-track-disabled>text track disabled</a> mode, then the <dfn id=dom-texttrack-cues title=dom-TextTrack-cues><code>cues</code></dfn> attribute must
- return a <a href=#live>live</a> <code><a href=#texttrackcuelist>TextTrackCueList</a></code> object
- that represents the subset of the <a href=#text-track-list-of-cues>text track list of
- cues</a> of the <a href=#text-track>text track</a> that the
- <code><a href=#texttrack>TextTrack</a></code> object represents whose <a href=#text-track-cue-start-time title="text
- track cue start time">start times</a> occur before the
- <a href=#earliest-possible-position-when-the-script-started>earliest possible position when the script started</a>, in
- <a href=#text-track-cue-order>text track cue order</a>. Otherwise, it must return
- null. When an object is returned, the same object must be returned
- each time.</p>
+ return a <a href=#live>live</a> <code><a href=#texttrackcuelist>TextTrackCueList</a></code> object that
+ represents the subset of the <a href=#text-track-list-of-cues>text track list of cues</a> of
+ the <a href=#text-track>text track</a> that the <code><a href=#texttrack>TextTrack</a></code> object
+ represents whose <a href=#text-track-cue-start-time title="text track cue start time">start
+ times</a> occur at or after the <a href=#earliest-possible-position-when-the-script-started>earliest possible position
+ when the script started</a>, in <a href=#text-track-cue-order>text track cue
+ order</a>. Otherwise, it must return null. When an object is
+ returned, the same object must be returned each time.</p>
<p>The <dfn id=earliest-possible-position-when-the-script-started>earliest possible position when the script started</dfn>
is whatever the <a href=#earliest-possible-position>earliest possible position</a> was the last
Modified: source
===================================================================
--- source 2011-08-19 19:51:20 UTC (rev 6516)
+++ source 2011-08-22 22:14:34 UTC (rev 6517)
@@ -31605,9 +31605,9 @@
<ol>
- <li><p>Let <var title="">current cues</var> be an ordered list of
- <span title="text track cue">cues</span>, initialized to contain
- all the <span title="text track cue">cues</span> of all the <span
+ <li><p>Let <var title="">current cues</var> be a list of <span
+ title="text track cue">cues</span>, initialized to contain all the
+ <span title="text track cue">cues</span> of all the <span
title="text track hidden">hidden</span>, <span title="text track
showing">showing</span>, or <span title="text track showing by
default">showing by default</span> <span title="text track">text
@@ -31616,19 +31616,33 @@
title="text track cue start time">start times</span> are less than
or equal to the <span>current playback position</span> and whose
<span title="text track cue end time">end times</span> are greater
- than the <span>current playback position</span>, in <span>text
- track cue order</span>.</p></li>
+ than the <span>current playback position</span>.</p></li>
- <li><p>Let <var title="">other cues</var> be an ordered list of
- <span title="text track cue">cues</span>, initialized to contain
- all the <span title="text track cue">cues</span> of <span
- title="text track hidden">hidden</span>, <span title="text track
+ <li><p>Let <var title="">other cues</var> be a list of <span
+ title="text track cue">cues</span>, initialized to contain all the
+ <span title="text track cue">cues</span> of <span title="text track
+ hidden">hidden</span>, <span title="text track
showing">showing</span>, and <span title="text track showing by
default">showing by default</span> <span title="text track">text
tracks</span> of the <span>media element</span> that are not
- present in <var title="">current cues</var>, also in <span>text
- track cue order</span>.</p></li>
+ present in <var title="">current cues</var>.</p></li>
+ <li><p>Let <var title="">last time</var> be the <span>current
+ playback position</span> at the time this algorithm was last run
+ for this <span>media element</span>, if this is not the first time
+ it has run.</p></li>
+
+ <li><p>If the <span>current playback position</span> has, since the
+ last time this algorithm was run, only changed through its usual
+ monotonic increase during normal playback, then let <var
+ title="">missed cues</var> be the list of <span title="text track
+ cue">cues</span> in <var title="">other cues</var> whose <span
+ title="text track cue start time">start times</span> are greater
+ than or equal to <var title="">last time</var> and whose <span
+ title="text track cue end time">end times</span> are less than or
+ equal to the <span>current playback position</span>. Otherwise, let
+ <var title="">missed cues</var> be an empty list.</p></li>
+
<li><p>If the time was reached through the usual monotonic increase
of the <span>current playback position</span> during normal
playback, and if the user agent has not fired a <code
@@ -31651,60 +31665,135 @@
<li><p>If all of the <span title="text track cue">cues</span> in
<var title="">current cues</var> have their <span>text track cue
- active flag</span> set, and none of the <span title="text track
+ active flag</span> set, none of the <span title="text track
cue">cues</span> in <var title="">other cues</var> have their
- <span>text track cue active flag</span> set, then abort these
+ <span>text track cue active flag</span> set, and <var
+ title="">missed cues</var> is empty, then abort these
steps.</p></li>
- <li><p>If the time was reached through the usual monotonic increase
- of the <span>current playback position</span> during normal
- playback, and there are <span title="text track cue">cues</span> in
- <var title="">other cues</var> that have both their <span>text
- track cue active flag</span> set and their <span>text track cue
- pause-on-exit flag</span> set, then immediately <span
- title="dom-media-pause">pause</span> the <span>media
- element</span>. <!-- "pause" can in theory call load(), but never
- can it do so as part of this invokation, since we wouldn't be in
- this algorithm if the media element was empty. So, no need to couch
- all this in a task. --> (In the other cases, such as explicit
- seeks, playback is not paused by going past the end time of a <span
- title="text track cue">cue</span>, even if that <span title="text
- track cue">cue</span> has its <span>text track cue pause-on-exit
- flag</span> set.)</p></li>
+ <li>
- <li><p>Let <var title="">affected tracks</var> be a list of <span
- title="text track">text tracks</span>, initially empty.</p></li>
+ <p>If the time was reached through the usual monotonic increase of
+ the <span>current playback position</span> during normal playback,
+ and there are <span title="text track cue">cues</span> in <var
+ title="">other cues</var> that have their <span>text track cue
+ pause-on-exit flag</span> set and that either have their
+ <span>text track cue active flag</span> set or are also in <var
+ title="">missed cues</var>, then immediately <span
+ title="dom-media-pause">pause</span> the <span>media
+ element</span>. <!-- "pause" can in theory call load(), but never
+ can it do so as part of this invokation, since we wouldn't be in
+ this algorithm if the media element was empty. So, no need to
+ couch all this in a task. --></p>
- <li><p>For each <span title="text track cue">text track
- cue</span> in <var title="">other cues</var> that has its
- <span>text track cue active flag</span> set, in list order,
- <span>queue a task</span> to <span>fire a simple event</span> named
- <code title="event-exit">exit</code> at the
- <code>TextTrackCue</code> object, and add the <span title="text
- track cue">cue</span>'s <span>text track</span> to <var
- title="">affected tracks</var>, if it's not already in the
- list.</p></li>
+ <p class="note">In the other cases, such as explicit seeks,
+ playback is not paused by going past the end time of a <span
+ title="text track cue">cue</span>, even if that <span title="text
+ track cue">cue</span> has its <span>text track cue pause-on-exit
+ flag</span> set.</p>
- <li><p>For each <span title="text track cue">text track
- cue</span> in <var title="">current cues</var> that does not have
- its <span>text track cue active flag</span> set, in list order,
- <span>queue a task</span> to <span>fire a simple event</span> named
- <code title="event-enter">enter</code> at the
- <code>TextTrackCue</code> object, and add the <span title="text
- track cue">cue</span>'s <span>text track</span> to <var
- title="">affected tracks</var>, if it's not already in the
- list.</p></li>
+ </li>
+ <li>
+
+ <p>Let <var title="">events</var> be a list of <span
+ title="concept-task">tasks</span>, initially empty. Each <span
+ title="concept-task">task</span> in this list will be associated
+ with a <span>text track</span>, a <span>text track cue</span>, and
+ a time, which are used to sort the list before the <span
+ title="concept-task">tasks</span> are queued.</p>
+
+ <p>Let <var title="">affected tracks</var> be a list of <span
+ title="text track">text tracks</span>, initially empty.</p>
+
+ <p>When the steps below say to <dfn>prepare an event</dfn> named
+ <var title="">event</var> for a <span>text track cue</span> <var
+ title="">target</var> with a time <var title="">time</var>, the
+ user agent must run these substeps:</p>
+
+ <ol>
+
+ <li><p>Let <var title="">track</var> be the <span>text
+ track</span> with which the <span>text track cue</span> <var
+ title="">target</var> is associated.</p></li>
+
+ <li><p>Create a <span title="concept-task">task</span> to
+ <span>fire a simple event</span> named <var title="">event</var>
+ at <var title="">target</var>.</p></li>
+
+ <li><p>Add to the newly create <span
+ title="concept-task">task</span> to <var title="">events</var>,
+ associated with the time <var title="">time</var>, the <span>text
+ track</span> <var title="">track</var>, and the <span>text track
+ cue</span> <var title="">target</var>.</p></li>
+
+ <li><p>Add <var title="">track</var> to <var title="">affected
+ tracks</var>.</p></li>
+
+ </ol>
+
+ </li>
+
+ <li><p>For each <span title="text track cue">text track cue</span>
+ in <var title="">missed cues</var>, <span>prepare an event</span>
+ named <code title="event-enter">enter</code> for the
+ <code>TextTrackCue</code> object with the <span>text track cue
+ start time</span>.</p></li>
+
+ <li><p>For each <span title="text track cue">text track cue</span>
+ in <var title="">other cues</var> that either has its <span>text
+ track cue active flag</span> set or is in <var title="">missed
+ cues</var>, <span>prepare an event</span> named <code
+ title="event-exit">exit</code> for the <code>TextTrackCue</code>
+ object with the <span>text track cue end time</span>.</p></li>
+
+ <li><p>For each <span title="text track cue">text track cue</span>
+ in <var title="">current cues</var> that does not have its
+ <span>text track cue active flag</span> set, <span>prepare an
+ event</span> named <code title="event-enter">enter</code> for the
+ <code>TextTrackCue</code> object with the <span>text track cue
+ start time</span>.</p></li>
+
+ <li>
+
+ <p>Sort the <span title="concept-task">tasks</span> in <var
+ title="">events</var> in ascending time order (<span
+ title="concept-task">tasks</span> with earlier times
+ first).</p>
+
+ <p>Further sort <span title="concept-task">tasks</span> in <var
+ title="">events</var> that have the same time by the <span>text
+ track</span> associated with the <span
+ title="concept-task">tasks</span>, in the same order as the <span
+ title="text track">text tracks</span> appear in the <span>media
+ element</span>'s <span>list of text tracks</span>.</p>
+
+ <p>Further sort <span title="concept-task">tasks</span> in <var
+ title="">events</var> that have the same time and <span>text
+ track</span> by the <span>text track cue</span> associated with
+ the <span title="concept-task">tasks</span>, in the same order as
+ the <span title="text track cue">cues</span> were created (so e.g.
+ for cues from a <span>WebVTT file</span>, that would be the order
+ in which the cues were listed in the file).</p>
+
+ </li>
+
+ <li><p><span title="queue a task">Queue</span> each <span
+ title="concept-task">task</span> in <var title="">events</var>, in
+ list order.</p></li>
+
+ <li><p>Sort <var title="">affected tracks</var> in the same order
+ as the <span title="text track">text tracks</span> appear in the
+ <span>media element</span>'s <span>list of text tracks</span>, and
+ remove duplicates.</p>
+
<li><p>For each <span>text track</span> in <var title="">affected
- tracks</var>, in the order they were added to the list (which will
- match the relative order of the <span title="text track">text
- tracks</span> in the <span>media element</span>'s <span>list of
- text tracks</span>), <span>queue a task</span> to <span>fire a
- simple event</span> named <code
+ tracks</var>, in the list order, <span>queue a task</span> to
+ <span>fire a simple event</span> named <code
title="event-cuechange">cuechange</code> at the
- <code>TextTrack</code> object, and, if the <span>text
- track</span> has a corresponding <code>track</code> element, to
- then <span>fire a simple event</span> named <code
+ <code>TextTrack</code> object, and, if the <span>text track</span>
+ has a corresponding <code>track</code> element, to then <span>fire
+ a simple event</span> named <code
title="event-cuechange">cuechange</code> at the <code>track</code>
element as well.</p></li>
@@ -34548,15 +34637,14 @@
track</span> that the <code>TextTrack</code> object represents is
not the <span>text track disabled</span> mode, then the <dfn
title="dom-TextTrack-cues"><code>cues</code></dfn> attribute must
- return a <span>live</span> <code>TextTrackCueList</code> object
- that represents the subset of the <span>text track list of
- cues</span> of the <span>text track</span> that the
- <code>TextTrack</code> object represents whose <span title="text
- track cue start time">start times</span> occur before the
- <span>earliest possible position when the script started</span>, in
- <span>text track cue order</span>. Otherwise, it must return
- null. When an object is returned, the same object must be returned
- each time.</p>
+ return a <span>live</span> <code>TextTrackCueList</code> object that
+ represents the subset of the <span>text track list of cues</span> of
+ the <span>text track</span> that the <code>TextTrack</code> object
+ represents whose <span title="text track cue start time">start
+ times</span> occur at or after the <span>earliest possible position
+ when the script started</span>, in <span>text track cue
+ order</span>. Otherwise, it must return null. When an object is
+ returned, the same object must be returned each time.</p>
<p>The <dfn>earliest possible position when the script started</dfn>
is whatever the <span>earliest possible position</span> was the last
@@ -38090,7 +38178,6 @@
</table>
-
<div class="impl">
<h5>Security and privacy considerations</h5>
More information about the Commit-Watchers
mailing list