[html5] r5147 - [giow] (0) Captions - Stage 21.1: rendering: the beginning.

whatwg at whatwg.org whatwg at whatwg.org
Fri Jul 9 12:29:59 PDT 2010


Author: ianh
Date: 2010-07-09 12:29:58 -0700 (Fri, 09 Jul 2010)
New Revision: 5147

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Captions - Stage 21.1: rendering: the beginning.

Modified: complete.html
===================================================================
--- complete.html	2010-07-09 00:26:29 UTC (rev 5146)
+++ complete.html	2010-07-09 19:29:58 UTC (rev 5147)
@@ -23132,6 +23132,14 @@
   particular playback position is defined by the video stream's
   format.</p>
 
+<!--TT-->
+  <p>The <code><a href=#video>video</a></code> element also <a href=#represents>represents</a> any
+  <a href=#timed-track-cue title="timed track cue">timed track cues</a> whose
+  <a href=#timed-track-cue-active-flag>timed track cue active flag</a> is set and whose
+  <a href=#timed-track>timed track</a> is in the <a href=#timed-track-showing title="timed track
+  showing">showing</a> mode.</p>
+<!--TT-->
+
   <p>In addition to the above, the user agent may provide messages to
   the user (such as "buffering", "no video loaded", "error", or more
   detailed information) by overlaying text or icons on the video or
@@ -25691,12 +25699,15 @@
   agent must run the following steps. If the <a href=#current-playback-position>current playback
   position</a> changes while the steps are running, then the user
   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 <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>
+  rerun the steps.
+<!--TT-->
+  (These steps are thus run as often as possible or needed — if
+  one iteration takes a long time, this can cause 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".)
+<!--TT-->
+  </p>
 
-  <ol><li><p>Let <var title="">current cues</var> be an ordered list of
+  <ol><!--TT--><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
@@ -25713,6 +25724,7 @@
    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>
+<!--TT-->
 
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and if the
@@ -25732,6 +25744,7 @@
    not any more frequent than the user agent can comfortably handle
    while decoding the video.</li>
 
+<!--TT-->
    <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
@@ -25789,13 +25802,20 @@
    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>
+   <li><p>Run the <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed track
+   rendering</a> 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>
+<!--TT-->
 
-  </ol><p>When a <a href=#media-element>media element</a> is <a href=#remove-an-element-from-a-document title="remove an
+  </ol><!--TT--><p>For the purposes of the algorithm above, a <a href=#timed-track-cue>timed track
+  cue</a> is considered to of a <a href=#timed-track>timed track</a> only if it
+  is listed in the <a href=#timed-track-list-of-cues>timed track list of cues</a>, not merely
+  if it is associated with the <a href=#timed-track>timed track</a>.</p>
+<!--TT-->
+
+  <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
   <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
@@ -26296,9 +26316,28 @@
 
   <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>
+
+    <p>This flag must be initially unset.  The flag is used to ensure
+    events are fired appropriately when the cue becomes active or
+    inactive, and to make sure the right cues are rendered.</p>
+
+    <p>The user agent must synchronously unset this flag whenever the
+    <a href=#timed-track-cue>timed track cue</a> is removed from its <a href=#timed-track>timed
+    track</a>'s <a href=#timed-track-list-of-cues>timed track list of cues</a>; whenever the
+    <a href=#timed-track>timed track</a> itself is removed from its <a href=#media-element>media
+    element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a> or has its
+    <a href=#timed-track-mode>timed track mode</a> changed to <a href=#timed-track-disabled title="timed track
+    disabled">disabled</a>; and whenever the <a href=#media-element>media
+    element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is changed back to
+    <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>. When the
+    flag is unset in this way for one or more cues in <a href=#timed-track title="timed track">timed tracks</a> that were <a href=#timed-track-showing title="timed track showing">showing</a> prior to the relevant
+    incident, the user agent must, after having unset the flag for all
+    the affected cues, apply the <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed
+    track rendering</a> of those <a href=#timed-track title="timed track">timed
+    tracks</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>).</p>
+
    </dd>
 
    <dt>The <dfn id=timed-track-cue-display-state title="timed track cue display state">display state</dfn>
@@ -26888,11 +26927,6 @@
     track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents to
     the <a href=#timed-track-disabled>timed track disabled</a> mode.</p>
 
-    <p>If the <a href=#timed-track-mode>timed track mode</a> was previously the
-    <a href=#timed-track-showing>timed track showing</a> mode, then apply the rules for
-    updating the timed track rendering of the <a href=#media-element>media
-    element</a> appropriate for the <a href=#timed-track>timed track</a>.</p>
-
    </dd>
 
    <dt>If the new value is 1</dt>
@@ -26903,11 +26937,6 @@
     track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents to
     the <a href=#timed-track-hidden>timed track hidden</a> mode.</p>
 
-    <p>If the <a href=#timed-track-mode>timed track mode</a> was previously the
-    <a href=#timed-track-showing>timed track showing</a> mode, then apply the rules for
-    updating the timed track rendering of the <a href=#media-element>media
-    element</a> appropriate for the <a href=#timed-track>timed track</a>.</p>
-
    </dd>
 
    <dt>If the new value is 2</dt>
@@ -26918,10 +26947,6 @@
     track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents to
     the <a href=#timed-track-showing>timed track showing</a> mode.</p>
 
-    <p>Apply the rules for updating the timed track rendering of the
-    <a href=#media-element>media element</a> appropriate for the <a href=#timed-track>timed
-    track</a>.</p>
-
    </dd>
 
   </dl><p>If the <a href=#timed-track-mode>timed track mode</a> of the <a href=#timed-track>timed
@@ -26948,17 +26973,15 @@
   <code><a href=#timedtrackcuelist>TimedTrackCueList</a></code> object that represents the subset of
   the <a href=#timed-track-list-of-cues>timed track list of cues</a> of the <a href=#timed-track>timed
   track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents
-  whose <a href=#timed-track-cue-start-time title="timed track cue start time">start times</a>
-  occur before the <a href=#current-playback-position-when-the-script-started>current playback position when the script
-  started</a> and whose <a href=#timed-track-cue-end-time title="timed track cue end time">end
-  times</a> occur after the <a href=#current-playback-position-when-the-script-started>current playback position when
-  the script started</a>, in <a href=#timed-track-cue-order>timed track cue
-  order</a>. Otherwise, it must return null. When an object is
-  returned, the same object must be returned each time.</p>
+  whose <a href=#active-flag-was-set-when-the-script-started>active flag was set when the script started</a>, in
+  <a href=#timed-track-cue-order>timed 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=current-playback-position-when-the-script-started>current playback position when the script started</dfn>
-  is whatever the <a href=#current-playback-position>current playback position</a> was the last
-  time the <a href=#event-loop>event loop</a> reached step 1.</p>
+  <p>A <a href=#timed-track-cue>timed track cue</a>'s <dfn id=active-flag-was-set-when-the-script-started>active flag was set when
+  the script started</dfn> if its <a href=#timed-track-cue-active-flag>timed track cue active
+  flag</a> was set the last time the <a href=#event-loop>event loop</a>
+  reached step 1.</p>
 
   </div>
 
@@ -28797,11 +28820,7 @@
   user interface to the user</dfn>. This user interface should include
   features to begin playback, pause playback, seek to an arbitrary
   position in the content (if the content supports arbitrary seeking),
-  change the volume, change the display of closed captions
-
-  <!-- XXX update this to mention timed tracks -->
-
-  or embedded
+  change the volume, change the display of closed captions or embedded
   sign-language tracks, select different audio tracks or turn on audio
   descriptions, and show the media content in manners more suitable to
   the user (e.g. full-screen video or in an independent resizable
@@ -86339,23 +86358,69 @@
 
   <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>The <dfn id=rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed tracks</dfn>
+  <p>The <dfn id=rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed
+  tracks</dfn> render the <a href=#timed-track title="timed track">timed
+  tracks</a> of a <a href=#media-element>media element</a> (specifically, a
+  <code><a href=#video>video</a></code> element) by applying the steps below. All the
+  <a href=#timed-track title="timed track">timed tracks</a> that use these rules
+  for a given <a href=#media-element>media element</a> are rendered together, to
+  avoid overlapping subtitles from multiple tracks.</p>
 
-  <!--
+  <p>The output of the steps below is a set of CSS boxes that covers
+  the rendering area of the <code><a href=#video>video</a></code> element.</p>
 
-   list of active WebSRT or WebSRT-compatible cues and their positions
-   (different than a track's list of active cues)
+  <p>The rules are as follows:</p>
 
-   steps to run each time the current playback position changes, for
-   positioning:
-    - determine what cues are to be removed now
-    - remove them
-    - determine what cues are to be added now
-    - for each one:
+  <ol><li><p>If the <a href=#media-element>media element</a> is an <code><a href=#audio>audio</a></code>
+   element, abort these steps. There is nothing to render.</li>
+
+   <li><p>Let <var title="">output</var> be an empty list of
+   absolutely positioned CSS block boxes.</li>
+
+   <li><p>Let <var title="">tracks</var> be the subset of the
+   <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a> that
+   have as their <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed track
+   rendering</a> these <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of
+   WebSRT timed tracks</a>, and whose <a href=#timed-track-mode>timed track mode</a>
+   is <a href=#timed-track-showing title="timed track showing">showing</a>.</li>
+
+   <li><p>Let <var title="">cues</var> be an empty list of <a href=#timed-track-cue title="timed track cue">timed track cues</a>.</li>
+
+   <li><p>For each track <var title="">track</var> in <var title="">tracks</var>, append to <var title="">cues</var> all the
+   <a href=#timed-track-cue title="timed track cue">cues</a> from <var title="">track</var>'s <a href=#timed-track-list-of-cues title="timed track list of cues">list
+   of cues</a> that have their <a href=#timed-track-cue-active-flag>timed track cue active
+   flag</a> set.</li>
+
+   <li>
+
+    <p>Sort <var title="">cues</var> in <a href=#timed-track-cue-order>timed track cue
+    order</a>.</p>
+
+    <p class=note>If the tracks and cues in the previous steps were
+    added to the lists in the same order as the lists from which they
+    were sourced, the <var title="">cues</var> list will already be in
+    <a href=#timed-track-cue-order>timed track cue order</a>.</p>
+
+   </li>
+
+   <li><p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var> in <var title="">cues</var>: if <var title="">cue</var>'s <a href=#timed-track-cue-display-state>timed track cue display state</a> has
+   a set of CSS boxes, then add those boxes to <var title="">output</var>, and remove <var title="">cue</var> from <var title="">cues</var>.</li>
+
+   <li>
+
+    <p class=XXX>...</p>
+
+  <!--XXX
+      for each cue in cues:
        - find default position per http://damowmow.com/temp/srtspec
        - shunt it around to fit the current active ones
        - add it to the list
+  -->
 
+   </li>
+
+  </ol><!-- XXX
+
    rules for rendering the list of active cues:
     - for each segment, decide if it's before or after the current
       playback position.
@@ -86368,10 +86433,8 @@
    propagate towards the end of the segment so that it reaches the end
    of the segment when the next segment becomes "before".
 
-  -->
+  --><h5 id=css-extensions><span class=secno>14.3.2.2 </span>CSS extensions</h5>
 
-  <h5 id=css-extensions><span class=secno>14.3.2.2 </span>CSS extensions</h5>
-
   <p class=note>This section is intended to be moved to a CSS
   specification once an editor is found to run with it.</p>
 

Modified: index
===================================================================
--- index	2010-07-09 00:26:29 UTC (rev 5146)
+++ index	2010-07-09 19:29:58 UTC (rev 5147)
@@ -23059,6 +23059,14 @@
   particular playback position is defined by the video stream's
   format.</p>
 
+<!--TT-->
+  <p>The <code><a href=#video>video</a></code> element also <a href=#represents>represents</a> any
+  <a href=#timed-track-cue title="timed track cue">timed track cues</a> whose
+  <a href=#timed-track-cue-active-flag>timed track cue active flag</a> is set and whose
+  <a href=#timed-track>timed track</a> is in the <a href=#timed-track-showing title="timed track
+  showing">showing</a> mode.</p>
+<!--TT-->
+
   <p>In addition to the above, the user agent may provide messages to
   the user (such as "buffering", "no video loaded", "error", or more
   detailed information) by overlaying text or icons on the video or
@@ -25618,12 +25626,15 @@
   agent must run the following steps. If the <a href=#current-playback-position>current playback
   position</a> changes while the steps are running, then the user
   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 <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>
+  rerun the steps.
+<!--TT-->
+  (These steps are thus run as often as possible or needed — if
+  one iteration takes a long time, this can cause 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".)
+<!--TT-->
+  </p>
 
-  <ol><li><p>Let <var title="">current cues</var> be an ordered list of
+  <ol><!--TT--><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
@@ -25640,6 +25651,7 @@
    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>
+<!--TT-->
 
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and if the
@@ -25659,6 +25671,7 @@
    not any more frequent than the user agent can comfortably handle
    while decoding the video.</li>
 
+<!--TT-->
    <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
@@ -25716,13 +25729,20 @@
    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>
+   <li><p>Run the <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed track
+   rendering</a> 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>
+<!--TT-->
 
-  </ol><p>When a <a href=#media-element>media element</a> is <a href=#remove-an-element-from-a-document title="remove an
+  </ol><!--TT--><p>For the purposes of the algorithm above, a <a href=#timed-track-cue>timed track
+  cue</a> is considered to of a <a href=#timed-track>timed track</a> only if it
+  is listed in the <a href=#timed-track-list-of-cues>timed track list of cues</a>, not merely
+  if it is associated with the <a href=#timed-track>timed track</a>.</p>
+<!--TT-->
+
+  <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
   <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
@@ -26223,9 +26243,28 @@
 
   <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>
+
+    <p>This flag must be initially unset.  The flag is used to ensure
+    events are fired appropriately when the cue becomes active or
+    inactive, and to make sure the right cues are rendered.</p>
+
+    <p>The user agent must synchronously unset this flag whenever the
+    <a href=#timed-track-cue>timed track cue</a> is removed from its <a href=#timed-track>timed
+    track</a>'s <a href=#timed-track-list-of-cues>timed track list of cues</a>; whenever the
+    <a href=#timed-track>timed track</a> itself is removed from its <a href=#media-element>media
+    element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a> or has its
+    <a href=#timed-track-mode>timed track mode</a> changed to <a href=#timed-track-disabled title="timed track
+    disabled">disabled</a>; and whenever the <a href=#media-element>media
+    element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> is changed back to
+    <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>. When the
+    flag is unset in this way for one or more cues in <a href=#timed-track title="timed track">timed tracks</a> that were <a href=#timed-track-showing title="timed track showing">showing</a> prior to the relevant
+    incident, the user agent must, after having unset the flag for all
+    the affected cues, apply the <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed
+    track rendering</a> of those <a href=#timed-track title="timed track">timed
+    tracks</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>).</p>
+
    </dd>
 
    <dt>The <dfn id=timed-track-cue-display-state title="timed track cue display state">display state</dfn>
@@ -26815,11 +26854,6 @@
     track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents to
     the <a href=#timed-track-disabled>timed track disabled</a> mode.</p>
 
-    <p>If the <a href=#timed-track-mode>timed track mode</a> was previously the
-    <a href=#timed-track-showing>timed track showing</a> mode, then apply the rules for
-    updating the timed track rendering of the <a href=#media-element>media
-    element</a> appropriate for the <a href=#timed-track>timed track</a>.</p>
-
    </dd>
 
    <dt>If the new value is 1</dt>
@@ -26830,11 +26864,6 @@
     track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents to
     the <a href=#timed-track-hidden>timed track hidden</a> mode.</p>
 
-    <p>If the <a href=#timed-track-mode>timed track mode</a> was previously the
-    <a href=#timed-track-showing>timed track showing</a> mode, then apply the rules for
-    updating the timed track rendering of the <a href=#media-element>media
-    element</a> appropriate for the <a href=#timed-track>timed track</a>.</p>
-
    </dd>
 
    <dt>If the new value is 2</dt>
@@ -26845,10 +26874,6 @@
     track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents to
     the <a href=#timed-track-showing>timed track showing</a> mode.</p>
 
-    <p>Apply the rules for updating the timed track rendering of the
-    <a href=#media-element>media element</a> appropriate for the <a href=#timed-track>timed
-    track</a>.</p>
-
    </dd>
 
   </dl><p>If the <a href=#timed-track-mode>timed track mode</a> of the <a href=#timed-track>timed
@@ -26875,17 +26900,15 @@
   <code><a href=#timedtrackcuelist>TimedTrackCueList</a></code> object that represents the subset of
   the <a href=#timed-track-list-of-cues>timed track list of cues</a> of the <a href=#timed-track>timed
   track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents
-  whose <a href=#timed-track-cue-start-time title="timed track cue start time">start times</a>
-  occur before the <a href=#current-playback-position-when-the-script-started>current playback position when the script
-  started</a> and whose <a href=#timed-track-cue-end-time title="timed track cue end time">end
-  times</a> occur after the <a href=#current-playback-position-when-the-script-started>current playback position when
-  the script started</a>, in <a href=#timed-track-cue-order>timed track cue
-  order</a>. Otherwise, it must return null. When an object is
-  returned, the same object must be returned each time.</p>
+  whose <a href=#active-flag-was-set-when-the-script-started>active flag was set when the script started</a>, in
+  <a href=#timed-track-cue-order>timed 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=current-playback-position-when-the-script-started>current playback position when the script started</dfn>
-  is whatever the <a href=#current-playback-position>current playback position</a> was the last
-  time the <a href=#event-loop>event loop</a> reached step 1.</p>
+  <p>A <a href=#timed-track-cue>timed track cue</a>'s <dfn id=active-flag-was-set-when-the-script-started>active flag was set when
+  the script started</dfn> if its <a href=#timed-track-cue-active-flag>timed track cue active
+  flag</a> was set the last time the <a href=#event-loop>event loop</a>
+  reached step 1.</p>
 
   </div>
 
@@ -28724,11 +28747,7 @@
   user interface to the user</dfn>. This user interface should include
   features to begin playback, pause playback, seek to an arbitrary
   position in the content (if the content supports arbitrary seeking),
-  change the volume, change the display of closed captions
-
-  <!-- XXX update this to mention timed tracks -->
-
-  or embedded
+  change the volume, change the display of closed captions or embedded
   sign-language tracks, select different audio tracks or turn on audio
   descriptions, and show the media content in manners more suitable to
   the user (e.g. full-screen video or in an independent resizable
@@ -79580,23 +79599,69 @@
 
   <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>The <dfn id=rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed tracks</dfn>
+  <p>The <dfn id=rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed
+  tracks</dfn> render the <a href=#timed-track title="timed track">timed
+  tracks</a> of a <a href=#media-element>media element</a> (specifically, a
+  <code><a href=#video>video</a></code> element) by applying the steps below. All the
+  <a href=#timed-track title="timed track">timed tracks</a> that use these rules
+  for a given <a href=#media-element>media element</a> are rendered together, to
+  avoid overlapping subtitles from multiple tracks.</p>
 
-  <!--
+  <p>The output of the steps below is a set of CSS boxes that covers
+  the rendering area of the <code><a href=#video>video</a></code> element.</p>
 
-   list of active WebSRT or WebSRT-compatible cues and their positions
-   (different than a track's list of active cues)
+  <p>The rules are as follows:</p>
 
-   steps to run each time the current playback position changes, for
-   positioning:
-    - determine what cues are to be removed now
-    - remove them
-    - determine what cues are to be added now
-    - for each one:
+  <ol><li><p>If the <a href=#media-element>media element</a> is an <code><a href=#audio>audio</a></code>
+   element, abort these steps. There is nothing to render.</li>
+
+   <li><p>Let <var title="">output</var> be an empty list of
+   absolutely positioned CSS block boxes.</li>
+
+   <li><p>Let <var title="">tracks</var> be the subset of the
+   <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a> that
+   have as their <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed track
+   rendering</a> these <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of
+   WebSRT timed tracks</a>, and whose <a href=#timed-track-mode>timed track mode</a>
+   is <a href=#timed-track-showing title="timed track showing">showing</a>.</li>
+
+   <li><p>Let <var title="">cues</var> be an empty list of <a href=#timed-track-cue title="timed track cue">timed track cues</a>.</li>
+
+   <li><p>For each track <var title="">track</var> in <var title="">tracks</var>, append to <var title="">cues</var> all the
+   <a href=#timed-track-cue title="timed track cue">cues</a> from <var title="">track</var>'s <a href=#timed-track-list-of-cues title="timed track list of cues">list
+   of cues</a> that have their <a href=#timed-track-cue-active-flag>timed track cue active
+   flag</a> set.</li>
+
+   <li>
+
+    <p>Sort <var title="">cues</var> in <a href=#timed-track-cue-order>timed track cue
+    order</a>.</p>
+
+    <p class=note>If the tracks and cues in the previous steps were
+    added to the lists in the same order as the lists from which they
+    were sourced, the <var title="">cues</var> list will already be in
+    <a href=#timed-track-cue-order>timed track cue order</a>.</p>
+
+   </li>
+
+   <li><p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var> in <var title="">cues</var>: if <var title="">cue</var>'s <a href=#timed-track-cue-display-state>timed track cue display state</a> has
+   a set of CSS boxes, then add those boxes to <var title="">output</var>, and remove <var title="">cue</var> from <var title="">cues</var>.</li>
+
+   <li>
+
+    <p class=XXX>...</p>
+
+  <!--XXX
+      for each cue in cues:
        - find default position per http://damowmow.com/temp/srtspec
        - shunt it around to fit the current active ones
        - add it to the list
+  -->
 
+   </li>
+
+  </ol><!-- XXX
+
    rules for rendering the list of active cues:
     - for each segment, decide if it's before or after the current
       playback position.
@@ -79609,10 +79674,8 @@
    propagate towards the end of the segment so that it reaches the end
    of the segment when the next segment becomes "before".
 
-  -->
+  --><h5 id=css-extensions><span class=secno>12.3.2.2 </span>CSS extensions</h5>
 
-  <h5 id=css-extensions><span class=secno>12.3.2.2 </span>CSS extensions</h5>
-
   <p class=note>This section is intended to be moved to a CSS
   specification once an editor is found to run with it.</p>
 

Modified: source
===================================================================
--- source	2010-07-09 00:26:29 UTC (rev 5146)
+++ source	2010-07-09 19:29:58 UTC (rev 5147)
@@ -24732,6 +24732,14 @@
   particular playback position is defined by the video stream's
   format.</p>
 
+<!--END w3c-html--><!--TT-->
+  <p>The <code>video</code> element also <span>represents</span> any
+  <span title="timed track cue">timed track cues</span> whose
+  <span>timed track cue active flag</span> is set and whose
+  <span>timed track</span> is in the <span title="timed track
+  showing">showing</span> mode.</p>
+<!--START w3c-html--><!--TT-->
+
   <p>In addition to the above, the user agent may provide messages to
   the user (such as "buffering", "no video loaded", "error", or more
   detailed information) by overlaying text or icons on the video or
@@ -27772,13 +27780,18 @@
   agent must run the following steps. If the <span>current playback
   position</span> changes while the steps are running, then the user
   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 <span title="timed track cue">cues</span> to be skipped over
-  as the user agent rushes ahead to "catch up".)</p>
+  rerun the steps.
+<!--END w3c-html--><!--TT-->
+  (These steps are thus run as often as possible or needed — if
+  one iteration takes a long time, this can cause certain <span
+  title="timed track cue">cues</span> to be skipped over as the user
+  agent rushes ahead to "catch up".)
+<!--START w3c-html--><!--TT-->
+  </p>
 
   <ol>
 
+<!--END w3c-html--><!--TT-->
    <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
@@ -27800,6 +27813,7 @@
    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>
+<!--START w3c-html--><!--TT-->
 
    <li><p>If the time was reached through the usual monotonic increase
    of the current playback position during normal playback, and if the
@@ -27821,6 +27835,7 @@
    not any more frequent than the user agent can comfortably handle
    while decoding the video.</p></li>
 
+<!--END w3c-html--><!--TT-->
    <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
@@ -27886,15 +27901,24 @@
    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>
+   <li><p>Run the <span>rules for updating the timed track
+   rendering</span> 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>
+<!--START w3c-html--><!--TT-->
 
   </ol>
 
+<!--END w3c-html--><!--TT-->
+  <p>For the purposes of the algorithm above, a <span>timed track
+  cue</span> is considered to of a <span>timed track</span> only if it
+  is listed in the <span>timed track list of cues</span>, not merely
+  if it is associated with the <span>timed track</span>.</p>
+<!--START w3c-html--><!--TT-->
+
   <p>When a <span>media element</span> is <span title="remove an
   element from a document">removed from a
   <code>Document</code></span>, if the <span>media element</span>'s
@@ -28460,9 +28484,31 @@
 
    <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>
+
+    <p>This flag must be initially unset.  The flag is used to ensure
+    events are fired appropriately when the cue becomes active or
+    inactive, and to make sure the right cues are rendered.</p>
+
+    <p>The user agent must synchronously unset this flag whenever the
+    <span>timed track cue</span> is removed from its <span>timed
+    track</span>'s <span>timed track list of cues</span>; whenever the
+    <span>timed track</span> itself is removed from its <span>media
+    element</span>'s <span>list of timed tracks</span> or has its
+    <span>timed track mode</span> changed to <span title="timed track
+    disabled">disabled</span>; and whenever the <span>media
+    element</span>'s <code
+    title="dom-media-readyState">readyState</code> is changed back to
+    <code title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>. When the
+    flag is unset in this way for one or more cues in <span
+    title="timed track">timed tracks</span> that were <span
+    title="timed track showing">showing</span> prior to the relevant
+    incident, the user agent must, after having unset the flag for all
+    the affected cues, apply the <span>rules for updating the timed
+    track rendering</span> of those <span title="timed track">timed
+    tracks</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>
+
    </dd>
 
    <dt>The <dfn title="timed track cue display state">display state</dfn>
@@ -29135,11 +29181,6 @@
     track</span> that the <code>TimedTrack</code> object represents to
     the <span>timed track disabled</span> mode.</p>
 
-    <p>If the <span>timed track mode</span> was previously the
-    <span>timed track showing</span> mode, then apply the rules for
-    updating the timed track rendering of the <span>media
-    element</span> appropriate for the <span>timed track</span>.</p>
-
    </dd>
 
    <dt>If the new value is 1</dt>
@@ -29150,11 +29191,6 @@
     track</span> that the <code>TimedTrack</code> object represents to
     the <span>timed track hidden</span> mode.</p>
 
-    <p>If the <span>timed track mode</span> was previously the
-    <span>timed track showing</span> mode, then apply the rules for
-    updating the timed track rendering of the <span>media
-    element</span> appropriate for the <span>timed track</span>.</p>
-
    </dd>
 
    <dt>If the new value is 2</dt>
@@ -29165,10 +29201,6 @@
     track</span> that the <code>TimedTrack</code> object represents to
     the <span>timed track showing</span> mode.</p>
 
-    <p>Apply the rules for updating the timed track rendering of the
-    <span>media element</span> appropriate for the <span>timed
-    track</span>.</p>
-
    </dd>
 
   </dl>
@@ -29199,17 +29231,15 @@
   <code>TimedTrackCueList</code> object that represents the subset of
   the <span>timed track list of cues</span> of the <span>timed
   track</span> that the <code>TimedTrack</code> object represents
-  whose <span title="timed track cue start time">start times</span>
-  occur before the <span>current playback position when the script
-  started</span> and whose <span title="timed track cue end time">end
-  times</span> occur after the <span>current playback position when
-  the script started</span>, in <span>timed track cue
-  order</span>. Otherwise, it must return null. When an object is
-  returned, the same object must be returned each time.</p>
+  whose <span>active flag was set when the script started</span>, in
+  <span>timed 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>current playback position when the script started</dfn>
-  is whatever the <span>current playback position</span> was the last
-  time the <span>event loop</span> reached step 1.</p>
+  <p>A <span>timed track cue</span>'s <dfn>active flag was set when
+  the script started</dfn> if its <span>timed track cue active
+  flag</span> was set the last time the <span>event loop</span>
+  reached step 1.</p>
 
   </div>
 
@@ -31444,11 +31474,7 @@
   user interface to the user</dfn>. This user interface should include
   features to begin playback, pause playback, seek to an arbitrary
   position in the content (if the content supports arbitrary seeking),
-  change the volume, change the display of closed captions
-
-  <!-- XXX update this to mention timed tracks -->
-
-  or embedded
+  change the volume, change the display of closed captions or embedded
   sign-language tracks, select different audio tracks or turn on audio
   descriptions, and show the media content in manners more suitable to
   the user (e.g. full-screen video or in an independent resizable
@@ -98489,23 +98515,80 @@
 
   <h5><dfn>WebSRT cue text rendering rules</dfn></h5>
 
-  <p class="XXX">The <dfn>rules for updating the display of WebSRT timed tracks</dfn>
+  <p>The <dfn>rules for updating the display of WebSRT timed
+  tracks</dfn> render the <span title="timed track">timed
+  tracks</span> of a <span>media element</span> (specifically, a
+  <code>video</code> element) by applying the steps below. All the
+  <span title="timed track">timed tracks</span> that use these rules
+  for a given <span>media element</span> are rendered together, to
+  avoid overlapping subtitles from multiple tracks.</p>
 
-  <!--
+  <p>The output of the steps below is a set of CSS boxes that covers
+  the rendering area of the <code>video</code> element.</p>
 
-   list of active WebSRT or WebSRT-compatible cues and their positions
-   (different than a track's list of active cues)
+  <p>The rules are as follows:</p>
 
-   steps to run each time the current playback position changes, for
-   positioning:
-    - determine what cues are to be removed now
-    - remove them
-    - determine what cues are to be added now
-    - for each one:
+  <ol>
+
+   <li><p>If the <span>media element</span> is an <code>audio</code>
+   element, abort these steps. There is nothing to render.</p></li>
+
+   <li><p>Let <var title="">output</var> be an empty list of
+   absolutely positioned CSS block boxes.</p></li>
+
+   <li><p>Let <var title="">tracks</var> be the subset of the
+   <span>media element</span>'s <span>list of timed tracks</span> that
+   have as their <span>rules for updating the timed track
+   rendering</span> these <span>rules for updating the display of
+   WebSRT timed tracks</span>, and whose <span>timed track mode</span>
+   is <span title="timed track showing">showing</span>.</p></li>
+
+   <li><p>Let <var title="">cues</var> be an empty list of <span
+   title="timed track cue">timed track cues</span>.</p></li>
+
+   <li><p>For each track <var title="">track</var> in <var
+   title="">tracks</var>, append to <var title="">cues</var> all the
+   <span title="timed track cue">cues</span> from <var
+   title="">track</var>'s <span title="timed track list of cues">list
+   of cues</span> that have their <span>timed track cue active
+   flag</span> set.</p></li>
+
+   <li>
+
+    <p>Sort <var title="">cues</var> in <span>timed track cue
+    order</span>.</p>
+
+    <p class="note">If the tracks and cues in the previous steps were
+    added to the lists in the same order as the lists from which they
+    were sourced, the <var title="">cues</var> list will already be in
+    <span>timed track cue order</span>.</p>
+
+   </li>
+
+   <li><p>For each <span>timed track cue</span> <var
+   title="">cue</var> in <var title="">cues</var>: if <var
+   title="">cue</var>'s <span>timed track cue display state</span> has
+   a set of CSS boxes, then add those boxes to <var
+   title="">output</var>, and remove <var title="">cue</var> from <var
+   title="">cues</var>.</p></li>
+
+   <li>
+
+    <p class="XXX">...</p>
+
+  <!--XXX
+      for each cue in cues:
        - find default position per http://damowmow.com/temp/srtspec
        - shunt it around to fit the current active ones
        - add it to the list
+  -->
 
+   </li>
+
+  </ol>
+
+  <!-- XXX
+
    rules for rendering the list of active cues:
     - for each segment, decide if it's before or after the current
       playback position.




More information about the Commit-Watchers mailing list