[html5] r6428 - [acgiowt] (0) Make chapters support nesting. Fixing http://www.w3.org/Bugs/Publi [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Aug 11 23:34:43 PDT 2011


Author: ianh
Date: 2011-08-11 23:34:42 -0700 (Thu, 11 Aug 2011)
New Revision: 6428

Modified:
   complete.html
   index
   source
Log:
[acgiowt] (0) Make chapters support nesting.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12662

Modified: complete.html
===================================================================
--- complete.html	2011-08-11 22:31:00 UTC (rev 6427)
+++ complete.html	2011-08-12 06:34:42 UTC (rev 6428)
@@ -239,7 +239,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 11 August 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 12 August 2011</h2>
    </hgroup><dl><dt>Multiple-page version:</dt>
     <dd><a href=http://www.whatwg.org/specs/web-apps/current-work/complete/>http://www.whatwg.org/specs/web-apps/current-work/complete/</a></dd>
     <dt>One-page version:</dt>
@@ -587,7 +587,8 @@
          <li><a href=#guidelines-for-exposing-cues-in-various-formats-as-text-track-cues><span class=secno>4.8.10.12.4 </span>Guidelines for exposing cues in various formats as
   text track cues</a></li>
          <li><a href=#text-track-api><span class=secno>4.8.10.12.5 </span>Text track API</a></li>
-         <li><a href=#cue-events><span class=secno>4.8.10.12.6 </span>Event definitions</a></ol></li>
+         <li><a href=#text-tracks-describing-chapters><span class=secno>4.8.10.12.6 </span>Text tracks describing chapters</a></li>
+         <li><a href=#cue-events><span class=secno>4.8.10.12.7 </span>Event definitions</a></ol></li>
        <li><a href=#webvtt-0><span class=secno>4.8.10.13 </span>WebVTT</a>
         <ol>
          <li><a href=#introduction-1><span class=secno>4.8.10.13.1 </span>Introduction</a></li>
@@ -26445,7 +26446,7 @@
      <td><dfn id=attr-track-kind-chapters title=attr-track-kind-chapters>Chapters</dfn>
      <td>
       Chapter titles, intended to be used for navigating the <a href=#media-resource>media resource</a>.
-      Displayed as an interactive list in the user agent's interface.
+      Displayed as an interactive (potentially nested) list in the user agent's interface.
     <tr><td><dfn id=attr-track-kind-keyword-metadata title=attr-track-kind-keyword-metadata><code>metadata</code></dfn>
      <td><dfn id=attr-track-kind-metadata title=attr-track-kind-metadata>Metadata</dfn>
      <td>
@@ -26476,6 +26477,12 @@
   <a href=#webvtt>WebVTT</a> resource, and the element's <code title=attr-track-kind><a href=#attr-track-kind>kind</a></code> attribute is not in the <a href=#attr-track-kind-metadata title=attr-track-kind-metadata>metadata</a> state, then the
   <a href=#webvtt>WebVTT</a> file must be a <a href=#webvtt-file-using-cue-text>WebVTT file using cue
   text</a>.</p>
+
+  <p>Furthermore, if the element's <a href=#track-url>track URL</a> identifies a
+  <a href=#webvtt>WebVTT</a> resource, and the element's <code title=attr-track-kind><a href=#attr-track-kind>kind</a></code> attribute is in the <a href=#attr-track-kind-chapters title=attr-track-kind-chapters>chapters</a> state, then the
+  <a href=#webvtt>WebVTT</a> file must be both a <a href=#webvtt-file-using-chapter-title-text>WebVTT file using
+  chapter title text</a> and a <a href=#webvtt-file-using-only-nested-cues>WebVTT file using only nested
+  cues</a>.</p>
 <!--TTVTT-->
 
   <p>The <dfn id=attr-track-srclang title=attr-track-srclang><code>srclang</code></dfn>
@@ -32017,10 +32024,138 @@
   </div>
 
 
+  <h6 id=text-tracks-describing-chapters><span class=secno>4.8.10.12.6 </span>Text tracks describing chapters</h6>
+
+  <p>Chapters are segments of a <a href=#media-resource>media resource</a> with a
+  given title. Chapters can be nested, in the same way that sections
+  in a document outline can have subsections.</p>
+
+  <p>Each <a href=#text-track-cue>text track cue</a> in a <a href=#text-track>text track</a>
+  being used for describing chapters has three key features: the
+  <a href=#text-track-cue-start-time>text track cue start time</a>, giving the start time of the
+  chapter, the <a href=#text-track-cue-end-time>text track cue end time</a>, giving the end
+  time of the chapter, and the <a href=#text-track-cue-text>text track cue text</a> giving
+  the chapter title.</p>
+
   <div class=impl>
 
-  <h6 id=cue-events><span class=secno>4.8.10.12.6 </span>Event definitions</h6>
+  <p>The <dfn id=rules-for-constructing-the-chapter-tree-from-a-text-track>rules for constructing the chapter tree from a text
+  track</dfn> are as follows. They produce a potentially nested list
+  of chapters, each of which have a start time, end time, title, and a
+  list of nested chapters. This algorithm discards cues that do not
+  correctly nest within each other, or that are out of order.</p>
 
+  <ol><li><p>Let <var title="">list</var> be a copy of the <a href=#text-track-list-of-cues title="text track list of cues">list of cues</a> of the
+   <a href=#text-track>text track</a> being processed.</li>
+
+   <li><p>Let <var title="">output</var> be an empty list of chapters,
+   where a chapter is a record consisting of a start time, an end
+   time, a title, and a (potentially empty) list of nested chapters.
+   For the purpose of this algorithm, each chapter also has a parent
+   chapter.</li>
+
+   <li><p>Let <var title="">current chapter</var> be a stand-in
+   chapter whose start time is negative infinity, whose end time is
+   positive infinity, and whose list of nested chapters is <var title="">output</var>. (This is just used to make the algorithm
+   easier to describe.)</li>
+
+   <!-- while not empty... -->
+   <li><p><i>Loop</i>: If <var title="">list</var> is empty, jump to
+   the step labeled <i>end</i>.</li>
+
+   <!-- do... -->
+   <li><p>Let <var title="">current cue</var> be the first cue in <var title="">list</var>, and then remove it from <var title="">list</var>.</li>
+
+   <li><p>If <var title="">current cue</var>'s <a href=#text-track-cue-start-time>text track cue
+   start time</a> is less than the start time of <var title="">current chapter</var>, then return to the step labeled
+   <i>loop</i>.</p> <!-- out of order chapter -->
+
+   <li><p>While <var title="">current cue</var>'s <a href=#text-track-cue-start-time>text track cue
+   start time</a> is greater than or equal to <var title="">current
+   chapter</var>'s end time, let <var title="">current chapter</var>
+   be <var title="">current chapter</var>'s parent chapter.</li>
+
+   <li><p>If <var title="">current cue</var>'s <a href=#text-track-cue-end-time>text track cue
+   end time</a> is greater than the end time of <var title="">current chapter</var>, then return to the step labeled
+   <i>loop</i>.</p> <!-- misnested chapter -->
+
+   <li><p>Create a new chapter <var title="">new chapter</var>, whose
+   start time is <var title="">current cue</var>'s <a href=#text-track-cue-start-time>text track
+   cue start time</a>, whose end time is <var title="">current
+   cue</var>'s <a href=#text-track-cue-end-time>text track cue end time</a>, whose title is
+   <var title="">current cue</var>'s <a href=#text-track-cue-text>text track cue text</a>
+   interpreted according to its rules for interpretation, and whose
+   list of nested chapters is empty.</li>
+
+   <li><p>Append <var title="">new chapter</var> to <var title="">current chapter</var>'s list of nested chapters, and let
+   <var title="">current chapter</var> be <var title="">new
+   chapter</var>'s parent.</li>
+
+   <li><p>Let <var title="">current chapter</var> be <var title="">new
+   chapter</var>.</li>
+
+   <li><p>Return to the step labeled <i>loop</i>.</li>
+   <!-- ...end while -->
+
+   <li><p><i>End</i>: Return <var title="">output</var>.</li>
+
+  </ol></div>
+
+<!--TTVTT-->
+  <div class=example>
+
+   <p>The following snippet of a <a href=#webvtt-file>WebVTT file</a> shows how
+   nested chapters can be marked up. The file describes three
+   50-minute chapters, "Astrophysics", "Computational Physics", and
+   "General Relativity". The first has three subchapters, the second
+   has four, and the third has two.</p>
+
+   <pre>WEBVTT
+
+00:00:00.00 --> 00:50:00.00
+Astrophysics
+
+00:00:00.00 --> 00:10:00.00
+Introduction to Astrophysics
+
+00:10:00.00 --> 00:45:00.00
+The Solar System
+
+00:00:00.00 --> 00:10:00.00
+Coursework Description
+
+00:50:00.00 --> 01:40:00.00
+Computational Physics
+
+00:50:00.00 --> 00:55:00.00
+Introduction to Programming
+
+00:55:00.00 --> 01:30:00.00
+Data Structures
+
+01:30:00.00 --> 01:35:00.00
+Answers to Last Exam
+
+01:35:00.00 --> 01:40:00.00
+Coursework Description
+
+01:40:00.00 --> 02:30:00.00
+General Relativity
+
+01:40:00.00 --> 02:00:00.00
+Tensor Algebra
+
+02:00:00.00 --> 02:30:00.00
+The General Relativistic Field Equations</pre>
+
+  </div>
+<!--TTVTT-->
+
+
+  <div class=impl>
+
+  <h6 id=cue-events><span class=secno>4.8.10.12.7 </span>Event definitions</h6>
+
   <p>The following are the <a href=#event-handlers>event handlers</a> that must be
   supported, as IDL attributes, by all objects implementing the
   <code><a href=#texttrack>TextTrack</a></code> interface:</p>
@@ -32158,23 +32293,31 @@
    <li><a href=#webvtt-cue-timings>WebVTT cue timings</a>.</li>
    <li>Optionally, one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters followed by <a href=#webvtt-cue-settings>WebVTT cue settings</a>.</li>
    <li>A <a href=#webvtt-line-terminator>WebVTT line terminator</a>.</li>
-   <li>The <dfn id=cue-payload>cue payload</dfn>: either <a href=#webvtt-cue-text>WebVTT cue text</a> or <a href=#webvtt-metadata-text>WebVTT metadata text</a>.</li>
+   <li>The <dfn id=cue-payload>cue payload</dfn>: either <a href=#webvtt-cue-text>WebVTT cue text</a>, <a href=#webvtt-chapter-title-text>WebVTT chapter title text</a>, or <a href=#webvtt-metadata-text>WebVTT metadata text</a>.</li>
   </ol><p class=note>A <a href=#webvtt-cue>WebVTT cue</a> corresponds to one piece
   of time-aligned text or data in the <a href=#webvtt-file>WebVTT file</a>, for
   example one subtitle. The <a href=#cue-payload>cue payload</a> is the text or
   data associated with the cue.</p>
 
-  <p><a href=#webvtt-cue-text>WebVTT cue text</a> is syntactically a subset of
-  <a href=#webvtt-metadata-text>WebVTT metadata text</a>. Conformance checkers, when
-  validating <a href=#webvtt>WebVTT</a> files, may offer to restrict all cues
-  to only having <a href=#webvtt-cue-text>WebVTT cue text</a> as their <a href=#cue-payload>cue
+  <p><a href=#webvtt-chapter-title-text>WebVTT chapter title text</a> is syntactically a subset
+  of <a href=#webvtt-cue-text>WebVTT cue text</a>, and <a href=#webvtt-cue-text>WebVTT cue text</a> is
+  syntactically a subset of <a href=#webvtt-metadata-text>WebVTT metadata text</a>.
+  Conformance checkers, when validating <a href=#webvtt>WebVTT</a> files, may
+  offer to restrict all cues to only having <a href=#webvtt-chapter-title-text>WebVTT chapter title
+  text</a> or <a href=#webvtt-cue-text>WebVTT cue text</a> as their <a href=#cue-payload>cue
   payload</a>; <a href=#webvtt-metadata-text>WebVTT metadata text</a> cues are only
   useful for scripted applications (using the <code title=dom-timedtrack-kind-metadata>metadata</code> <a href=#text-track-kind>text
   track kind</a>).</p>
 
   <p>A <a href=#webvtt-file>WebVTT file</a> whose cues all have a <a href=#cue-payload>cue
+  payload</a> that is <a href=#webvtt-chapter-title-text>WebVTT chapter title text</a> is
+  said to be a <dfn id=webvtt-file-using-chapter-title-text>WebVTT file using chapter title text</dfn>.</p>
+
+  <p>A <a href=#webvtt-file>WebVTT file</a> whose cues all have a <a href=#cue-payload>cue
   payload</a> that is <a href=#webvtt-cue-text>WebVTT cue text</a> is said to be a
-  <dfn id=webvtt-file-using-cue-text>WebVTT file using cue text</dfn>.</p>
+  <dfn id=webvtt-file-using-cue-text>WebVTT file using cue text</dfn>. By definition, any file that
+  is a <a href=#webvtt-file-using-chapter-title-text>WebVTT file using chapter title text</a> is also a
+  <a href=#webvtt-file-using-cue-text>WebVTT file using cue text</a>.</p>
 
   <p>A <dfn id=webvtt-line-terminator>WebVTT line terminator</dfn> consists of one of the
   following:</p>
@@ -32218,6 +32361,11 @@
   and end offsets of the <a href=#webvtt-cue>WebVTT cue</a>. Different cues can
   overlap. Cues are always listed ordered by their start time.</p>
 
+  <p>A <a href=#webvtt-file>WebVTT file</a> whose cues all have an end time offset
+  <var title="">x</var> greater than or equal to the end time offsets
+  of all the cues whose start time offsets are less than <var title="">x</var> is said to be a <dfn id=webvtt-file-using-only-nested-cues>WebVTT file using only nested
+  cues</dfn>.</p>
+
   <p>A <dfn id=webvtt-timestamp>WebVTT timestamp</dfn> representing a time in seconds and
   fractions of a second is a <a href=#webvtt-timestamp>WebVTT timestamp</a>
   representing hours <var title="">hours</var>, minutes <var title="">minutes</var>, seconds
@@ -32358,6 +32506,7 @@
   are relative to the text direction; for left-to-right English text,
   "<code title="">start</code>" means left-aligned.</p>
 
+
   <p><dfn id=webvtt-metadata-text>WebVTT metadata text</dfn> consists of any sequence of one
   or more characters other than U+000A LINE FEED (LF) characters and
   U+000D CARRIAGE RETURN (CR) characters, each optionally separated
@@ -32366,7 +32515,16 @@
   does not start or end with a <a href=#webvtt-line-terminator>WebVTT line
   terminator</a>.)</p>
 
-  <p><dfn id=webvtt-cue-text>WebVTT cue text</dfn> consists of zero or more <a href=#webvtt-cue-components>WebVTT
+
+  <p><dfn id=webvtt-chapter-title-text>WebVTT chapter title text</dfn> consists of zero or more of
+  the following, each optionally separated from the next by a
+  <a href=#webvtt-line-terminator>WebVTT line terminator</a>:</p>
+
+  <ul><li>A <a href=#webvtt-cue-text-span>WebVTT cue text span</a>, representing the text of the cue.</li>
+   <li>A <a href=#webvtt-cue-amp-escape>WebVTT cue amp escape</a>, representing a "&" character in the text of the cue.</li>
+   <li>A <a href=#webvtt-cue-lt-escape>WebVTT cue lt escape</a>, representing a "<" character in the text of the cue.</li>
+   <li>A <a href=#webvtt-cue-gt-escape>WebVTT cue gt escape</a>, representing a ">" character in the text of the cue.</li>
+  </ul><p><dfn id=webvtt-cue-text>WebVTT cue text</dfn> consists of zero or more <a href=#webvtt-cue-components>WebVTT
   cue components</a>, in any order, each optionally separated from
   the next by a <a href=#webvtt-line-terminator>WebVTT line terminator</a>.</p>
 
@@ -32393,7 +32551,6 @@
   followed by a <a href=#webvtt-line-terminator>WebVTT line terminator</a>.</p>
 
 
-
   <p>A <dfn id=webvtt-cue-class-span>WebVTT cue class span</dfn> consists of a <a href=#webvtt-cue-span-start-tag>WebVTT cue
   span start tag</a> "<code title="">c</code>" that disallows an
   annotation, <a href=#webvtt-cue-internal-text>WebVTT cue internal text</a> representing cue
@@ -33917,15 +34074,13 @@
   be useful to most users.
 
   <p>For the purposes of listing chapters in the <a href=#media-resource>media
-  resource</a>, only <a href=#text-track title="text track">text tracks</a>
-  in the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text
-  tracks</a> <a href=#text-track-showing title="text track showing">showing</a> or
-  <a href=#text-track-showing-by-default title="text track showing by default">showing by
-  default</a> and whose <a href=#text-track-kind>text track kind</a> is <code title=dom-timedtrack-kind-chapters>chapters</code> should be used.
-  Each <a href=#text-track-cue title="text track cue">cue</a> in such a <a href=#text-track>text
-  track</a> represents a chapter starting at the cue's <a href=#text-track-cue-start-time title="text track cue start time">start time</a>. The name of
-  the chapter is the <a href=#text-track-cue-text>text track cue text</a>, interpreted
-  literally.</p>
+  resource</a>, only <a href=#text-track title="text track">text tracks</a> in
+  the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>
+  <a href=#text-track-showing title="text track showing">showing</a> or <a href=#text-track-showing-by-default title="text
+  track showing by default">showing by default</a> and whose
+  <a href=#text-track-kind>text track kind</a> is <code title=dom-timedtrack-kind-chapters>chapters</code> should be used.
+  Such tracks must be interpreted according to the <a href=#rules-for-constructing-the-chapter-tree-from-a-text-track>rules for
+  constructing the chapter tree from a text track</a>.</p>
 
   <p>The <dfn id=dom-media-controls title=dom-media-controls><code>controls</code></dfn>
   IDL attribute must <a href=#reflect>reflect</a> the content attribute of the

Modified: index
===================================================================
--- index	2011-08-11 22:31:00 UTC (rev 6427)
+++ index	2011-08-12 06:34:42 UTC (rev 6428)
@@ -243,7 +243,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 11 August 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 12 August 2011</h2>
    </hgroup><dl><dt><strong>Web developer edition</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -587,7 +587,8 @@
          <li><a href=#guidelines-for-exposing-cues-in-various-formats-as-text-track-cues><span class=secno>4.8.10.12.4 </span>Guidelines for exposing cues in various formats as
   text track cues</a></li>
          <li><a href=#text-track-api><span class=secno>4.8.10.12.5 </span>Text track API</a></li>
-         <li><a href=#cue-events><span class=secno>4.8.10.12.6 </span>Event definitions</a></ol></li>
+         <li><a href=#text-tracks-describing-chapters><span class=secno>4.8.10.12.6 </span>Text tracks describing chapters</a></li>
+         <li><a href=#cue-events><span class=secno>4.8.10.12.7 </span>Event definitions</a></ol></li>
        <li><a href=#webvtt-0><span class=secno>4.8.10.13 </span>WebVTT</a>
         <ol>
          <li><a href=#introduction-1><span class=secno>4.8.10.13.1 </span>Introduction</a></li>
@@ -26312,7 +26313,7 @@
      <td><dfn id=attr-track-kind-chapters title=attr-track-kind-chapters>Chapters</dfn>
      <td>
       Chapter titles, intended to be used for navigating the <a href=#media-resource>media resource</a>.
-      Displayed as an interactive list in the user agent's interface.
+      Displayed as an interactive (potentially nested) list in the user agent's interface.
     <tr><td><dfn id=attr-track-kind-keyword-metadata title=attr-track-kind-keyword-metadata><code>metadata</code></dfn>
      <td><dfn id=attr-track-kind-metadata title=attr-track-kind-metadata>Metadata</dfn>
      <td>
@@ -26343,6 +26344,12 @@
   <a href=#webvtt>WebVTT</a> resource, and the element's <code title=attr-track-kind><a href=#attr-track-kind>kind</a></code> attribute is not in the <a href=#attr-track-kind-metadata title=attr-track-kind-metadata>metadata</a> state, then the
   <a href=#webvtt>WebVTT</a> file must be a <a href=#webvtt-file-using-cue-text>WebVTT file using cue
   text</a>.</p>
+
+  <p>Furthermore, if the element's <a href=#track-url>track URL</a> identifies a
+  <a href=#webvtt>WebVTT</a> resource, and the element's <code title=attr-track-kind><a href=#attr-track-kind>kind</a></code> attribute is in the <a href=#attr-track-kind-chapters title=attr-track-kind-chapters>chapters</a> state, then the
+  <a href=#webvtt>WebVTT</a> file must be both a <a href=#webvtt-file-using-chapter-title-text>WebVTT file using
+  chapter title text</a> and a <a href=#webvtt-file-using-only-nested-cues>WebVTT file using only nested
+  cues</a>.</p>
 <!--TTVTT-->
 
   <p>The <dfn id=attr-track-srclang title=attr-track-srclang><code>srclang</code></dfn>
@@ -31884,10 +31891,138 @@
   </div>
 
 
+  <h6 id=text-tracks-describing-chapters><span class=secno>4.8.10.12.6 </span>Text tracks describing chapters</h6>
+
+  <p>Chapters are segments of a <a href=#media-resource>media resource</a> with a
+  given title. Chapters can be nested, in the same way that sections
+  in a document outline can have subsections.</p>
+
+  <p>Each <a href=#text-track-cue>text track cue</a> in a <a href=#text-track>text track</a>
+  being used for describing chapters has three key features: the
+  <a href=#text-track-cue-start-time>text track cue start time</a>, giving the start time of the
+  chapter, the <a href=#text-track-cue-end-time>text track cue end time</a>, giving the end
+  time of the chapter, and the <a href=#text-track-cue-text>text track cue text</a> giving
+  the chapter title.</p>
+
   <div class=impl>
 
-  <h6 id=cue-events><span class=secno>4.8.10.12.6 </span>Event definitions</h6>
+  <p>The <dfn id=rules-for-constructing-the-chapter-tree-from-a-text-track>rules for constructing the chapter tree from a text
+  track</dfn> are as follows. They produce a potentially nested list
+  of chapters, each of which have a start time, end time, title, and a
+  list of nested chapters. This algorithm discards cues that do not
+  correctly nest within each other, or that are out of order.</p>
 
+  <ol><li><p>Let <var title="">list</var> be a copy of the <a href=#text-track-list-of-cues title="text track list of cues">list of cues</a> of the
+   <a href=#text-track>text track</a> being processed.</li>
+
+   <li><p>Let <var title="">output</var> be an empty list of chapters,
+   where a chapter is a record consisting of a start time, an end
+   time, a title, and a (potentially empty) list of nested chapters.
+   For the purpose of this algorithm, each chapter also has a parent
+   chapter.</li>
+
+   <li><p>Let <var title="">current chapter</var> be a stand-in
+   chapter whose start time is negative infinity, whose end time is
+   positive infinity, and whose list of nested chapters is <var title="">output</var>. (This is just used to make the algorithm
+   easier to describe.)</li>
+
+   <!-- while not empty... -->
+   <li><p><i>Loop</i>: If <var title="">list</var> is empty, jump to
+   the step labeled <i>end</i>.</li>
+
+   <!-- do... -->
+   <li><p>Let <var title="">current cue</var> be the first cue in <var title="">list</var>, and then remove it from <var title="">list</var>.</li>
+
+   <li><p>If <var title="">current cue</var>'s <a href=#text-track-cue-start-time>text track cue
+   start time</a> is less than the start time of <var title="">current chapter</var>, then return to the step labeled
+   <i>loop</i>.</p> <!-- out of order chapter -->
+
+   <li><p>While <var title="">current cue</var>'s <a href=#text-track-cue-start-time>text track cue
+   start time</a> is greater than or equal to <var title="">current
+   chapter</var>'s end time, let <var title="">current chapter</var>
+   be <var title="">current chapter</var>'s parent chapter.</li>
+
+   <li><p>If <var title="">current cue</var>'s <a href=#text-track-cue-end-time>text track cue
+   end time</a> is greater than the end time of <var title="">current chapter</var>, then return to the step labeled
+   <i>loop</i>.</p> <!-- misnested chapter -->
+
+   <li><p>Create a new chapter <var title="">new chapter</var>, whose
+   start time is <var title="">current cue</var>'s <a href=#text-track-cue-start-time>text track
+   cue start time</a>, whose end time is <var title="">current
+   cue</var>'s <a href=#text-track-cue-end-time>text track cue end time</a>, whose title is
+   <var title="">current cue</var>'s <a href=#text-track-cue-text>text track cue text</a>
+   interpreted according to its rules for interpretation, and whose
+   list of nested chapters is empty.</li>
+
+   <li><p>Append <var title="">new chapter</var> to <var title="">current chapter</var>'s list of nested chapters, and let
+   <var title="">current chapter</var> be <var title="">new
+   chapter</var>'s parent.</li>
+
+   <li><p>Let <var title="">current chapter</var> be <var title="">new
+   chapter</var>.</li>
+
+   <li><p>Return to the step labeled <i>loop</i>.</li>
+   <!-- ...end while -->
+
+   <li><p><i>End</i>: Return <var title="">output</var>.</li>
+
+  </ol></div>
+
+<!--TTVTT-->
+  <div class=example>
+
+   <p>The following snippet of a <a href=#webvtt-file>WebVTT file</a> shows how
+   nested chapters can be marked up. The file describes three
+   50-minute chapters, "Astrophysics", "Computational Physics", and
+   "General Relativity". The first has three subchapters, the second
+   has four, and the third has two.</p>
+
+   <pre>WEBVTT
+
+00:00:00.00 --> 00:50:00.00
+Astrophysics
+
+00:00:00.00 --> 00:10:00.00
+Introduction to Astrophysics
+
+00:10:00.00 --> 00:45:00.00
+The Solar System
+
+00:00:00.00 --> 00:10:00.00
+Coursework Description
+
+00:50:00.00 --> 01:40:00.00
+Computational Physics
+
+00:50:00.00 --> 00:55:00.00
+Introduction to Programming
+
+00:55:00.00 --> 01:30:00.00
+Data Structures
+
+01:30:00.00 --> 01:35:00.00
+Answers to Last Exam
+
+01:35:00.00 --> 01:40:00.00
+Coursework Description
+
+01:40:00.00 --> 02:30:00.00
+General Relativity
+
+01:40:00.00 --> 02:00:00.00
+Tensor Algebra
+
+02:00:00.00 --> 02:30:00.00
+The General Relativistic Field Equations</pre>
+
+  </div>
+<!--TTVTT-->
+
+
+  <div class=impl>
+
+  <h6 id=cue-events><span class=secno>4.8.10.12.7 </span>Event definitions</h6>
+
   <p>The following are the <a href=#event-handlers>event handlers</a> that must be
   supported, as IDL attributes, by all objects implementing the
   <code><a href=#texttrack>TextTrack</a></code> interface:</p>
@@ -32025,23 +32160,31 @@
    <li><a href=#webvtt-cue-timings>WebVTT cue timings</a>.</li>
    <li>Optionally, one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters followed by <a href=#webvtt-cue-settings>WebVTT cue settings</a>.</li>
    <li>A <a href=#webvtt-line-terminator>WebVTT line terminator</a>.</li>
-   <li>The <dfn id=cue-payload>cue payload</dfn>: either <a href=#webvtt-cue-text>WebVTT cue text</a> or <a href=#webvtt-metadata-text>WebVTT metadata text</a>.</li>
+   <li>The <dfn id=cue-payload>cue payload</dfn>: either <a href=#webvtt-cue-text>WebVTT cue text</a>, <a href=#webvtt-chapter-title-text>WebVTT chapter title text</a>, or <a href=#webvtt-metadata-text>WebVTT metadata text</a>.</li>
   </ol><p class=note>A <a href=#webvtt-cue>WebVTT cue</a> corresponds to one piece
   of time-aligned text or data in the <a href=#webvtt-file>WebVTT file</a>, for
   example one subtitle. The <a href=#cue-payload>cue payload</a> is the text or
   data associated with the cue.</p>
 
-  <p><a href=#webvtt-cue-text>WebVTT cue text</a> is syntactically a subset of
-  <a href=#webvtt-metadata-text>WebVTT metadata text</a>. Conformance checkers, when
-  validating <a href=#webvtt>WebVTT</a> files, may offer to restrict all cues
-  to only having <a href=#webvtt-cue-text>WebVTT cue text</a> as their <a href=#cue-payload>cue
+  <p><a href=#webvtt-chapter-title-text>WebVTT chapter title text</a> is syntactically a subset
+  of <a href=#webvtt-cue-text>WebVTT cue text</a>, and <a href=#webvtt-cue-text>WebVTT cue text</a> is
+  syntactically a subset of <a href=#webvtt-metadata-text>WebVTT metadata text</a>.
+  Conformance checkers, when validating <a href=#webvtt>WebVTT</a> files, may
+  offer to restrict all cues to only having <a href=#webvtt-chapter-title-text>WebVTT chapter title
+  text</a> or <a href=#webvtt-cue-text>WebVTT cue text</a> as their <a href=#cue-payload>cue
   payload</a>; <a href=#webvtt-metadata-text>WebVTT metadata text</a> cues are only
   useful for scripted applications (using the <code title=dom-timedtrack-kind-metadata>metadata</code> <a href=#text-track-kind>text
   track kind</a>).</p>
 
   <p>A <a href=#webvtt-file>WebVTT file</a> whose cues all have a <a href=#cue-payload>cue
+  payload</a> that is <a href=#webvtt-chapter-title-text>WebVTT chapter title text</a> is
+  said to be a <dfn id=webvtt-file-using-chapter-title-text>WebVTT file using chapter title text</dfn>.</p>
+
+  <p>A <a href=#webvtt-file>WebVTT file</a> whose cues all have a <a href=#cue-payload>cue
   payload</a> that is <a href=#webvtt-cue-text>WebVTT cue text</a> is said to be a
-  <dfn id=webvtt-file-using-cue-text>WebVTT file using cue text</dfn>.</p>
+  <dfn id=webvtt-file-using-cue-text>WebVTT file using cue text</dfn>. By definition, any file that
+  is a <a href=#webvtt-file-using-chapter-title-text>WebVTT file using chapter title text</a> is also a
+  <a href=#webvtt-file-using-cue-text>WebVTT file using cue text</a>.</p>
 
   <p>A <dfn id=webvtt-line-terminator>WebVTT line terminator</dfn> consists of one of the
   following:</p>
@@ -32085,6 +32228,11 @@
   and end offsets of the <a href=#webvtt-cue>WebVTT cue</a>. Different cues can
   overlap. Cues are always listed ordered by their start time.</p>
 
+  <p>A <a href=#webvtt-file>WebVTT file</a> whose cues all have an end time offset
+  <var title="">x</var> greater than or equal to the end time offsets
+  of all the cues whose start time offsets are less than <var title="">x</var> is said to be a <dfn id=webvtt-file-using-only-nested-cues>WebVTT file using only nested
+  cues</dfn>.</p>
+
   <p>A <dfn id=webvtt-timestamp>WebVTT timestamp</dfn> representing a time in seconds and
   fractions of a second is a <a href=#webvtt-timestamp>WebVTT timestamp</a>
   representing hours <var title="">hours</var>, minutes <var title="">minutes</var>, seconds
@@ -32225,6 +32373,7 @@
   are relative to the text direction; for left-to-right English text,
   "<code title="">start</code>" means left-aligned.</p>
 
+
   <p><dfn id=webvtt-metadata-text>WebVTT metadata text</dfn> consists of any sequence of one
   or more characters other than U+000A LINE FEED (LF) characters and
   U+000D CARRIAGE RETURN (CR) characters, each optionally separated
@@ -32233,7 +32382,16 @@
   does not start or end with a <a href=#webvtt-line-terminator>WebVTT line
   terminator</a>.)</p>
 
-  <p><dfn id=webvtt-cue-text>WebVTT cue text</dfn> consists of zero or more <a href=#webvtt-cue-components>WebVTT
+
+  <p><dfn id=webvtt-chapter-title-text>WebVTT chapter title text</dfn> consists of zero or more of
+  the following, each optionally separated from the next by a
+  <a href=#webvtt-line-terminator>WebVTT line terminator</a>:</p>
+
+  <ul><li>A <a href=#webvtt-cue-text-span>WebVTT cue text span</a>, representing the text of the cue.</li>
+   <li>A <a href=#webvtt-cue-amp-escape>WebVTT cue amp escape</a>, representing a "&" character in the text of the cue.</li>
+   <li>A <a href=#webvtt-cue-lt-escape>WebVTT cue lt escape</a>, representing a "<" character in the text of the cue.</li>
+   <li>A <a href=#webvtt-cue-gt-escape>WebVTT cue gt escape</a>, representing a ">" character in the text of the cue.</li>
+  </ul><p><dfn id=webvtt-cue-text>WebVTT cue text</dfn> consists of zero or more <a href=#webvtt-cue-components>WebVTT
   cue components</a>, in any order, each optionally separated from
   the next by a <a href=#webvtt-line-terminator>WebVTT line terminator</a>.</p>
 
@@ -32260,7 +32418,6 @@
   followed by a <a href=#webvtt-line-terminator>WebVTT line terminator</a>.</p>
 
 
-
   <p>A <dfn id=webvtt-cue-class-span>WebVTT cue class span</dfn> consists of a <a href=#webvtt-cue-span-start-tag>WebVTT cue
   span start tag</a> "<code title="">c</code>" that disallows an
   annotation, <a href=#webvtt-cue-internal-text>WebVTT cue internal text</a> representing cue
@@ -33784,15 +33941,13 @@
   be useful to most users.
 
   <p>For the purposes of listing chapters in the <a href=#media-resource>media
-  resource</a>, only <a href=#text-track title="text track">text tracks</a>
-  in the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text
-  tracks</a> <a href=#text-track-showing title="text track showing">showing</a> or
-  <a href=#text-track-showing-by-default title="text track showing by default">showing by
-  default</a> and whose <a href=#text-track-kind>text track kind</a> is <code title=dom-timedtrack-kind-chapters>chapters</code> should be used.
-  Each <a href=#text-track-cue title="text track cue">cue</a> in such a <a href=#text-track>text
-  track</a> represents a chapter starting at the cue's <a href=#text-track-cue-start-time title="text track cue start time">start time</a>. The name of
-  the chapter is the <a href=#text-track-cue-text>text track cue text</a>, interpreted
-  literally.</p>
+  resource</a>, only <a href=#text-track title="text track">text tracks</a> in
+  the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>
+  <a href=#text-track-showing title="text track showing">showing</a> or <a href=#text-track-showing-by-default title="text
+  track showing by default">showing by default</a> and whose
+  <a href=#text-track-kind>text track kind</a> is <code title=dom-timedtrack-kind-chapters>chapters</code> should be used.
+  Such tracks must be interpreted according to the <a href=#rules-for-constructing-the-chapter-tree-from-a-text-track>rules for
+  constructing the chapter tree from a text track</a>.</p>
 
   <p>The <dfn id=dom-media-controls title=dom-media-controls><code>controls</code></dfn>
   IDL attribute must <a href=#reflect>reflect</a> the content attribute of the

Modified: source
===================================================================
--- source	2011-08-11 22:31:00 UTC (rev 6427)
+++ source	2011-08-12 06:34:42 UTC (rev 6428)
@@ -28462,7 +28462,7 @@
      <td><dfn title="attr-track-kind-chapters">Chapters</dfn>
      <td>
       Chapter titles, intended to be used for navigating the <span>media resource</span>.
-      Displayed as an interactive list in the user agent's interface.
+      Displayed as an interactive (potentially nested) list in the user agent's interface.
     <tr>
      <td><dfn title="attr-track-kind-keyword-metadata"><code>metadata</code></dfn>
      <td><dfn title="attr-track-kind-metadata">Metadata</dfn>
@@ -28498,6 +28498,14 @@
   title="attr-track-kind-metadata">metadata</span> state, then the
   <span>WebVTT</span> file must be a <span>WebVTT file using cue
   text</span>.</p>
+
+  <p>Furthermore, if the element's <span>track URL</span> identifies a
+  <span>WebVTT</span> resource, and the element's <code
+  title="attr-track-kind">kind</code> attribute is in the <span
+  title="attr-track-kind-chapters">chapters</span> state, then the
+  <span>WebVTT</span> file must be both a <span>WebVTT file using
+  chapter title text</span> and a <span>WebVTT file using only nested
+  cues</span>.</p>
 <!--START w3c-html--><!--TTVTT-->
 
   <p>The <dfn title="attr-track-srclang"><code>srclang</code></dfn>
@@ -34936,8 +34944,147 @@
   </div>
 
 
+  <h6>Text tracks describing chapters</h6>
+
+  <p>Chapters are segments of a <span>media resource</span> with a
+  given title. Chapters can be nested, in the same way that sections
+  in a document outline can have subsections.</p>
+
+  <p>Each <span>text track cue</span> in a <span>text track</span>
+  being used for describing chapters has three key features: the
+  <span>text track cue start time</span>, giving the start time of the
+  chapter, the <span>text track cue end time</span>, giving the end
+  time of the chapter, and the <span>text track cue text</span> giving
+  the chapter title.</p>
+
   <div class="impl">
 
+  <p>The <dfn>rules for constructing the chapter tree from a text
+  track</dfn> are as follows. They produce a potentially nested list
+  of chapters, each of which have a start time, end time, title, and a
+  list of nested chapters. This algorithm discards cues that do not
+  correctly nest within each other, or that are out of order.</p>
+
+  <ol>
+
+   <li><p>Let <var title="">list</var> be a copy of the <span
+   title="text track list of cues">list of cues</span> of the
+   <span>text track</span> being processed.</p></li>
+
+   <li><p>Let <var title="">output</var> be an empty list of chapters,
+   where a chapter is a record consisting of a start time, an end
+   time, a title, and a (potentially empty) list of nested chapters.
+   For the purpose of this algorithm, each chapter also has a parent
+   chapter.</p></li>
+
+   <li><p>Let <var title="">current chapter</var> be a stand-in
+   chapter whose start time is negative infinity, whose end time is
+   positive infinity, and whose list of nested chapters is <var
+   title="">output</var>. (This is just used to make the algorithm
+   easier to describe.)</p></li>
+
+   <!-- while not empty... -->
+   <li><p><i>Loop</i>: If <var title="">list</var> is empty, jump to
+   the step labeled <i>end</i>.</p></li>
+
+   <!-- do... -->
+   <li><p>Let <var title="">current cue</var> be the first cue in <var
+   title="">list</var>, and then remove it from <var
+   title="">list</var>.</p></li>
+
+   <li><p>If <var title="">current cue</var>'s <span>text track cue
+   start time</span> is less than the start time of <var
+   title="">current chapter</var>, then return to the step labeled
+   <i>loop</i>.</p> <!-- out of order chapter -->
+
+   <li><p>While <var title="">current cue</var>'s <span>text track cue
+   start time</span> is greater than or equal to <var title="">current
+   chapter</var>'s end time, let <var title="">current chapter</var>
+   be <var title="">current chapter</var>'s parent chapter.</p></li>
+
+   <li><p>If <var title="">current cue</var>'s <span>text track cue
+   end time</span> is greater than the end time of <var
+   title="">current chapter</var>, then return to the step labeled
+   <i>loop</i>.</p> <!-- misnested chapter -->
+
+   <li><p>Create a new chapter <var title="">new chapter</var>, whose
+   start time is <var title="">current cue</var>'s <span>text track
+   cue start time</span>, whose end time is <var title="">current
+   cue</var>'s <span>text track cue end time</span>, whose title is
+   <var title="">current cue</var>'s <span>text track cue text</span>
+   interpreted according to its rules for interpretation, and whose
+   list of nested chapters is empty.</p></li>
+
+   <li><p>Append <var title="">new chapter</var> to <var
+   title="">current chapter</var>'s list of nested chapters, and let
+   <var title="">current chapter</var> be <var title="">new
+   chapter</var>'s parent.</p></li>
+
+   <li><p>Let <var title="">current chapter</var> be <var title="">new
+   chapter</var>.</p></li>
+
+   <li><p>Return to the step labeled <i>loop</i>.</p></li>
+   <!-- ...end while -->
+
+   <li><p><i>End</i>: Return <var title="">output</var>.</p></li>
+
+  </ol>
+
+  </div>
+
+<!--END w3c-html--><!--TTVTT-->
+  <div class="example">
+
+   <p>The following snippet of a <span>WebVTT file</span> shows how
+   nested chapters can be marked up. The file describes three
+   50-minute chapters, "Astrophysics", "Computational Physics", and
+   "General Relativity". The first has three subchapters, the second
+   has four, and the third has two.</p>
+
+   <pre>WEBVTT
+
+00:00:00.00 --> 00:50:00.00
+Astrophysics
+
+00:00:00.00 --> 00:10:00.00
+Introduction to Astrophysics
+
+00:10:00.00 --> 00:45:00.00
+The Solar System
+
+00:00:00.00 --> 00:10:00.00
+Coursework Description
+
+00:50:00.00 --> 01:40:00.00
+Computational Physics
+
+00:50:00.00 --> 00:55:00.00
+Introduction to Programming
+
+00:55:00.00 --> 01:30:00.00
+Data Structures
+
+01:30:00.00 --> 01:35:00.00
+Answers to Last Exam
+
+01:35:00.00 --> 01:40:00.00
+Coursework Description
+
+01:40:00.00 --> 02:30:00.00
+General Relativity
+
+01:40:00.00 --> 02:00:00.00
+Tensor Algebra
+
+02:00:00.00 --> 02:30:00.00
+The General Relativistic Field Equations</pre>
+
+  </div>
+<!--START w3c-html--><!--TTVTT-->
+
+
+  <div class="impl">
+
   <h6 id="cue-events">Event definitions</h6>
 
   <p>The following are the <span>event handlers</span> that must be
@@ -35092,7 +35239,7 @@
    <li><span>WebVTT cue timings</span>.</li>
    <li>Optionally, one or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters followed by <span>WebVTT cue settings</span>.</li>
    <li>A <span>WebVTT line terminator</span>.</li>
-   <li>The <dfn>cue payload</dfn>: either <span>WebVTT cue text</span> or <span>WebVTT metadata text</span>.</li>
+   <li>The <dfn>cue payload</dfn>: either <span>WebVTT cue text</span>, <span>WebVTT chapter title text</span>, or <span>WebVTT metadata text</span>.</li>
   </ol>
 
   <p class="note">A <span>WebVTT cue</span> corresponds to one piece
@@ -35100,18 +35247,26 @@
   example one subtitle. The <span>cue payload</span> is the text or
   data associated with the cue.</p>
 
-  <p><span>WebVTT cue text</span> is syntactically a subset of
-  <span>WebVTT metadata text</span>. Conformance checkers, when
-  validating <span>WebVTT</span> files, may offer to restrict all cues
-  to only having <span>WebVTT cue text</span> as their <span>cue
+  <p><span>WebVTT chapter title text</span> is syntactically a subset
+  of <span>WebVTT cue text</span>, and <span>WebVTT cue text</span> is
+  syntactically a subset of <span>WebVTT metadata text</span>.
+  Conformance checkers, when validating <span>WebVTT</span> files, may
+  offer to restrict all cues to only having <span>WebVTT chapter title
+  text</span> or <span>WebVTT cue text</span> as their <span>cue
   payload</span>; <span>WebVTT metadata text</span> cues are only
   useful for scripted applications (using the <code
   title="dom-timedtrack-kind-metadata">metadata</code> <span>text
   track kind</span>).</p>
 
   <p>A <span>WebVTT file</span> whose cues all have a <span>cue
+  payload</span> that is <span>WebVTT chapter title text</span> is
+  said to be a <dfn>WebVTT file using chapter title text</dfn>.</p>
+
+  <p>A <span>WebVTT file</span> whose cues all have a <span>cue
   payload</span> that is <span>WebVTT cue text</span> is said to be a
-  <dfn>WebVTT file using cue text</dfn>.</p>
+  <dfn>WebVTT file using cue text</dfn>. By definition, any file that
+  is a <span>WebVTT file using chapter title text</span> is also a
+  <span>WebVTT file using cue text</span>.</p>
 
   <p>A <dfn>WebVTT line terminator</dfn> consists of one of the
   following:</p>
@@ -35164,6 +35319,12 @@
   and end offsets of the <span>WebVTT cue</span>. Different cues can
   overlap. Cues are always listed ordered by their start time.</p>
 
+  <p>A <span>WebVTT file</span> whose cues all have an end time offset
+  <var title="">x</var> greater than or equal to the end time offsets
+  of all the cues whose start time offsets are less than <var
+  title="">x</var> is said to be a <dfn>WebVTT file using only nested
+  cues</dfn>.</p>
+
   <p>A <dfn>WebVTT timestamp</dfn> representing a time in seconds and
   fractions of a second is a <span>WebVTT timestamp</span>
   representing hours <var
@@ -35355,6 +35516,7 @@
   are relative to the text direction; for left-to-right English text,
   "<code title="">start</code>" means left-aligned.</p>
 
+
   <p><dfn>WebVTT metadata text</dfn> consists of any sequence of one
   or more characters other than U+000A LINE FEED (LF) characters and
   U+000D CARRIAGE RETURN (CR) characters, each optionally separated
@@ -35364,6 +35526,19 @@
   does not start or end with a <span>WebVTT line
   terminator</span>.)</p>
 
+
+  <p><dfn>WebVTT chapter title text</dfn> consists of zero or more of
+  the following, each optionally separated from the next by a
+  <span>WebVTT line terminator</span>:</p>
+
+  <ul>
+   <li>A <span>WebVTT cue text span</span>, representing the text of the cue.</li>
+   <li>A <span>WebVTT cue amp escape</span>, representing a "&" character in the text of the cue.</li>
+   <li>A <span>WebVTT cue lt escape</span>, representing a "<" character in the text of the cue.</li>
+   <li>A <span>WebVTT cue gt escape</span>, representing a ">" character in the text of the cue.</li>
+  </ul>
+
+
   <p><dfn>WebVTT cue text</dfn> consists of zero or more <span>WebVTT
   cue components</span>, in any order, each optionally separated from
   the next by a <span>WebVTT line terminator</span>.</p>
@@ -35395,7 +35570,6 @@
   followed by a <span>WebVTT line terminator</span>.</p>
 
 
-
   <p>A <dfn>WebVTT cue class span</dfn> consists of a <span>WebVTT cue
   span start tag</span> "<code title="">c</code>" that disallows an
   annotation, <span>WebVTT cue internal text</span> representing cue
@@ -37211,17 +37385,14 @@
   be useful to most users.
 
   <p>For the purposes of listing chapters in the <span>media
-  resource</span>, only <span title="text track">text tracks</span>
-  in the <span>media element</span>'s <span>list of text
-  tracks</span> <span title="text track showing">showing</span> or
-  <span title="text track showing by default">showing by
-  default</span> and whose <span>text track kind</span> is <code
+  resource</span>, only <span title="text track">text tracks</span> in
+  the <span>media element</span>'s <span>list of text tracks</span>
+  <span title="text track showing">showing</span> or <span title="text
+  track showing by default">showing by default</span> and whose
+  <span>text track kind</span> is <code
   title="dom-timedtrack-kind-chapters">chapters</code> should be used.
-  Each <span title="text track cue">cue</span> in such a <span>text
-  track</span> represents a chapter starting at the cue's <span
-  title="text track cue start time">start time</span>. The name of
-  the chapter is the <span>text track cue text</span>, interpreted
-  literally.</p>
+  Such tracks must be interpreted according to the <span>rules for
+  constructing the chapter tree from a text track</span>.</p>
 
   <p>The <dfn title="dom-media-controls"><code>controls</code></dfn>
   IDL attribute must <span>reflect</span> the content attribute of the




More information about the Commit-Watchers mailing list