[html5] r5132 - [e] (0) Captions - Stage 17: The logic for updating active cues, firing events, [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Jul 2 15:57:08 PDT 2010


Author: ianh
Date: 2010-07-02 15:57:06 -0700 (Fri, 02 Jul 2010)
New Revision: 5132

Modified:
   complete.html
   index
   source
Log:
[e] (0) Captions - Stage 17: The logic for updating active cues, firing events, and triggering rendering updates; start of the domintro stuff.

Modified: complete.html
===================================================================
--- complete.html	2010-07-01 23:23:47 UTC (rev 5131)
+++ complete.html	2010-07-02 22:57:06 UTC (rev 5132)
@@ -209,7 +209,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <hgroup><h1>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Draft Standard — 1 July 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 2 July 2010</h2>
    </hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -7920,6 +7920,9 @@
            attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
            attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+<!--TT-->
+           attribute <a href=#function>Function</a> <a href=#handler-oncuechange title=handler-oncuechange>oncuechange</a>;
+<!--TT-->
            attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
@@ -8895,6 +8898,9 @@
            attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
            attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+<!--TT-->
+           attribute <a href=#function>Function</a> <a href=#handler-oncuechange title=handler-oncuechange>oncuechange</a>;
+<!--TT-->
            attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
@@ -8998,6 +9004,9 @@
    <li><code title=handler-onchange><a href=#handler-onchange>onchange</a></code></li>
    <li><code title=handler-onclick><a href=#handler-onclick>onclick</a></code></li>
    <li><code title=handler-oncontextmenu><a href=#handler-oncontextmenu>oncontextmenu</a></code></li>
+<!--TT-->
+   <li><code title=handler-oncuechange><a href=#handler-oncuechange>oncuechange</a></code></li>
+<!--TT-->
    <li><code title=handler-ondblclick><a href=#handler-ondblclick>ondblclick</a></code></li>
    <li><code title=handler-ondrag><a href=#handler-ondrag>ondrag</a></code></li>
    <li><code title=handler-ondragend><a href=#handler-ondragend>ondragend</a></code></li>
@@ -25683,25 +25692,28 @@
   agent must wait for the steps to complete, and then must immediately
   rerun the steps. (These steps are thus run as often as possible or
   needed — if one iteration takes a long time, this can cause
-  certain ranges to be skipped over as the user agent rushes ahead to
-  "catch up".)</p>
+  certain <a href=#timed-track-cue title="timed track cue">cues</a> to be skipped over
+  as the user agent rushes ahead to "catch up".)</p>
 
-  <ol><!--XXXTT - the text below is wrong, but we need to do something similar, updating the timed tracks, pausing if necessary (more below)
-   <li><p>Let <var title="">current ranges</var> be an ordered list of
-   <span title="cue range">cue ranges</span>, initialized to contain
-   all the <span title="cue range">cue ranges</span> of the
-   <span>media element</span> whose start times are less than or equal
-   to the <span>current playback position</span> and whose end times
-   are greater than the <span>current playback position</span>, in the
-   order they were added to the element.</p></li>
+  <ol><li><p>Let <var title="">current cues</var> be an ordered list of
+   <a href=#timed-track-cue title="timed track cue">cues</a>, initialized to contain
+   all the <a href=#timed-track-cue title="timed track cue">cues</a> of all the <a href=#timed-track-hidden title="timed track hidden">hidden</a> or <a href=#timed-track-showing title="timed
+   track showing">showing</a> <a href=#timed-track title="timed track">timed
+   tracks</a> of the <a href=#media-element>media element</a> (not not the <a href=#timed-track-disabled title="timed track disabled">disabled</a> ones) whose <a href=#timed-track-cue-start-time title="timed 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=#timed-track-cue-end-time title="timed track cue end time">end times</a> are greater
+   than the <a href=#current-playback-position>current playback position</a>, in <a href=#timed-track-cue-order>timed
+   track cue order</a>.</li>
 
-   <li><p>Let <var title="">other ranges</var> be an ordered list of
-   <span title="cue range">cue ranges</span>, initialized to contain
-   all the <span title="cue range">cue ranges</span> of the
-   <span>media element</span> that are not present in <var
-   title="">current ranges</var>, in the order they were added to the
-   element.</p></li>
---><li><p>If the time was reached through the usual monotonic increase
+   <li><p>Let <var title="">other cues</var> be an ordered list of
+   <a href=#timed-track-cue title="timed track cue">cues</a>, initialized to contain
+   all the <a href=#timed-track-cue title="timed track cue">cues</a> of <a href=#timed-track-hidden title="timed track hidden">hidden</a> and <a href=#timed-track-showing title="timed
+   track showing">showing</a> <a href=#timed-track title="timed track">timed
+   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=#timed-track-cue-order>timed
+   track cue order</a>.</li>
+
+   <li><p>If the time was reached through the usual monotonic increase
    of the current playback position 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
    element in the past 15 to 250ms and is not still running event
@@ -25719,47 +25731,69 @@
    not any more frequent than the user agent can comfortably handle
    while decoding the video.</li>
 
-<!--XXXTT [beware - - nested comments]
-   <li><p>If none of the <span title="cue range">cue ranges</span> in
-   <var title="">current ranges</var> have their "active" boolean set
-   to "false" (inactive) and none of the <span title="cue range">cue
-   ranges</span> in <var title="">other ranges</var> have their
-   "active" boolean set to "true" (active), then abort these
-   steps.</p></li>
+   <li><p>If all of the <a href=#timed-track-cue title="timed track cue">cues</a> in
+   <var title="">current cues</var> have their <a href=#timed-track-cue-active-flag>timed track cue
+   active flag</a> set, and none of the <a href=#timed-track-cue title="timed track
+   cue">cues</a> in <var title="">other cues</var> have their
+   <a href=#timed-track-cue-active-flag>timed track cue active flag</a> set, then abort these
+   steps.</li>
 
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and there
-   are <span title="cue range">cue ranges</span> in <var
-   title="">other ranges</var> that have both their "active" boolean
-   and their "pause" boolean set to "true", then immediately act as if
-   the element's <code title="dom-media-pause">pause()</code> method
-   had been invoked. <!- - 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 exiting a cue range, even if that
-   cue range has its "pause" boolean set to "true".)</p></li>
+   are <a href=#timed-track-cue title="timed track cue">cues</a> in <var title="">other cues</var> that have both their <a href=#timed-track-cue-active-flag>timed track
+   cue active flag</a> set and their <a href=#timed-track-cue-pause-on-exit-flag>timed track cue
+   pause-on-exit flag</a> set, then immediately act as if the
+   element's <code title=dom-media-pause><a href=#dom-media-pause>pause()</a></code> method had
+   been invoked. <!-- 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=#timed-track-cue title="timed track cue">cue</a>, even if that <a href=#timed-track-cue title="timed
+   track cue">cue</a> has its <a href=#timed-track-cue-pause-on-exit-flag>timed track cue pause-on-exit
+   flag</a> set.)</li>
 
-   <li><p>For each non-null "exit" callback of the <span
-   title="cue range">cue ranges</span> in <var title="">other
-   ranges</var> that have their "active" boolean set to "true"
-   (active), in list order, <span>queue a task</span> that invokes the
-   callback, passing the cue range's identifier as the callback's only
-   argument.</p></li>
+   <li><p>Let <var title="">affected tracks</var> be a list of <a href=#timed-track title="timed track">timed tracks</a>, initially empty.</li>
 
-   <li><p>For each non-null "enter" callback of the <span title="cue
-   range">cue ranges</span> in <var title="">current ranges</var> that
-   have their "active" boolean set to "false" (inactive), in list
-   order, <span>queue a task</span> that invokes the callback, passing
-   the cue range's identifier as the callback's only
-   argument.</p></li>
+   <li><p>For each <a href=#timed-track-cue title="timed track cue">timed track
+   cue</a> in <var title="">other cues</var> that has its
+   <a href=#timed-track-cue-active-flag>timed 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=#timedtrackcue>TimedTrackCue</a></code> object, and add the <a href=#timed-track-cue title="timed
+   track cue">cue</a>'s <a href=#timed-track>timed track</a> to <var title="">affected tracks</var>, if it's not already in the
+   list.</li>
 
-   <li><p>Set the "active" boolean of all the <span title="cue
-   range">cue ranges</span> in the <var title="">current ranges</var>
-   list to "true" (active), and the "active" boolean of all the <span
-   title="cue range">cue ranges</span> in the <var title="">other
-   ranges</var> list to "false" (inactive).</p></li>
--->
+   <li><p>For each <a href=#timed-track-cue title="timed track cue">timed track
+   cue</a> in <var title="">current cues</var> that does not have
+   its <a href=#timed-track-cue-active-flag>timed 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=#timedtrackcue>TimedTrackCue</a></code> object, and add the <a href=#timed-track-cue title="timed
+   track cue">cue</a>'s <a href=#timed-track>timed track</a> to <var title="">affected tracks</var>, if it's not already in the
+   list.</li>
+
+   <li><p>For each <a href=#timed-track>timed 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=#timed-track title="timed track">timed
+   tracks</a> in the <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of
+   timed 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=#timedtrack>TimedTrack</a></code> object, and, if the <a href=#timed-track>timed
+   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=#timed-track-cue-active-flag>timed track cue active flag</a> of all the
+   <a href=#timed-track-cue title="timed track cue">cues</a> in the <var title="">current cues</var>, and unset the <a href=#timed-track-cue-active-flag>timed track cue
+   active flag</a> of all the <a href=#timed-track-cue title="timed track
+   cue">cues</a> in the <var title="">other cues</var>.</li>
+
+   <li><p>Run the rules for rendering the cues of each of the <a href=#timed-track title="timed track">timed tracks</a> in <var title="">affected
+   tracks</var> that are <a href=#timed-track-showing title="timed track
+   showing">showing</a> (e.g., for <a href=#timed-track title="timed track">timed
+   tracks</a> based on <a href=#websrt>WebSRT</a>, the <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for
+   updating the display of WebSRT timed tracks</a>).</li>
+
   </ol><p>When a <a href=#media-element>media element</a> is <a href=#remove-an-element-from-a-document title="remove an
   element from a document">removed from a
   <code>Document</code></a>, if the <a href=#media-element>media element</a>'s
@@ -26098,7 +26132,10 @@
 
    <dd>
 
-    <p>A list of <a href=#timed-track-cue title="timed track cue">timed track cues</a>.</p>
+    <p>A list of <a href=#timed-track-cue title="timed track cue">timed track
+    cues</a>, along with rules for their rendering (e.g., for
+    <a href=#websrt>WebSRT</a>, the <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of
+    WebSRT timed tracks</a>).</p>
 
     <p>The <a href=#timed-track-list-of-cues title="timed track list of cues">list of cues of a
     timed track</a> can change dynamically, either because the
@@ -26253,7 +26290,41 @@
   cue</a> is associated with a particular <a href=#timed-track>timed track</a>,
   the association is permanent.</p>
 
+  <p>In addition, each <a href=#timed-track-cue>timed track cue</a> has two pieces of
+  dynamic information:</p>
 
+  <dl><dt>The <dfn id=timed-track-cue-active-flag title="timed track cue active flag">active flag</dfn>
+   <dd>
+    <p>This flag must be initially unset. It is used to ensure events
+    are fired appropriately when the cue becomes active or
+    inactive.</p>
+   </dd>
+
+   <dt>The <dfn id=timed-track-cue-display-state title="timed track cue display state">display state</dfn>
+   <dd>
+    <p>This is used as part of the rendering model.</p>
+   </dd>
+
+  </dl><p>The <a href=#timed-track-cue title="timed track cue">timed track cues</a> of a
+  <a href=#media-element>media element</a>'s <a href=#timed-track title="timed track">timed
+  tracks</a> are ordered relative to each other in the <dfn id=timed-track-cue-order>timed
+  track cue order</dfn>, which is determined as follows: first group
+  the <a href=#timed-track-cue title="timed track cue">cues</a> by their <a href=#timed-track>timed
+  track</a>, with the groups being sorted in the same order as
+  their <a href=#timed-track title="timed track">timed tracks</a> appear in the
+  <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a>;
+  then, within each group, <a href=#timed-track-cue title="timed track cue">cues</a>
+  must be sorted by their <a href=#timed-track-cue-start-time title="timed track cue start
+  time">start time</a>, earliest first; then, any <a href=#timed-track-cue title="timed track cue">cues</a> with the same <a href=#timed-track-cue-start-time title="timed
+  track cue start time">start time</a> must be sorted by their
+  <a href=#timed-track-cue-end-time title="timed track cue end time">end time</a>, earliest
+  first; and finally, any <a href=#timed-track-cue title="timed track cue">cues</a>
+  with identical <a href=#timed-track-cue-end-time title="timed track cue end time">end
+  times</a> must be sorted in the order they were created (so
+  e.g. for cues from a <a href=#websrt>WebSRT</a> file, that would be the
+  order in which the cues were listed in the file).</p>
+
+
   <h6 id=sourcing-in-band-timed-tracks><span class=secno>4.8.10.10.2 </span>Sourcing in-band timed tracks</h6>
 
   <p>A <dfn id=media-resource-specific-timed-track>media-resource-specific timed track</dfn> is a <a href=#timed-track>timed
@@ -26634,6 +26705,8 @@
   // timed tracks
   readonly attribute <span>TimedTrack</span>[] <span title="dom-media-tracks">tracks</span>;
   <span>MutableTimedTrack</span> <span title="dom-media-addTrack">addTrack</span>(in DOMString label, in DOMString kind, in DOMString language);
+
+ - addTrack should add it as Loaded, Disabled, and with the rules for WebSRT.
 -->
 
   <pre class=idl>interface <dfn id=timedtrack>TimedTrack</dfn> {
@@ -26656,8 +26729,8 @@
 
   readonly attribute <a href=#timedtrackcuelist>TimedTrackCueList</a> <span title=dom-TimedTrack-cues>cues</span>;
   readonly attribute <a href=#timedtrackcuelist>TimedTrackCueList</a> <span title=dom-TimedTrack-activeCues>activeCues</span>;
-  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrack-onentercue>onentercue</span>;
-  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrack-onexitcue>onexitcue</span>;
+
+  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrack-oncuechange>oncuechange</span>;
 };
 
 interface <dfn id=mutabletimedtrack>MutableTimedTrack</dfn> : <a href=#timedtrack>TimedTrack</a> {
@@ -26690,12 +26763,31 @@
   readonly attribute DOMString <span title=dom-TimedTrackCue-voice>voice</span>;
   DOMString <span title=dom-TimedTrackCue-getCueAsSource()>getCueAsSource</span>();
   <a href=#documentfragment>DocumentFragment</a> <span title=dom-TimedTrackCue-getCueAsHTML()>getCueAsHTML</span>();
+
+  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrackCue-onenter>onenter</span>;
+  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrackCue-onexit>onexit</span>;
 };</pre>
 
-  <p class=XXX>domintro
+  <dl class=domintro><dt><var title="">media</var> . <code title=dom-media-tracks>tracks</code> . <code title="">length</code></dt>
+   <dd>
+    <p>Returns the number of timed tracks associated with the element (e.g. from <code><a href=#the-track-element>track</a></code> elements).</p>
+   </dd>
 
-  <div class=impl>
+   <dt><var title="">media</var> . <code title=dom-media-tracks>tracks[<var title="">n</var>]</code></dt>
+   <dd>
+    <p>Returns the <code><a href=#timedtrack>TimedTrack</a></code> object representing the <var title="">n</var>th timed track.</p>
+   </dd>
 
+   <dt><var title="">track</var> . <code title=dom-track-track><a href=#dom-track-track>track</a></code></dt>
+   <dd>
+    <p>Returns the <code><a href=#timedtrack>TimedTrack</a></code> object representing the <code><a href=#the-track-element>track</a></code> element's timed track.</p>
+   </dd>
+
+   <dt class=XXX>...</dt>
+   <dd class=XXX>...</dd>
+
+  </dl><div class=impl>
+
   <p class=XXX>...
 
   <!-- XXX
@@ -26707,6 +26799,10 @@
   entirely prior to the <span>media resource</span>'s <span>earliest
   possible position</span>.</p>
 
+  changing dom-TimedTrack-mode to disabled/hidden should hide all the
+  titles, changing it to showing should show them. (Only 'showing'
+  tracks get updated automatically.)
+
   -->
 
   </div>
@@ -26716,12 +26812,7 @@
 
   <p class=XXX>...
 
-<!-- XXX
-CueEvent
- readonly attribute TimedTrackCue cue;
--->
 
-
   <h5 id=websrt-0><span class=secno>4.8.10.11 </span>WebSRT</h5>
 
   <p>The <dfn id=websrt>WebSRT</dfn> format (Web Subtitle Resource Tracks) is a
@@ -56323,6 +56414,9 @@
            attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
            attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+<!--TT-->
+           attribute <a href=#function>Function</a> <a href=#handler-oncuechange title=handler-oncuechange>oncuechange</a>;
+<!--TT-->
            attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
@@ -62579,6 +62673,9 @@
     <tr><td><dfn id=handler-onchange title=handler-onchange><code>onchange</code></dfn> <td> <code title=event-change>change</code> <!-- widely used -->
     <tr><td><dfn id=handler-onclick title=handler-onclick><code>onclick</code></dfn> <td> <code title=event-click><a href=#event-click>click</a></code> <!-- widely used -->
     <tr><td><dfn id=handler-oncontextmenu title=handler-oncontextmenu><code>oncontextmenu</code></dfn> <td> <code title=event-contextmenu>contextmenu</code> <!-- widely used -->
+<!--TT-->
+    <tr><td><dfn id=handler-oncuechange title=handler-oncuechange><code>oncuechange</code></dfn> <td> <code title=event-cuechange>cuechange</code>
+<!--TT-->
     <tr><td><dfn id=handler-ondblclick title=handler-ondblclick><code>ondblclick</code></dfn> <td> <code title=event-dblclick>dblclick</code> <!-- widely used -->
     <tr><td><dfn id=handler-ondrag title=handler-ondrag><code>ondrag</code></dfn> <td> <code title=event-drag><a href=#event-drag>drag</a></code>
     <tr><td><dfn id=handler-ondragend title=handler-ondragend><code>ondragend</code></dfn> <td> <code title=event-dragend><a href=#event-dragend>dragend</a></code>
@@ -85594,7 +85691,7 @@
 
   <h5 id=websrt-cue-text-rendering-rules><span class=secno>14.3.2.1 </span><dfn>WebSRT cue text rendering rules</dfn></h5>
 
-  <p class=XXX>
+  <p class=XXX>The <dfn id=rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed tracks</dfn>
 
   <!--
 
@@ -91194,6 +91291,12 @@
      <td> <a href=#handler-oncontextmenu title=handler-oncontextmenu>HTML elements</a>
      <td> <code title=event-contextmenu>contextmenu</code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
+<!--TT-->
+    <tr><th> <code title="">oncuechange</code>
+     <td> <a href=#handler-oncuechange title=handler-oncuechange>HTML elements</a>
+     <td> <code title=event-cuechange>cuechange</code> event handler
+     <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
+<!--TT-->
 
     <tr><th> <code title="">ondblclick</code>
      <td> <a href=#handler-ondblclick title=handler-ondblclick>HTML elements</a>

Modified: index
===================================================================
--- index	2010-07-01 23:23:47 UTC (rev 5131)
+++ index	2010-07-02 22:57:06 UTC (rev 5132)
@@ -213,7 +213,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <hgroup><h1>HTML5 (including next generation additions still in development)</h1>
-    <h2 class="no-num no-toc">Draft Standard — 1 July 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 2 July 2010</h2>
    </hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -7844,6 +7844,9 @@
            attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
            attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+<!--TT-->
+           attribute <a href=#function>Function</a> <a href=#handler-oncuechange title=handler-oncuechange>oncuechange</a>;
+<!--TT-->
            attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
@@ -8819,6 +8822,9 @@
            attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
            attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+<!--TT-->
+           attribute <a href=#function>Function</a> <a href=#handler-oncuechange title=handler-oncuechange>oncuechange</a>;
+<!--TT-->
            attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
@@ -8922,6 +8928,9 @@
    <li><code title=handler-onchange><a href=#handler-onchange>onchange</a></code></li>
    <li><code title=handler-onclick><a href=#handler-onclick>onclick</a></code></li>
    <li><code title=handler-oncontextmenu><a href=#handler-oncontextmenu>oncontextmenu</a></code></li>
+<!--TT-->
+   <li><code title=handler-oncuechange><a href=#handler-oncuechange>oncuechange</a></code></li>
+<!--TT-->
    <li><code title=handler-ondblclick><a href=#handler-ondblclick>ondblclick</a></code></li>
    <li><code title=handler-ondrag><a href=#handler-ondrag>ondrag</a></code></li>
    <li><code title=handler-ondragend><a href=#handler-ondragend>ondragend</a></code></li>
@@ -25610,25 +25619,28 @@
   agent must wait for the steps to complete, and then must immediately
   rerun the steps. (These steps are thus run as often as possible or
   needed — if one iteration takes a long time, this can cause
-  certain ranges to be skipped over as the user agent rushes ahead to
-  "catch up".)</p>
+  certain <a href=#timed-track-cue title="timed track cue">cues</a> to be skipped over
+  as the user agent rushes ahead to "catch up".)</p>
 
-  <ol><!--XXXTT - the text below is wrong, but we need to do something similar, updating the timed tracks, pausing if necessary (more below)
-   <li><p>Let <var title="">current ranges</var> be an ordered list of
-   <span title="cue range">cue ranges</span>, initialized to contain
-   all the <span title="cue range">cue ranges</span> of the
-   <span>media element</span> whose start times are less than or equal
-   to the <span>current playback position</span> and whose end times
-   are greater than the <span>current playback position</span>, in the
-   order they were added to the element.</p></li>
+  <ol><li><p>Let <var title="">current cues</var> be an ordered list of
+   <a href=#timed-track-cue title="timed track cue">cues</a>, initialized to contain
+   all the <a href=#timed-track-cue title="timed track cue">cues</a> of all the <a href=#timed-track-hidden title="timed track hidden">hidden</a> or <a href=#timed-track-showing title="timed
+   track showing">showing</a> <a href=#timed-track title="timed track">timed
+   tracks</a> of the <a href=#media-element>media element</a> (not not the <a href=#timed-track-disabled title="timed track disabled">disabled</a> ones) whose <a href=#timed-track-cue-start-time title="timed 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=#timed-track-cue-end-time title="timed track cue end time">end times</a> are greater
+   than the <a href=#current-playback-position>current playback position</a>, in <a href=#timed-track-cue-order>timed
+   track cue order</a>.</li>
 
-   <li><p>Let <var title="">other ranges</var> be an ordered list of
-   <span title="cue range">cue ranges</span>, initialized to contain
-   all the <span title="cue range">cue ranges</span> of the
-   <span>media element</span> that are not present in <var
-   title="">current ranges</var>, in the order they were added to the
-   element.</p></li>
---><li><p>If the time was reached through the usual monotonic increase
+   <li><p>Let <var title="">other cues</var> be an ordered list of
+   <a href=#timed-track-cue title="timed track cue">cues</a>, initialized to contain
+   all the <a href=#timed-track-cue title="timed track cue">cues</a> of <a href=#timed-track-hidden title="timed track hidden">hidden</a> and <a href=#timed-track-showing title="timed
+   track showing">showing</a> <a href=#timed-track title="timed track">timed
+   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=#timed-track-cue-order>timed
+   track cue order</a>.</li>
+
+   <li><p>If the time was reached through the usual monotonic increase
    of the current playback position 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
    element in the past 15 to 250ms and is not still running event
@@ -25646,47 +25658,69 @@
    not any more frequent than the user agent can comfortably handle
    while decoding the video.</li>
 
-<!--XXXTT [beware - - nested comments]
-   <li><p>If none of the <span title="cue range">cue ranges</span> in
-   <var title="">current ranges</var> have their "active" boolean set
-   to "false" (inactive) and none of the <span title="cue range">cue
-   ranges</span> in <var title="">other ranges</var> have their
-   "active" boolean set to "true" (active), then abort these
-   steps.</p></li>
+   <li><p>If all of the <a href=#timed-track-cue title="timed track cue">cues</a> in
+   <var title="">current cues</var> have their <a href=#timed-track-cue-active-flag>timed track cue
+   active flag</a> set, and none of the <a href=#timed-track-cue title="timed track
+   cue">cues</a> in <var title="">other cues</var> have their
+   <a href=#timed-track-cue-active-flag>timed track cue active flag</a> set, then abort these
+   steps.</li>
 
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and there
-   are <span title="cue range">cue ranges</span> in <var
-   title="">other ranges</var> that have both their "active" boolean
-   and their "pause" boolean set to "true", then immediately act as if
-   the element's <code title="dom-media-pause">pause()</code> method
-   had been invoked. <!- - 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 exiting a cue range, even if that
-   cue range has its "pause" boolean set to "true".)</p></li>
+   are <a href=#timed-track-cue title="timed track cue">cues</a> in <var title="">other cues</var> that have both their <a href=#timed-track-cue-active-flag>timed track
+   cue active flag</a> set and their <a href=#timed-track-cue-pause-on-exit-flag>timed track cue
+   pause-on-exit flag</a> set, then immediately act as if the
+   element's <code title=dom-media-pause><a href=#dom-media-pause>pause()</a></code> method had
+   been invoked. <!-- 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=#timed-track-cue title="timed track cue">cue</a>, even if that <a href=#timed-track-cue title="timed
+   track cue">cue</a> has its <a href=#timed-track-cue-pause-on-exit-flag>timed track cue pause-on-exit
+   flag</a> set.)</li>
 
-   <li><p>For each non-null "exit" callback of the <span
-   title="cue range">cue ranges</span> in <var title="">other
-   ranges</var> that have their "active" boolean set to "true"
-   (active), in list order, <span>queue a task</span> that invokes the
-   callback, passing the cue range's identifier as the callback's only
-   argument.</p></li>
+   <li><p>Let <var title="">affected tracks</var> be a list of <a href=#timed-track title="timed track">timed tracks</a>, initially empty.</li>
 
-   <li><p>For each non-null "enter" callback of the <span title="cue
-   range">cue ranges</span> in <var title="">current ranges</var> that
-   have their "active" boolean set to "false" (inactive), in list
-   order, <span>queue a task</span> that invokes the callback, passing
-   the cue range's identifier as the callback's only
-   argument.</p></li>
+   <li><p>For each <a href=#timed-track-cue title="timed track cue">timed track
+   cue</a> in <var title="">other cues</var> that has its
+   <a href=#timed-track-cue-active-flag>timed 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=#timedtrackcue>TimedTrackCue</a></code> object, and add the <a href=#timed-track-cue title="timed
+   track cue">cue</a>'s <a href=#timed-track>timed track</a> to <var title="">affected tracks</var>, if it's not already in the
+   list.</li>
 
-   <li><p>Set the "active" boolean of all the <span title="cue
-   range">cue ranges</span> in the <var title="">current ranges</var>
-   list to "true" (active), and the "active" boolean of all the <span
-   title="cue range">cue ranges</span> in the <var title="">other
-   ranges</var> list to "false" (inactive).</p></li>
--->
+   <li><p>For each <a href=#timed-track-cue title="timed track cue">timed track
+   cue</a> in <var title="">current cues</var> that does not have
+   its <a href=#timed-track-cue-active-flag>timed 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=#timedtrackcue>TimedTrackCue</a></code> object, and add the <a href=#timed-track-cue title="timed
+   track cue">cue</a>'s <a href=#timed-track>timed track</a> to <var title="">affected tracks</var>, if it's not already in the
+   list.</li>
+
+   <li><p>For each <a href=#timed-track>timed 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=#timed-track title="timed track">timed
+   tracks</a> in the <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of
+   timed 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=#timedtrack>TimedTrack</a></code> object, and, if the <a href=#timed-track>timed
+   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=#timed-track-cue-active-flag>timed track cue active flag</a> of all the
+   <a href=#timed-track-cue title="timed track cue">cues</a> in the <var title="">current cues</var>, and unset the <a href=#timed-track-cue-active-flag>timed track cue
+   active flag</a> of all the <a href=#timed-track-cue title="timed track
+   cue">cues</a> in the <var title="">other cues</var>.</li>
+
+   <li><p>Run the rules for rendering the cues of each of the <a href=#timed-track title="timed track">timed tracks</a> in <var title="">affected
+   tracks</var> that are <a href=#timed-track-showing title="timed track
+   showing">showing</a> (e.g., for <a href=#timed-track title="timed track">timed
+   tracks</a> based on <a href=#websrt>WebSRT</a>, the <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for
+   updating the display of WebSRT timed tracks</a>).</li>
+
   </ol><p>When a <a href=#media-element>media element</a> is <a href=#remove-an-element-from-a-document title="remove an
   element from a document">removed from a
   <code>Document</code></a>, if the <a href=#media-element>media element</a>'s
@@ -26025,7 +26059,10 @@
 
    <dd>
 
-    <p>A list of <a href=#timed-track-cue title="timed track cue">timed track cues</a>.</p>
+    <p>A list of <a href=#timed-track-cue title="timed track cue">timed track
+    cues</a>, along with rules for their rendering (e.g., for
+    <a href=#websrt>WebSRT</a>, the <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of
+    WebSRT timed tracks</a>).</p>
 
     <p>The <a href=#timed-track-list-of-cues title="timed track list of cues">list of cues of a
     timed track</a> can change dynamically, either because the
@@ -26180,7 +26217,41 @@
   cue</a> is associated with a particular <a href=#timed-track>timed track</a>,
   the association is permanent.</p>
 
+  <p>In addition, each <a href=#timed-track-cue>timed track cue</a> has two pieces of
+  dynamic information:</p>
 
+  <dl><dt>The <dfn id=timed-track-cue-active-flag title="timed track cue active flag">active flag</dfn>
+   <dd>
+    <p>This flag must be initially unset. It is used to ensure events
+    are fired appropriately when the cue becomes active or
+    inactive.</p>
+   </dd>
+
+   <dt>The <dfn id=timed-track-cue-display-state title="timed track cue display state">display state</dfn>
+   <dd>
+    <p>This is used as part of the rendering model.</p>
+   </dd>
+
+  </dl><p>The <a href=#timed-track-cue title="timed track cue">timed track cues</a> of a
+  <a href=#media-element>media element</a>'s <a href=#timed-track title="timed track">timed
+  tracks</a> are ordered relative to each other in the <dfn id=timed-track-cue-order>timed
+  track cue order</dfn>, which is determined as follows: first group
+  the <a href=#timed-track-cue title="timed track cue">cues</a> by their <a href=#timed-track>timed
+  track</a>, with the groups being sorted in the same order as
+  their <a href=#timed-track title="timed track">timed tracks</a> appear in the
+  <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a>;
+  then, within each group, <a href=#timed-track-cue title="timed track cue">cues</a>
+  must be sorted by their <a href=#timed-track-cue-start-time title="timed track cue start
+  time">start time</a>, earliest first; then, any <a href=#timed-track-cue title="timed track cue">cues</a> with the same <a href=#timed-track-cue-start-time title="timed
+  track cue start time">start time</a> must be sorted by their
+  <a href=#timed-track-cue-end-time title="timed track cue end time">end time</a>, earliest
+  first; and finally, any <a href=#timed-track-cue title="timed track cue">cues</a>
+  with identical <a href=#timed-track-cue-end-time title="timed track cue end time">end
+  times</a> must be sorted in the order they were created (so
+  e.g. for cues from a <a href=#websrt>WebSRT</a> file, that would be the
+  order in which the cues were listed in the file).</p>
+
+
   <h6 id=sourcing-in-band-timed-tracks><span class=secno>4.8.10.10.2 </span>Sourcing in-band timed tracks</h6>
 
   <p>A <dfn id=media-resource-specific-timed-track>media-resource-specific timed track</dfn> is a <a href=#timed-track>timed
@@ -26561,6 +26632,8 @@
   // timed tracks
   readonly attribute <span>TimedTrack</span>[] <span title="dom-media-tracks">tracks</span>;
   <span>MutableTimedTrack</span> <span title="dom-media-addTrack">addTrack</span>(in DOMString label, in DOMString kind, in DOMString language);
+
+ - addTrack should add it as Loaded, Disabled, and with the rules for WebSRT.
 -->
 
   <pre class=idl>interface <dfn id=timedtrack>TimedTrack</dfn> {
@@ -26583,8 +26656,8 @@
 
   readonly attribute <a href=#timedtrackcuelist>TimedTrackCueList</a> <span title=dom-TimedTrack-cues>cues</span>;
   readonly attribute <a href=#timedtrackcuelist>TimedTrackCueList</a> <span title=dom-TimedTrack-activeCues>activeCues</span>;
-  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrack-onentercue>onentercue</span>;
-  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrack-onexitcue>onexitcue</span>;
+
+  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrack-oncuechange>oncuechange</span>;
 };
 
 interface <dfn id=mutabletimedtrack>MutableTimedTrack</dfn> : <a href=#timedtrack>TimedTrack</a> {
@@ -26617,12 +26690,31 @@
   readonly attribute DOMString <span title=dom-TimedTrackCue-voice>voice</span>;
   DOMString <span title=dom-TimedTrackCue-getCueAsSource()>getCueAsSource</span>();
   <a href=#documentfragment>DocumentFragment</a> <span title=dom-TimedTrackCue-getCueAsHTML()>getCueAsHTML</span>();
+
+  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrackCue-onenter>onenter</span>;
+  readonly attribute <a href=#function>Function</a> <span title=dom-TimedTrackCue-onexit>onexit</span>;
 };</pre>
 
-  <p class=XXX>domintro
+  <dl class=domintro><dt><var title="">media</var> . <code title=dom-media-tracks>tracks</code> . <code title="">length</code></dt>
+   <dd>
+    <p>Returns the number of timed tracks associated with the element (e.g. from <code><a href=#the-track-element>track</a></code> elements).</p>
+   </dd>
 
-  <div class=impl>
+   <dt><var title="">media</var> . <code title=dom-media-tracks>tracks[<var title="">n</var>]</code></dt>
+   <dd>
+    <p>Returns the <code><a href=#timedtrack>TimedTrack</a></code> object representing the <var title="">n</var>th timed track.</p>
+   </dd>
 
+   <dt><var title="">track</var> . <code title=dom-track-track><a href=#dom-track-track>track</a></code></dt>
+   <dd>
+    <p>Returns the <code><a href=#timedtrack>TimedTrack</a></code> object representing the <code><a href=#the-track-element>track</a></code> element's timed track.</p>
+   </dd>
+
+   <dt class=XXX>...</dt>
+   <dd class=XXX>...</dd>
+
+  </dl><div class=impl>
+
   <p class=XXX>...
 
   <!-- XXX
@@ -26634,6 +26726,10 @@
   entirely prior to the <span>media resource</span>'s <span>earliest
   possible position</span>.</p>
 
+  changing dom-TimedTrack-mode to disabled/hidden should hide all the
+  titles, changing it to showing should show them. (Only 'showing'
+  tracks get updated automatically.)
+
   -->
 
   </div>
@@ -26643,12 +26739,7 @@
 
   <p class=XXX>...
 
-<!-- XXX
-CueEvent
- readonly attribute TimedTrackCue cue;
--->
 
-
   <h5 id=websrt-0><span class=secno>4.8.10.11 </span>WebSRT</h5>
 
   <p>The <dfn id=websrt>WebSRT</dfn> format (Web Subtitle Resource Tracks) is a
@@ -56250,6 +56341,9 @@
            attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
            attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+<!--TT-->
+           attribute <a href=#function>Function</a> <a href=#handler-oncuechange title=handler-oncuechange>oncuechange</a>;
+<!--TT-->
            attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
            attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
@@ -62526,6 +62620,9 @@
     <tr><td><dfn id=handler-onchange title=handler-onchange><code>onchange</code></dfn> <td> <code title=event-change>change</code> <!-- widely used -->
     <tr><td><dfn id=handler-onclick title=handler-onclick><code>onclick</code></dfn> <td> <code title=event-click><a href=#event-click>click</a></code> <!-- widely used -->
     <tr><td><dfn id=handler-oncontextmenu title=handler-oncontextmenu><code>oncontextmenu</code></dfn> <td> <code title=event-contextmenu>contextmenu</code> <!-- widely used -->
+<!--TT-->
+    <tr><td><dfn id=handler-oncuechange title=handler-oncuechange><code>oncuechange</code></dfn> <td> <code title=event-cuechange>cuechange</code>
+<!--TT-->
     <tr><td><dfn id=handler-ondblclick title=handler-ondblclick><code>ondblclick</code></dfn> <td> <code title=event-dblclick>dblclick</code> <!-- widely used -->
     <tr><td><dfn id=handler-ondrag title=handler-ondrag><code>ondrag</code></dfn> <td> <code title=event-drag><a href=#event-drag>drag</a></code>
     <tr><td><dfn id=handler-ondragend title=handler-ondragend><code>ondragend</code></dfn> <td> <code title=event-dragend><a href=#event-dragend>dragend</a></code>
@@ -78835,7 +78932,7 @@
 
   <h5 id=websrt-cue-text-rendering-rules><span class=secno>12.3.2.1 </span><dfn>WebSRT cue text rendering rules</dfn></h5>
 
-  <p class=XXX>
+  <p class=XXX>The <dfn id=rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed tracks</dfn>
 
   <!--
 
@@ -84435,6 +84532,12 @@
      <td> <a href=#handler-oncontextmenu title=handler-oncontextmenu>HTML elements</a>
      <td> <code title=event-contextmenu>contextmenu</code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
+<!--TT-->
+    <tr><th> <code title="">oncuechange</code>
+     <td> <a href=#handler-oncuechange title=handler-oncuechange>HTML elements</a>
+     <td> <code title=event-cuechange>cuechange</code> event handler
+     <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
+<!--TT-->
 
     <tr><th> <code title="">ondblclick</code>
      <td> <a href=#handler-ondblclick title=handler-ondblclick>HTML elements</a>

Modified: source
===================================================================
--- source	2010-07-01 23:23:47 UTC (rev 5131)
+++ source	2010-07-02 22:57:06 UTC (rev 5132)
@@ -7750,6 +7750,9 @@
            attribute <span>Function</span> <span title="handler-onchange">onchange</span>;
            attribute <span>Function</span> <span title="handler-onclick">onclick</span>;
            attribute <span>Function</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
+<!--END w3c-html--><!--TT-->
+           attribute <span>Function</span> <span title="handler-oncuechange">oncuechange</span>;
+<!--START w3c-html--><!--TT-->
            attribute <span>Function</span> <span title="handler-ondblclick">ondblclick</span>;
            attribute <span>Function</span> <span title="handler-ondrag">ondrag</span>;
            attribute <span>Function</span> <span title="handler-ondragend">ondragend</span>;
@@ -8894,6 +8897,9 @@
            attribute <span>Function</span> <span title="handler-onchange">onchange</span>;
            attribute <span>Function</span> <span title="handler-onclick">onclick</span>;
            attribute <span>Function</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
+<!--END w3c-html--><!--TT-->
+           attribute <span>Function</span> <span title="handler-oncuechange">oncuechange</span>;
+<!--START w3c-html--><!--TT-->
            attribute <span>Function</span> <span title="handler-ondblclick">ondblclick</span>;
            attribute <span>Function</span> <span title="handler-ondrag">ondrag</span>;
            attribute <span>Function</span> <span title="handler-ondragend">ondragend</span>;
@@ -9003,6 +9009,9 @@
    <li><code title="handler-onchange">onchange</code></li>
    <li><code title="handler-onclick">onclick</code></li>
    <li><code title="handler-oncontextmenu">oncontextmenu</code></li>
+<!--END w3c-html--><!--TT-->
+   <li><code title="handler-oncuechange">oncuechange</code></li>
+<!--START w3c-html--><!--TT-->
    <li><code title="handler-ondblclick">ondblclick</code></li>
    <li><code title="handler-ondrag">ondrag</code></li>
    <li><code title="handler-ondragend">ondragend</code></li>
@@ -27764,27 +27773,33 @@
   agent must wait for the steps to complete, and then must immediately
   rerun the steps. (These steps are thus run as often as possible or
   needed — if one iteration takes a long time, this can cause
-  certain ranges to be skipped over as the user agent rushes ahead to
-  "catch up".)</p>
+  certain <span title="timed track cue">cues</span> to be skipped over
+  as the user agent rushes ahead to "catch up".)</p>
 
   <ol>
 
-<!--XXXTT - the text below is wrong, but we need to do something similar, updating the timed tracks, pausing if necessary (more below)
-   <li><p>Let <var title="">current ranges</var> be an ordered list of
-   <span title="cue range">cue ranges</span>, initialized to contain
-   all the <span title="cue range">cue ranges</span> of the
-   <span>media element</span> whose start times are less than or equal
-   to the <span>current playback position</span> and whose end times
-   are greater than the <span>current playback position</span>, in the
-   order they were added to the element.</p></li>
+   <li><p>Let <var title="">current cues</var> be an ordered list of
+   <span title="timed track cue">cues</span>, initialized to contain
+   all the <span title="timed track cue">cues</span> of all the <span
+   title="timed track hidden">hidden</span> or <span title="timed
+   track showing">showing</span> <span title="timed track">timed
+   tracks</span> of the <span>media element</span> (not not the <span
+   title="timed track disabled">disabled</span> ones) whose <span
+   title="timed track cue start time">start times</span> are less than
+   or equal to the <span>current playback position</span> and whose
+   <span title="timed track cue end time">end times</span> are greater
+   than the <span>current playback position</span>, in <span>timed
+   track cue order</span>.</p></li>
 
-   <li><p>Let <var title="">other ranges</var> be an ordered list of
-   <span title="cue range">cue ranges</span>, initialized to contain
-   all the <span title="cue range">cue ranges</span> of the
-   <span>media element</span> that are not present in <var
-   title="">current ranges</var>, in the order they were added to the
-   element.</p></li>
--->
+   <li><p>Let <var title="">other cues</var> be an ordered list of
+   <span title="timed track cue">cues</span>, initialized to contain
+   all the <span title="timed track cue">cues</span> of <span
+   title="timed track hidden">hidden</span> and <span title="timed
+   track showing">showing</span> <span title="timed track">timed
+   tracks</span> of the <span>media element</span> that are not
+   present in <var title="">current cues</var>, also in <span>timed
+   track cue order</span>.</p></li>
+
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and if the
    user agent has not fired a <code
@@ -27805,47 +27820,78 @@
    not any more frequent than the user agent can comfortably handle
    while decoding the video.</p></li>
 
-<!--XXXTT [beware - - nested comments]
-   <li><p>If none of the <span title="cue range">cue ranges</span> in
-   <var title="">current ranges</var> have their "active" boolean set
-   to "false" (inactive) and none of the <span title="cue range">cue
-   ranges</span> in <var title="">other ranges</var> have their
-   "active" boolean set to "true" (active), then abort these
+   <li><p>If all of the <span title="timed track cue">cues</span> in
+   <var title="">current cues</var> have their <span>timed track cue
+   active flag</span> set, and none of the <span title="timed track
+   cue">cues</span> in <var title="">other cues</var> have their
+   <span>timed track cue active flag</span> set, then abort these
    steps.</p></li>
 
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and there
-   are <span title="cue range">cue ranges</span> in <var
-   title="">other ranges</var> that have both their "active" boolean
-   and their "pause" boolean set to "true", then immediately act as if
-   the element's <code title="dom-media-pause">pause()</code> method
-   had been invoked. <!- - 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 exiting a cue range, even if that
-   cue range has its "pause" boolean set to "true".)</p></li>
+   are <span title="timed track cue">cues</span> in <var
+   title="">other cues</var> that have both their <span>timed track
+   cue active flag</span> set and their <span>timed track cue
+   pause-on-exit flag</span> set, then immediately act as if the
+   element's <code title="dom-media-pause">pause()</code> method had
+   been invoked. <!-- 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="timed track cue">cue</span>, even if that <span title="timed
+   track cue">cue</span> has its <span>timed track cue pause-on-exit
+   flag</span> set.)</p></li>
 
-   <li><p>For each non-null "exit" callback of the <span
-   title="cue range">cue ranges</span> in <var title="">other
-   ranges</var> that have their "active" boolean set to "true"
-   (active), in list order, <span>queue a task</span> that invokes the
-   callback, passing the cue range's identifier as the callback's only
-   argument.</p></li>
+   <li><p>Let <var title="">affected tracks</var> be a list of <span
+   title="timed track">timed tracks</span>, initially empty.</p></li>
 
-   <li><p>For each non-null "enter" callback of the <span title="cue
-   range">cue ranges</span> in <var title="">current ranges</var> that
-   have their "active" boolean set to "false" (inactive), in list
-   order, <span>queue a task</span> that invokes the callback, passing
-   the cue range's identifier as the callback's only
-   argument.</p></li>
+   <li><p>For each <span title="timed track cue">timed track
+   cue</span> in <var title="">other cues</var> that has its
+   <span>timed 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>TimedTrackCue</code> object, and add the <span title="timed
+   track cue">cue</span>'s <span>timed track</span> to <var
+   title="">affected tracks</var>, if it's not already in the
+   list.</p></li>
 
-   <li><p>Set the "active" boolean of all the <span title="cue
-   range">cue ranges</span> in the <var title="">current ranges</var>
-   list to "true" (active), and the "active" boolean of all the <span
-   title="cue range">cue ranges</span> in the <var title="">other
-   ranges</var> list to "false" (inactive).</p></li>
--->
+   <li><p>For each <span title="timed track cue">timed track
+   cue</span> in <var title="">current cues</var> that does not have
+   its <span>timed 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>TimedTrackCue</code> object, and add the <span title="timed
+   track cue">cue</span>'s <span>timed track</span> to <var
+   title="">affected tracks</var>, if it's not already in the
+   list.</p></li>
+
+   <li><p>For each <span>timed 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="timed track">timed
+   tracks</span> in the <span>media element</span>'s <span>list of
+   timed tracks</span>), <span>queue a task</span> to <span>fire a
+   simple event</span> named <code
+   title="event-cuechange">cuechange</code> at the
+   <code>TimedTrack</code> object, and, if the <span>timed
+   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>
+
+   <li><p>Set the <span>timed track cue active flag</span> of all the
+   <span title="timed track cue">cues</span> in the <var
+   title="">current cues</var>, and unset the <span>timed track cue
+   active flag</span> of all the <span title="timed track
+   cue">cues</span> in the <var title="">other cues</var>.</p></li>
+
+   <li><p>Run the rules for rendering the cues of each of the <span
+   title="timed track">timed tracks</span> in <var title="">affected
+   tracks</var> that are <span title="timed track
+   showing">showing</span> (e.g., for <span title="timed track">timed
+   tracks</span> based on <span>WebSRT</span>, the <span>rules for
+   updating the display of WebSRT timed tracks</span>).</p></li>
+
   </ol>
 
   <p>When a <span>media element</span> is <span title="remove an
@@ -28237,7 +28283,10 @@
 
    <dd>
 
-    <p>A list of <span title="timed track cue">timed track cues</span>.</p>
+    <p>A list of <span title="timed track cue">timed track
+    cues</span>, along with rules for their rendering (e.g., for
+    <span>WebSRT</span>, the <span>rules for updating the display of
+    WebSRT timed tracks</span>).</p>
 
     <p>The <span title="timed track list of cues">list of cues of a
     timed track</span> can change dynamically, either because the
@@ -28403,7 +28452,46 @@
   cue</span> is associated with a particular <span>timed track</span>,
   the association is permanent.</p>
 
+  <p>In addition, each <span>timed track cue</span> has two pieces of
+  dynamic information:</p>
 
+  <dl>
+
+   <dt>The <dfn title="timed track cue active flag">active flag</dfn>
+   <dd>
+    <p>This flag must be initially unset. It is used to ensure events
+    are fired appropriately when the cue becomes active or
+    inactive.</p>
+   </dd>
+
+   <dt>The <dfn title="timed track cue display state">display state</dfn>
+   <dd>
+    <p>This is used as part of the rendering model.</p>
+   </dd>
+
+  </dl>
+
+  <p>The <span title="timed track cue">timed track cues</span> of a
+  <span>media element</span>'s <span title="timed track">timed
+  tracks</span> are ordered relative to each other in the <dfn>timed
+  track cue order</dfn>, which is determined as follows: first group
+  the <span title="timed track cue">cues</span> by their <span>timed
+  track</span>, with the groups being sorted in the same order as
+  their <span title="timed track">timed tracks</span> appear in the
+  <span>media element</span>'s <span>list of timed tracks</span>;
+  then, within each group, <span title="timed track cue">cues</span>
+  must be sorted by their <span title="timed track cue start
+  time">start time</span>, earliest first; then, any <span
+  title="timed track cue">cues</span> with the same <span title="timed
+  track cue start time">start time</span> must be sorted by their
+  <span title="timed track cue end time">end time</span>, earliest
+  first; and finally, any <span title="timed track cue">cues</span>
+  with identical <span title="timed track cue end time">end
+  times</span> must be sorted in the order they were created (so
+  e.g. for cues from a <span>WebSRT</span> file, that would be the
+  order in which the cues were listed in the file).</p>
+
+
   <h6>Sourcing in-band timed tracks</h6>
 
   <p>A <dfn>media-resource-specific timed track</dfn> is a <span>timed
@@ -28839,6 +28927,8 @@
   // timed tracks
   readonly attribute <span>TimedTrack</span>[] <span title="dom-media-tracks">tracks</span>;
   <span>MutableTimedTrack</span> <span title="dom-media-addTrack">addTrack</span>(in DOMString label, in DOMString kind, in DOMString language);
+
+ - addTrack should add it as Loaded, Disabled, and with the rules for WebSRT.
 -->
 
   <pre class="idl">interface <dfn>TimedTrack</dfn> {
@@ -28861,8 +28951,8 @@
 
   readonly attribute <span>TimedTrackCueList</span> <span title="dom-TimedTrack-cues">cues</span>;
   readonly attribute <Span>TimedTrackCueList</span> <span title="dom-TimedTrack-activeCues">activeCues</span>;
-  readonly attribute <span>Function</span> <span title="dom-TimedTrack-onentercue">onentercue</span>;
-  readonly attribute <span>Function</span> <span title="dom-TimedTrack-onexitcue">onexitcue</span>;
+
+  readonly attribute <span>Function</span> <span title="dom-TimedTrack-oncuechange">oncuechange</span>;
 };
 
 interface <dfn>MutableTimedTrack</dfn> : <span>TimedTrack</span> {
@@ -28895,10 +28985,33 @@
   readonly attribute DOMString <span title="dom-TimedTrackCue-voice">voice</span>;
   DOMString <span title="dom-TimedTrackCue-getCueAsSource()">getCueAsSource</span>();
   <span>DocumentFragment</span> <span title="dom-TimedTrackCue-getCueAsHTML()">getCueAsHTML</span>();
+
+  readonly attribute <span>Function</span> <span title="dom-TimedTrackCue-onenter">onenter</span>;
+  readonly attribute <span>Function</span> <span title="dom-TimedTrackCue-onexit">onexit</span>;
 };</pre>
 
-  <p class="XXX">domintro
+  <dl class="domintro">
 
+   <dt><var title="">media</var> . <code title="dom-media-tracks">tracks</code> . <code title="">length</code></dt>
+   <dd>
+    <p>Returns the number of timed tracks associated with the element (e.g. from <code>track</code> elements).</p>
+   </dd>
+
+   <dt><var title="">media</var> . <code title="dom-media-tracks">tracks[<var title="">n</var>]</code></dt>
+   <dd>
+    <p>Returns the <code>TimedTrack</code> object representing the <var title="">n</var>th timed track.</p>
+   </dd>
+
+   <dt><var title="">track</var> . <code title="dom-track-track">track</code></dt>
+   <dd>
+    <p>Returns the <code>TimedTrack</code> object representing the <code>track</code> element's timed track.</p>
+   </dd>
+
+   <dt class="XXX">...</dt>
+   <dd class="XXX">...</dd>
+
+  </dl>
+
   <div class="impl">
 
   <p class="XXX">...
@@ -28912,6 +29025,10 @@
   entirely prior to the <span>media resource</span>'s <span>earliest
   possible position</span>.</p>
 
+  changing dom-TimedTrack-mode to disabled/hidden should hide all the
+  titles, changing it to showing should show them. (Only 'showing'
+  tracks get updated automatically.)
+
   -->
 
   </div>
@@ -28921,12 +29038,7 @@
 
   <p class="XXX">...
 
-<!-- XXX
-CueEvent
- readonly attribute TimedTrackCue cue;
--->
 
-
   <h5>WebSRT</h5>
 
   <p>The <dfn>WebSRT</dfn> format (Web Subtitle Resource Tracks) is a
@@ -63529,6 +63641,9 @@
            attribute <span>Function</span> <span title="handler-onchange">onchange</span>;
            attribute <span>Function</span> <span title="handler-onclick">onclick</span>;
            attribute <span>Function</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
+<!--END w3c-html--><!--TT-->
+           attribute <span>Function</span> <span title="handler-oncuechange">oncuechange</span>;
+<!--START w3c-html--><!--TT-->
            attribute <span>Function</span> <span title="handler-ondblclick">ondblclick</span>;
            attribute <span>Function</span> <span title="handler-ondrag">ondrag</span>;
            attribute <span>Function</span> <span title="handler-ondragend">ondragend</span>;
@@ -70807,6 +70922,9 @@
     <tr><td><dfn title="handler-onchange"><code>onchange</code></dfn> <td> <code title="event-change">change</code> <!-- widely used -->
     <tr><td><dfn title="handler-onclick"><code>onclick</code></dfn> <td> <code title="event-click">click</code> <!-- widely used -->
     <tr><td><dfn title="handler-oncontextmenu"><code>oncontextmenu</code></dfn> <td> <code title="event-contextmenu">contextmenu</code> <!-- widely used -->
+<!--END w3c-html--><!--TT-->
+    <tr><td><dfn title="handler-oncuechange"><code>oncuechange</code></dfn> <td> <code title="event-cuechange">cuechange</code>
+<!--START w3c-html--><!--TT-->
     <tr><td><dfn title="handler-ondblclick"><code>ondblclick</code></dfn> <td> <code title="event-dblclick">dblclick</code> <!-- widely used -->
     <tr><td><dfn title="handler-ondrag"><code>ondrag</code></dfn> <td> <code title="event-drag">drag</code>
     <tr><td><dfn title="handler-ondragend"><code>ondragend</code></dfn> <td> <code title="event-dragend">dragend</code>
@@ -97607,7 +97725,7 @@
 
   <h5><dfn>WebSRT cue text rendering rules</dfn></h5>
 
-  <p class="XXX">
+  <p class="XXX">The <dfn>rules for updating the display of WebSRT timed tracks</dfn>
 
   <!--
 
@@ -104260,6 +104378,13 @@
      <td> <span title="handler-oncontextmenu">HTML elements</span>
      <td> <code title="event-contextmenu">contextmenu</code> event handler
      <td> <span title="event handler content attributes">Event handler content attribute</span>
+<!--END w3c-html--><!--TT-->
+    <tr>
+     <th> <code title="">oncuechange</code>
+     <td> <span title="handler-oncuechange">HTML elements</span>
+     <td> <code title="event-cuechange">cuechange</code> event handler
+     <td> <span title="event handler content attributes">Event handler content attribute</span>
+<!--START w3c-html--><!--TT-->
 
     <tr>
      <th> <code title="">ondblclick</code>




More information about the Commit-Watchers mailing list