[html5] r5113 - [c] (0) Captions - Stage 11.5: Parsing WebSRT cue settings.

whatwg at whatwg.org whatwg at whatwg.org
Fri Jun 25 17:55:42 PDT 2010


Author: ianh
Date: 2010-06-25 17:55:41 -0700 (Fri, 25 Jun 2010)
New Revision: 5113

Modified:
   complete.html
   index
   source
Log:
[c] (0) Captions - Stage 11.5: Parsing WebSRT cue settings.

Modified: complete.html
===================================================================
--- complete.html	2010-06-25 21:40:00 UTC (rev 5112)
+++ complete.html	2010-06-26 00:55:41 UTC (rev 5113)
@@ -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 — 25 June 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 26 June 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>-->
@@ -26211,10 +26211,13 @@
 
    <dt><dfn id=timed-track-cue-line-position title="timed track cue line position">A line position</dfn>
    <dd>
-    <p>A number giving the position of the lines of the cue, to be
-    interpreted as defined by the <a href=#timed-track-cue-writing-direction title="timed track cue writing
-    direction">writing direction</a> and <a href=#timed-track-cue-snap-to-lines-flag title="timed track
-    cue snap-to-lines flag">snap-to-lines flag</a> of the cue.</p>
+    <p>Either a number giving the position of the lines of the cue, to
+    be interpreted as defined by the <a href=#timed-track-cue-writing-direction title="timed track cue
+    writing direction">writing direction</a> and <a href=#timed-track-cue-snap-to-lines-flag title="timed
+    track cue snap-to-lines flag">snap-to-lines flag</a> of the
+    cue, or the special value <dfn id=timed-track-cue-automatic-line-position title="timed track cue automatic line
+    position">auto</dfn>, which means the position is to depend on
+    the other active tracks.</p>
    </dd>
 
    <dt><dfn id=timed-track-cue-text-position title="timed track cue text position">A text position</dfn>
@@ -26769,14 +26772,20 @@
   component must not be included more than once per <a href=#websrt-cue-settings>WebSRT cue
   settings</a> string.</p>
 
-  <ul class=brief><li>A <a href=#websrt-line-position-cue-setting>WebSRT line position cue setting</a>.</li>
-   <li>A <a href=#websrt-text-position-cue-setting>WebSRT text position cue setting</a>.</li>
-   <li>A <a href=#websrt-alignment-cue-setting>WebSRT alignment cue setting</a>.</li>
-   <li>A <a href=#websrt-size-cue-setting>WebSRT size cue setting</a>.</li>
-   <li>A <a href=#websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</a>.</li>
-  </ul><p>A <dfn id=websrt-line-position-cue-setting>WebSRT line position cue setting</dfn> consists of the
+  <ul class=brief><li>A <a href=#websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</a>.</li> <!-- D:vertical -->
+   <li>A <a href=#websrt-line-position-cue-setting>WebSRT line position cue setting</a>.</li> <!-- L:100% L:1 L:-1 -->
+   <li>A <a href=#websrt-text-position-cue-setting>WebSRT text position cue setting</a>.</li> <!-- T:100% -->
+   <li>A <a href=#websrt-size-cue-setting>WebSRT size cue setting</a>.</li>          <!-- S:100% -->
+   <li>A <a href=#websrt-alignment-cue-setting>WebSRT alignment cue setting</a>.</li>     <!-- A:start/middle/end -->
+  </ul><p>A <dfn id=websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</dfn> consists of the
   following components, in the order given:</p>
 
+  <ol><li>A U+0044 LATIN CAPITAL LETTER D character.</li>
+   <li>A U+003A COLON character (:).</li>
+   <li>The string "<code title="">vertical</code>".</li>
+  </ol><p>A <dfn id=websrt-line-position-cue-setting>WebSRT line position cue setting</dfn> consists of the
+  following components, in the order given:</p>
+
   <ol><li><p>A U+004C LATIN CAPITAL LETTER L character.</li>
    <li><p>A U+003A COLON character (:).</li>
    <li>Either:
@@ -26798,12 +26807,6 @@
    <li>A U+003A COLON character (:).</li>
    <li>One or more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9).</li>
    <li>A U+0025 PERCENT SIGN character (%).</li>
-  </ol><p>A <dfn id=websrt-alignment-cue-setting>WebSRT alignment cue setting</dfn> consists of the
-  following components, in the order given:</p>
-
-  <ol><li>A U+0041 LATIN CAPITAL LETTER A character.</li>
-   <li>A U+003A COLON character (:).</li>
-   <li>One of the following strings: "<code title="">start</code>", "<code title="">middle</code>", "<code title="">end</code>"</li>
   </ol><p>A <dfn id=websrt-size-cue-setting>WebSRT size cue setting</dfn> consists of the
   following components, in the order given:</p>
 
@@ -26811,12 +26814,12 @@
    <li>A U+003A COLON character (:).</li>
    <li>One or more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9).</li>
    <li>A U+0025 PERCENT SIGN character (%).</li>
-  </ol><p>A <dfn id=websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</dfn> consists of the
+  </ol><p>A <dfn id=websrt-alignment-cue-setting>WebSRT alignment cue setting</dfn> consists of the
   following components, in the order given:</p>
 
-  <ol><li>A U+0044 LATIN CAPITAL LETTER D character.</li>
+  <ol><li>A U+0041 LATIN CAPITAL LETTER A character.</li>
    <li>A U+003A COLON character (:).</li>
-   <li>The string "<code title="">vertical</code>".</li>
+   <li>One of the following strings: "<code title="">start</code>", "<code title="">middle</code>", "<code title="">end</code>"</li>
   </ol><p class=XXX><dfn id=websrt-voice-declaration>WebSRT voice declaration</dfn>; <dfn id=websrt-cue-text-line>WebSRT cue text line</dfn></p>
 
 
@@ -26867,25 +26870,61 @@
    characters</a> that are either U+000D CARRIAGE RETURN (CR) or
    U+000A LINE FEED (LF) characters.</li>
 
-   <li><p>Let <var title="">id</var> be the empty string.</li>
+   <li><p>Let <var title="">cue</var> be a new <a href=#timed-track-cue>timed track
+   cue</a>.</li>
 
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-identifier>timed track cue
+   identifier</a> be the empty string.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-pause-on-exit-flag>timed track cue
+   pause-on-exit flag</a> be false.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-writing-direction>timed track cue
+   writing direction</a> be <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue
+   horizontal writing direction">horizontal</a>.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-snap-to-lines-flag>timed track cue
+   snap-to-lines flag</a> be true.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-line-position>timed track cue line
+   position</a> be <a href=#timed-track-cue-automatic-line-position title="timed track cue automatic line
+   position">auto</a>.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-text-position>timed track cue
+   text position</a> be 50.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-size>timed track cue
+   size</a> be 100.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-alignment>timed track cue
+   alignment</a> be <a href=#timed-track-cue-middle-alignment title="timed track cue middle
+   alignment">middle alignment</a>.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue
+   voice identifier</a> be the empty string.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-text>timed track cue
+   text</a> be the empty string.</li>
+
    <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
    <em>not</em> U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF)
    characters. Let <var title="">line</var> be those characters, if
    any.</li>
 
-   <li><p>If <var title="">line</var> is the empty string, then jump
-   to the step labeled <i>end</i>.</li>
+   <li><p>If <var title="">line</var> is the empty string, then
+   discard <var title="">cue</var> and jump to the step labeled
+   <i>end</i>.</li>
 
    <li><p>If <var title="">line</var> contains the three-character
    substring "<code title="">--></code>" (U+002D HYPHEN-MINUS, U+002D
    HYPHEN-MINUS, U+003E GREATER-THAN SIGN), then jump to the step
    labeled <i>timings</i> below.</li>
 
-   <li><p>Let <var title="">id</var> be <var title="">line</var>.<p></li>
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-identifier>timed track cue
+   identifier</a> be <var title="">line</var>.<p></li>
 
-   <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then jump to the step labeled
-   <i>end</i>.</li>
+   <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then discard <var title="">cue</var> and jump
+   to the step labeled <i>end</i>.</li>
 
    <li><p>If the character indicated by <var title="">position</var>
    is a U+000D CARRIAGE RETURN (CR) character, advance <var title="">position</var> to the next character in <var title="">input</var>.</li>
@@ -26898,8 +26937,9 @@
    characters. Let <var title="">line</var> be those characters, if
    any.</li>
 
-   <li><p>If <var title="">line</var> is the empty string, then jump
-   to the step labeled <i>cue loop</i>.</li>
+   <li><p>If <var title="">line</var> is the empty string, then
+   discard <var title="">cue</var> and jump to the step labeled <i>cue
+   loop</i>.</li>
 
    <li><p>If <var title="">line</var> does not contain the
    three-character substring "<code title="">--></code>" (U+002D
@@ -26907,28 +26947,32 @@
    jump to the step labeled <i>bad cue</i> below.</li>
 
    <li><p><i>Timings</i>: <a href=#collect-websrt-cue-timings-and-settings>Collect WebSRT cue timings and
-   settings</a> from <var title="">line</var>. If that fails, jump
-   to the step labeled <i>bad cue</i>. Otherwise, let <var title="">start time</var> be the first collected time, <var title="">end time</var> be the second collected time, and
-   <span class=XXX>...settings...</span>.</li>
+   settings</a> from <var title="">line</var>, using <var title="">cue</var> for the results. If that fails, jump to the step
+   labeled <i>bad cue</i>.</li>
 
    <li><p class=XXX>...voice...</li>
 
    <li><p class=XXX>...cues...</li>
 
-   <li><p>Let <var title="">cue</var> be a newly created <a href=#timed-track-cue>timed
-   track cue</a>.</li>
+   <li><p>Add <var title="">cue</var> to the <a href=#timed-track-list-of-cues>timed track list of
+   cues</a> <var title="">output</var>.</li>
 
-   <li><p class=XXX>...fill cue...</li>
+   <li><p>Jump to the step labeled <i>cue loop</i>.</li>
 
+   <li><p><i>Bad cue</i>: Discard <var title="">cue</var>.</li>
+
+   <li><p class=XXX>read until the next blank line; if you hit the
+   end of the file jump to <i>end</i>.</li>
+
    <li><p>Jump to the step labeled <i>cue loop</i>.</li>
 
    <li><p><i>End</i>: The file has ended. Abort these steps. The
    <a href=#websrt-parser>WebSRT parser</a> has finished.</li>
 
   </ol><p>When the algorithm above requires that the user agent
-  <dfn id=collect-websrt-cue-timings-and-settings>collect WebSRT cue timings and settings</dfn> from a string,
-  the user agent must run the following algorithm. This algorithm
-  either fails, or returns two timestamps and <span class=XXX>...settings...</span>.</p>
+  <dfn id=collect-websrt-cue-timings-and-settings>collect WebSRT cue timings and settings</dfn> from a string
+  <var title="">input</var> for a <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var>, the user agent must run the following
+  algorithm.</p>
 
   <ol><li><p>Let <var title="">input</var> be the string being
    parsed.</li>
@@ -26939,23 +26983,249 @@
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
    <li><p><a href=#collect-a-websrt-timestamp>Collect a WebSRT timestamp</a>. If that algorithm
-   fails, then abort these steps and return failure.</li>
+   fails, then abort these steps and return failure. Otherwise, let
+   <var title="">cue</var>'s <a href=#timed-track-cue-start-time>timed track cue start time</a>
+   be the collected time.</li>
 
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
-   <li><p class=XXX>check that we're at "<--" and fail if we're not</li>
+   <!-- we can't be beyond the end of the string until we've seen the
+   arrow, since we know the arrow is in the string and nothing we've
+   done so far would move us past the first "-". -->
 
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var title="">position</var> is not a U+002D HYPHEN-MINUS character (-)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</li>
+
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var title="">position</var> is not a U+002D HYPHEN-MINUS character (-)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</li>
+
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var title="">position</var> is not a U+003E GREATER-THAN SIGN character (>)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</li>
+
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
    <li><p><a href=#collect-a-websrt-timestamp>Collect a WebSRT timestamp</a>. If that algorithm
-   fails, then abort these steps and return failure.</li>
+   fails, then abort these steps and return failure. Otherwise, let
+   <var title="">cue</var>'s <a href=#timed-track-cue-end-time>timed track cue end time</a>
+   be the collected time.</li>
 
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
-   <li><p class=XXX>...settings...</li>
+   <li><p><i>Settings</i>: If <var title="">position</var> is beyond
+   the end of <var title="">input</var> then abort these
+   steps.</li>
 
-   <li><p>Return the two collected timestamps and <span class=XXX>...settings...</span>.</li>
+   <li><p>Let <var title="">setting</var> be the character at <var title="">position</var>, and move <var title="">position</var>
+   forwards one character.</p>
 
+   <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> then abort these steps.</li>
+
+   <li><p>If the character at <var title="">position</var> is not a
+   U+003A COLON character (:), then set <var title="">setting</var> to
+   the empty string.</li>
+
+   <li><p>Move <var title="">position</var> forwards one
+   character.</li>
+
+   <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> then abort these steps.</li>
+
+   <li>
+
+    <p>Run the appropriate substeps that apply for the value of <var title="">setting</var>, as follows:</p>
+
+    <dl><dt>If <var title="">setting</var> is a U+0044 LATIN CAPITAL
+     LETTER D character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       not <a href=#space-character title="space character">space characters</a>. Let
+       <var title="">value</var> be those characters, if any.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">vertical</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> be <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing
+       direction">horizontal</a>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+004C LATIN CAPITAL
+     LETTER L character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       either U+002D HYPHEN-MINUS characters (-), U+0025 PERCENT SIGN
+       characters (%), or characters in the range U+0030 DIGIT ZERO
+       (0) to U+0039 DIGIT NINE (9). Let <var title="">value</var> be
+       those characters, if any.</li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var title="">position</var> is not a <a href=#space-character>space character</a>,
+       then jump to the "otherwise" case below.</li>
+
+       <li><p>If <var title="">value</var> does not contain at least
+       one character in the range U+0030 DIGIT ZERO (0) to U+0039
+       DIGIT NINE (9), then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If any character in <var title="">value</var> other than
+       the first character is a U+002D HYPHEN-MINUS character (-),
+       then jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>If any character in <var title="">value</var> other than
+       the last character is a U+0025 PERCENT SIGN character (%), then
+       jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>If the first character in <var title="">value</var> is a
+       U+002D HYPHEN-MINUS character (-) <em>and</em> the last
+       character in <var title="">value</var> is a U+0025 PERCENT SIGN
+       character (%), then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If the last character in <var title="">value</var> is a
+       U+0025 PERCENT SIGN character (%), then let <var title="">cue</var>'s <a href=#timed-track-cue-snap-to-lines-flag>timed track cue snap-to-lines
+       flag</a> to true.</li>
+
+       <li><p>Ignoring the trailing percent sign, if any, interpret
+       <var title="">value</var> as a (potentially signed) integer,
+       and let <var title="">number</var> be that number.</li>
+
+       <li><p>If the modulus of <var title="">number</var> is not in
+       the range 0 ≤ <var title="">number</var> ≤ 100, then jump back to the
+       step labeled <i>settings</i>.</li>
+
+       <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-line-position>timed track cue line
+       position</a> be <var title="">number</var>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+0054 LATIN CAPITAL
+     LETTER T character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
+       (9). Let <var title="">value</var> be those characters, if
+       any.</li>
+
+       <li><p>If <var title="">position</var> is beyond the end of
+       <var title="">input</var> then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If the character at <var title="">position</var> is not
+       a U+0025 PERCENT SIGN character (%), then then jump to the
+       "otherwise" case below.</li>
+
+       <li><p>Move <var title="">position</var> forwards one
+       character.</li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var title="">position</var> is not a <a href=#space-character>space character</a>,
+       then jump to the "otherwise" case below.</li>
+
+       <li><p>If <var title="">value</var> is the empty string, then
+       jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Interpret <var title="">value</var> as an integer, and
+       let <var title="">number</var> be that number.</li>
+
+       <li><p>If <var title="">number</var> is not in the range
+       0 ≤ <var title="">number</var> ≤ 100,
+       then jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Let<var title="">cue</var>'s <a href=#timed-track-cue-text-position>timed track cue text
+       position</a> be <var title="">number</var>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+0053 LATIN CAPITAL
+     LETTER S character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
+       (9). Let <var title="">value</var> be those characters, if
+       any.</li>
+
+       <li><p>If <var title="">position</var> is beyond the end of
+       <var title="">input</var> then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If the character at <var title="">position</var> is not
+       a U+0025 PERCENT SIGN character (%), then then jump to the
+       "otherwise" case below.</li>
+
+       <li><p>Move <var title="">position</var> forwards one
+       character.</li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var title="">position</var> is not a <a href=#space-character>space character</a>,
+       then jump to the "otherwise" case below.</li>
+
+       <li><p>If <var title="">value</var> is the empty string, then
+       jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Interpret <var title="">value</var> as an integer, and
+       let <var title="">number</var> be that number.</li>
+
+       <li><p>If <var title="">number</var> is not in the range
+       0 ≤ <var title="">number</var> ≤ 100,
+       then jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Let<var title="">cue</var>'s <a href=#timed-track-cue-size>timed track cue
+       size</a> be <var title="">number</var>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+0041 LATIN CAPITAL
+     LETTER A character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       not <a href=#space-character title="space character">space characters</a>. Let
+       <var title="">value</var> be those characters, if any.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">start</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-alignment>timed track cue alignment</a> be <a href=#timed-track-cue-start-alignment title="timed
+       track cue start alignment">start alignment</a>.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">middle</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-alignment>timed track cue alignment</a> be <a href=#timed-track-cue-middle-alignment title="timed
+       track cue middle alignment">middle alignment</a>.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">end</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-alignment>timed track cue alignment</a> be <a href=#timed-track-cue-end-alignment title="timed
+       track cue end alignment">end alignment</a>.</li>
+
+      </ol></dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>
+
+       <p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are not
+       <a href=#space-character title="space character">space characters</a> and
+       discard them.</p>
+
+     </dd>
+
+    </dl></li>
+
+   <li><p>Jump back to the step labeled <i>settings</i>.</li>
+
   </ol><p class=XXX><dfn id=collect-a-websrt-timestamp>Collect a WebSRT timestamp</dfn>...</p>
 
   </div>

Modified: index
===================================================================
--- index	2010-06-25 21:40:00 UTC (rev 5112)
+++ index	2010-06-26 00:55:41 UTC (rev 5113)
@@ -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 — 25 June 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 26 June 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>-->
@@ -26144,10 +26144,13 @@
 
    <dt><dfn id=timed-track-cue-line-position title="timed track cue line position">A line position</dfn>
    <dd>
-    <p>A number giving the position of the lines of the cue, to be
-    interpreted as defined by the <a href=#timed-track-cue-writing-direction title="timed track cue writing
-    direction">writing direction</a> and <a href=#timed-track-cue-snap-to-lines-flag title="timed track
-    cue snap-to-lines flag">snap-to-lines flag</a> of the cue.</p>
+    <p>Either a number giving the position of the lines of the cue, to
+    be interpreted as defined by the <a href=#timed-track-cue-writing-direction title="timed track cue
+    writing direction">writing direction</a> and <a href=#timed-track-cue-snap-to-lines-flag title="timed
+    track cue snap-to-lines flag">snap-to-lines flag</a> of the
+    cue, or the special value <dfn id=timed-track-cue-automatic-line-position title="timed track cue automatic line
+    position">auto</dfn>, which means the position is to depend on
+    the other active tracks.</p>
    </dd>
 
    <dt><dfn id=timed-track-cue-text-position title="timed track cue text position">A text position</dfn>
@@ -26702,14 +26705,20 @@
   component must not be included more than once per <a href=#websrt-cue-settings>WebSRT cue
   settings</a> string.</p>
 
-  <ul class=brief><li>A <a href=#websrt-line-position-cue-setting>WebSRT line position cue setting</a>.</li>
-   <li>A <a href=#websrt-text-position-cue-setting>WebSRT text position cue setting</a>.</li>
-   <li>A <a href=#websrt-alignment-cue-setting>WebSRT alignment cue setting</a>.</li>
-   <li>A <a href=#websrt-size-cue-setting>WebSRT size cue setting</a>.</li>
-   <li>A <a href=#websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</a>.</li>
-  </ul><p>A <dfn id=websrt-line-position-cue-setting>WebSRT line position cue setting</dfn> consists of the
+  <ul class=brief><li>A <a href=#websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</a>.</li> <!-- D:vertical -->
+   <li>A <a href=#websrt-line-position-cue-setting>WebSRT line position cue setting</a>.</li> <!-- L:100% L:1 L:-1 -->
+   <li>A <a href=#websrt-text-position-cue-setting>WebSRT text position cue setting</a>.</li> <!-- T:100% -->
+   <li>A <a href=#websrt-size-cue-setting>WebSRT size cue setting</a>.</li>          <!-- S:100% -->
+   <li>A <a href=#websrt-alignment-cue-setting>WebSRT alignment cue setting</a>.</li>     <!-- A:start/middle/end -->
+  </ul><p>A <dfn id=websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</dfn> consists of the
   following components, in the order given:</p>
 
+  <ol><li>A U+0044 LATIN CAPITAL LETTER D character.</li>
+   <li>A U+003A COLON character (:).</li>
+   <li>The string "<code title="">vertical</code>".</li>
+  </ol><p>A <dfn id=websrt-line-position-cue-setting>WebSRT line position cue setting</dfn> consists of the
+  following components, in the order given:</p>
+
   <ol><li><p>A U+004C LATIN CAPITAL LETTER L character.</li>
    <li><p>A U+003A COLON character (:).</li>
    <li>Either:
@@ -26731,12 +26740,6 @@
    <li>A U+003A COLON character (:).</li>
    <li>One or more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9).</li>
    <li>A U+0025 PERCENT SIGN character (%).</li>
-  </ol><p>A <dfn id=websrt-alignment-cue-setting>WebSRT alignment cue setting</dfn> consists of the
-  following components, in the order given:</p>
-
-  <ol><li>A U+0041 LATIN CAPITAL LETTER A character.</li>
-   <li>A U+003A COLON character (:).</li>
-   <li>One of the following strings: "<code title="">start</code>", "<code title="">middle</code>", "<code title="">end</code>"</li>
   </ol><p>A <dfn id=websrt-size-cue-setting>WebSRT size cue setting</dfn> consists of the
   following components, in the order given:</p>
 
@@ -26744,12 +26747,12 @@
    <li>A U+003A COLON character (:).</li>
    <li>One or more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9).</li>
    <li>A U+0025 PERCENT SIGN character (%).</li>
-  </ol><p>A <dfn id=websrt-vertical-text-cue-setting>WebSRT vertical text cue setting</dfn> consists of the
+  </ol><p>A <dfn id=websrt-alignment-cue-setting>WebSRT alignment cue setting</dfn> consists of the
   following components, in the order given:</p>
 
-  <ol><li>A U+0044 LATIN CAPITAL LETTER D character.</li>
+  <ol><li>A U+0041 LATIN CAPITAL LETTER A character.</li>
    <li>A U+003A COLON character (:).</li>
-   <li>The string "<code title="">vertical</code>".</li>
+   <li>One of the following strings: "<code title="">start</code>", "<code title="">middle</code>", "<code title="">end</code>"</li>
   </ol><p class=XXX><dfn id=websrt-voice-declaration>WebSRT voice declaration</dfn>; <dfn id=websrt-cue-text-line>WebSRT cue text line</dfn></p>
 
 
@@ -26800,25 +26803,61 @@
    characters</a> that are either U+000D CARRIAGE RETURN (CR) or
    U+000A LINE FEED (LF) characters.</li>
 
-   <li><p>Let <var title="">id</var> be the empty string.</li>
+   <li><p>Let <var title="">cue</var> be a new <a href=#timed-track-cue>timed track
+   cue</a>.</li>
 
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-identifier>timed track cue
+   identifier</a> be the empty string.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-pause-on-exit-flag>timed track cue
+   pause-on-exit flag</a> be false.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-writing-direction>timed track cue
+   writing direction</a> be <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue
+   horizontal writing direction">horizontal</a>.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-snap-to-lines-flag>timed track cue
+   snap-to-lines flag</a> be true.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-line-position>timed track cue line
+   position</a> be <a href=#timed-track-cue-automatic-line-position title="timed track cue automatic line
+   position">auto</a>.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-text-position>timed track cue
+   text position</a> be 50.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-size>timed track cue
+   size</a> be 100.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-alignment>timed track cue
+   alignment</a> be <a href=#timed-track-cue-middle-alignment title="timed track cue middle
+   alignment">middle alignment</a>.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue
+   voice identifier</a> be the empty string.</li>
+
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-text>timed track cue
+   text</a> be the empty string.</li>
+
    <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
    <em>not</em> U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF)
    characters. Let <var title="">line</var> be those characters, if
    any.</li>
 
-   <li><p>If <var title="">line</var> is the empty string, then jump
-   to the step labeled <i>end</i>.</li>
+   <li><p>If <var title="">line</var> is the empty string, then
+   discard <var title="">cue</var> and jump to the step labeled
+   <i>end</i>.</li>
 
    <li><p>If <var title="">line</var> contains the three-character
    substring "<code title="">--></code>" (U+002D HYPHEN-MINUS, U+002D
    HYPHEN-MINUS, U+003E GREATER-THAN SIGN), then jump to the step
    labeled <i>timings</i> below.</li>
 
-   <li><p>Let <var title="">id</var> be <var title="">line</var>.<p></li>
+   <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-identifier>timed track cue
+   identifier</a> be <var title="">line</var>.<p></li>
 
-   <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then jump to the step labeled
-   <i>end</i>.</li>
+   <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then discard <var title="">cue</var> and jump
+   to the step labeled <i>end</i>.</li>
 
    <li><p>If the character indicated by <var title="">position</var>
    is a U+000D CARRIAGE RETURN (CR) character, advance <var title="">position</var> to the next character in <var title="">input</var>.</li>
@@ -26831,8 +26870,9 @@
    characters. Let <var title="">line</var> be those characters, if
    any.</li>
 
-   <li><p>If <var title="">line</var> is the empty string, then jump
-   to the step labeled <i>cue loop</i>.</li>
+   <li><p>If <var title="">line</var> is the empty string, then
+   discard <var title="">cue</var> and jump to the step labeled <i>cue
+   loop</i>.</li>
 
    <li><p>If <var title="">line</var> does not contain the
    three-character substring "<code title="">--></code>" (U+002D
@@ -26840,28 +26880,32 @@
    jump to the step labeled <i>bad cue</i> below.</li>
 
    <li><p><i>Timings</i>: <a href=#collect-websrt-cue-timings-and-settings>Collect WebSRT cue timings and
-   settings</a> from <var title="">line</var>. If that fails, jump
-   to the step labeled <i>bad cue</i>. Otherwise, let <var title="">start time</var> be the first collected time, <var title="">end time</var> be the second collected time, and
-   <span class=XXX>...settings...</span>.</li>
+   settings</a> from <var title="">line</var>, using <var title="">cue</var> for the results. If that fails, jump to the step
+   labeled <i>bad cue</i>.</li>
 
    <li><p class=XXX>...voice...</li>
 
    <li><p class=XXX>...cues...</li>
 
-   <li><p>Let <var title="">cue</var> be a newly created <a href=#timed-track-cue>timed
-   track cue</a>.</li>
+   <li><p>Add <var title="">cue</var> to the <a href=#timed-track-list-of-cues>timed track list of
+   cues</a> <var title="">output</var>.</li>
 
-   <li><p class=XXX>...fill cue...</li>
+   <li><p>Jump to the step labeled <i>cue loop</i>.</li>
 
+   <li><p><i>Bad cue</i>: Discard <var title="">cue</var>.</li>
+
+   <li><p class=XXX>read until the next blank line; if you hit the
+   end of the file jump to <i>end</i>.</li>
+
    <li><p>Jump to the step labeled <i>cue loop</i>.</li>
 
    <li><p><i>End</i>: The file has ended. Abort these steps. The
    <a href=#websrt-parser>WebSRT parser</a> has finished.</li>
 
   </ol><p>When the algorithm above requires that the user agent
-  <dfn id=collect-websrt-cue-timings-and-settings>collect WebSRT cue timings and settings</dfn> from a string,
-  the user agent must run the following algorithm. This algorithm
-  either fails, or returns two timestamps and <span class=XXX>...settings...</span>.</p>
+  <dfn id=collect-websrt-cue-timings-and-settings>collect WebSRT cue timings and settings</dfn> from a string
+  <var title="">input</var> for a <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var>, the user agent must run the following
+  algorithm.</p>
 
   <ol><li><p>Let <var title="">input</var> be the string being
    parsed.</li>
@@ -26872,23 +26916,249 @@
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
    <li><p><a href=#collect-a-websrt-timestamp>Collect a WebSRT timestamp</a>. If that algorithm
-   fails, then abort these steps and return failure.</li>
+   fails, then abort these steps and return failure. Otherwise, let
+   <var title="">cue</var>'s <a href=#timed-track-cue-start-time>timed track cue start time</a>
+   be the collected time.</li>
 
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
-   <li><p class=XXX>check that we're at "<--" and fail if we're not</li>
+   <!-- we can't be beyond the end of the string until we've seen the
+   arrow, since we know the arrow is in the string and nothing we've
+   done so far would move us past the first "-". -->
 
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var title="">position</var> is not a U+002D HYPHEN-MINUS character (-)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</li>
+
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var title="">position</var> is not a U+002D HYPHEN-MINUS character (-)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</li>
+
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var title="">position</var> is not a U+003E GREATER-THAN SIGN character (>)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</li>
+
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
    <li><p><a href=#collect-a-websrt-timestamp>Collect a WebSRT timestamp</a>. If that algorithm
-   fails, then abort these steps and return failure.</li>
+   fails, then abort these steps and return failure. Otherwise, let
+   <var title="">cue</var>'s <a href=#timed-track-cue-end-time>timed track cue end time</a>
+   be the collected time.</li>
 
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
-   <li><p class=XXX>...settings...</li>
+   <li><p><i>Settings</i>: If <var title="">position</var> is beyond
+   the end of <var title="">input</var> then abort these
+   steps.</li>
 
-   <li><p>Return the two collected timestamps and <span class=XXX>...settings...</span>.</li>
+   <li><p>Let <var title="">setting</var> be the character at <var title="">position</var>, and move <var title="">position</var>
+   forwards one character.</p>
 
+   <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> then abort these steps.</li>
+
+   <li><p>If the character at <var title="">position</var> is not a
+   U+003A COLON character (:), then set <var title="">setting</var> to
+   the empty string.</li>
+
+   <li><p>Move <var title="">position</var> forwards one
+   character.</li>
+
+   <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> then abort these steps.</li>
+
+   <li>
+
+    <p>Run the appropriate substeps that apply for the value of <var title="">setting</var>, as follows:</p>
+
+    <dl><dt>If <var title="">setting</var> is a U+0044 LATIN CAPITAL
+     LETTER D character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       not <a href=#space-character title="space character">space characters</a>. Let
+       <var title="">value</var> be those characters, if any.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">vertical</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> be <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing
+       direction">horizontal</a>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+004C LATIN CAPITAL
+     LETTER L character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       either U+002D HYPHEN-MINUS characters (-), U+0025 PERCENT SIGN
+       characters (%), or characters in the range U+0030 DIGIT ZERO
+       (0) to U+0039 DIGIT NINE (9). Let <var title="">value</var> be
+       those characters, if any.</li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var title="">position</var> is not a <a href=#space-character>space character</a>,
+       then jump to the "otherwise" case below.</li>
+
+       <li><p>If <var title="">value</var> does not contain at least
+       one character in the range U+0030 DIGIT ZERO (0) to U+0039
+       DIGIT NINE (9), then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If any character in <var title="">value</var> other than
+       the first character is a U+002D HYPHEN-MINUS character (-),
+       then jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>If any character in <var title="">value</var> other than
+       the last character is a U+0025 PERCENT SIGN character (%), then
+       jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>If the first character in <var title="">value</var> is a
+       U+002D HYPHEN-MINUS character (-) <em>and</em> the last
+       character in <var title="">value</var> is a U+0025 PERCENT SIGN
+       character (%), then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If the last character in <var title="">value</var> is a
+       U+0025 PERCENT SIGN character (%), then let <var title="">cue</var>'s <a href=#timed-track-cue-snap-to-lines-flag>timed track cue snap-to-lines
+       flag</a> to true.</li>
+
+       <li><p>Ignoring the trailing percent sign, if any, interpret
+       <var title="">value</var> as a (potentially signed) integer,
+       and let <var title="">number</var> be that number.</li>
+
+       <li><p>If the modulus of <var title="">number</var> is not in
+       the range 0 ≤ <var title="">number</var> ≤ 100, then jump back to the
+       step labeled <i>settings</i>.</li>
+
+       <li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-line-position>timed track cue line
+       position</a> be <var title="">number</var>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+0054 LATIN CAPITAL
+     LETTER T character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
+       (9). Let <var title="">value</var> be those characters, if
+       any.</li>
+
+       <li><p>If <var title="">position</var> is beyond the end of
+       <var title="">input</var> then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If the character at <var title="">position</var> is not
+       a U+0025 PERCENT SIGN character (%), then then jump to the
+       "otherwise" case below.</li>
+
+       <li><p>Move <var title="">position</var> forwards one
+       character.</li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var title="">position</var> is not a <a href=#space-character>space character</a>,
+       then jump to the "otherwise" case below.</li>
+
+       <li><p>If <var title="">value</var> is the empty string, then
+       jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Interpret <var title="">value</var> as an integer, and
+       let <var title="">number</var> be that number.</li>
+
+       <li><p>If <var title="">number</var> is not in the range
+       0 ≤ <var title="">number</var> ≤ 100,
+       then jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Let<var title="">cue</var>'s <a href=#timed-track-cue-text-position>timed track cue text
+       position</a> be <var title="">number</var>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+0053 LATIN CAPITAL
+     LETTER S character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
+       (9). Let <var title="">value</var> be those characters, if
+       any.</li>
+
+       <li><p>If <var title="">position</var> is beyond the end of
+       <var title="">input</var> then jump back to the step labeled
+       <i>settings</i>.</li>
+
+       <li><p>If the character at <var title="">position</var> is not
+       a U+0025 PERCENT SIGN character (%), then then jump to the
+       "otherwise" case below.</li>
+
+       <li><p>Move <var title="">position</var> forwards one
+       character.</li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var title="">position</var> is not a <a href=#space-character>space character</a>,
+       then jump to the "otherwise" case below.</li>
+
+       <li><p>If <var title="">value</var> is the empty string, then
+       jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Interpret <var title="">value</var> as an integer, and
+       let <var title="">number</var> be that number.</li>
+
+       <li><p>If <var title="">number</var> is not in the range
+       0 ≤ <var title="">number</var> ≤ 100,
+       then jump back to the step labeled <i>settings</i>.</li>
+
+       <li><p>Let<var title="">cue</var>'s <a href=#timed-track-cue-size>timed track cue
+       size</a> be <var title="">number</var>.</li>
+
+      </ol></dd>
+
+     <dt>If <var title="">setting</var> is a U+0041 LATIN CAPITAL
+     LETTER A character</dt>
+
+     <dd>
+
+      <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
+       not <a href=#space-character title="space character">space characters</a>. Let
+       <var title="">value</var> be those characters, if any.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">start</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-alignment>timed track cue alignment</a> be <a href=#timed-track-cue-start-alignment title="timed
+       track cue start alignment">start alignment</a>.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">middle</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-alignment>timed track cue alignment</a> be <a href=#timed-track-cue-middle-alignment title="timed
+       track cue middle alignment">middle alignment</a>.</li>
+
+       <li><p>If <var title="">value</var> is a
+       <a href=#case-sensitive>case-sensitive</a> match for the string "<code title="">end</code>", then let <var title="">cue</var>'s
+       <a href=#timed-track-cue-alignment>timed track cue alignment</a> be <a href=#timed-track-cue-end-alignment title="timed
+       track cue end alignment">end alignment</a>.</li>
+
+      </ol></dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>
+
+       <p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are not
+       <a href=#space-character title="space character">space characters</a> and
+       discard them.</p>
+
+     </dd>
+
+    </dl></li>
+
+   <li><p>Jump back to the step labeled <i>settings</i>.</li>
+
   </ol><p class=XXX><dfn id=collect-a-websrt-timestamp>Collect a WebSRT timestamp</dfn>...</p>
 
   </div>

Modified: source
===================================================================
--- source	2010-06-25 21:40:00 UTC (rev 5112)
+++ source	2010-06-26 00:55:41 UTC (rev 5113)
@@ -28358,10 +28358,13 @@
 
    <dt><dfn title="timed track cue line position">A line position</dfn>
    <dd>
-    <p>A number giving the position of the lines of the cue, to be
-    interpreted as defined by the <span title="timed track cue writing
-    direction">writing direction</span> and <span title="timed track
-    cue snap-to-lines flag">snap-to-lines flag</span> of the cue.</p>
+    <p>Either a number giving the position of the lines of the cue, to
+    be interpreted as defined by the <span title="timed track cue
+    writing direction">writing direction</span> and <span title="timed
+    track cue snap-to-lines flag">snap-to-lines flag</span> of the
+    cue, or the special value <dfn title="timed track cue automatic line
+    position">auto</dfn>, which means the position is to depend on
+    the other active tracks.</p>
    </dd>
 
    <dt><dfn title="timed track cue text position">A text position</dfn>
@@ -28999,13 +29002,22 @@
   settings</span> string.</p>
 
   <ul class="brief"> 
-   <li>A <span>WebSRT line position cue setting</span>.</li>
-   <li>A <span>WebSRT text position cue setting</span>.</li>
-   <li>A <span>WebSRT alignment cue setting</span>.</li>
-   <li>A <span>WebSRT size cue setting</span>.</li>
-   <li>A <span>WebSRT vertical text cue setting</span>.</li>
+   <li>A <span>WebSRT vertical text cue setting</span>.</li> <!-- D:vertical -->
+   <li>A <span>WebSRT line position cue setting</span>.</li> <!-- L:100% L:1 L:-1 -->
+   <li>A <span>WebSRT text position cue setting</span>.</li> <!-- T:100% -->
+   <li>A <span>WebSRT size cue setting</span>.</li>          <!-- S:100% -->
+   <li>A <span>WebSRT alignment cue setting</span>.</li>     <!-- A:start/middle/end -->
   </ul>
 
+  <p>A <dfn>WebSRT vertical text cue setting</dfn> consists of the
+  following components, in the order given:</p>
+
+  <ol>
+   <li>A U+0044 LATIN CAPITAL LETTER D character.</li>
+   <li>A U+003A COLON character (:).</li>
+   <li>The string "<code title="">vertical</code>".</li>
+  </ol>
+
   <p>A <dfn>WebSRT line position cue setting</dfn> consists of the
   following components, in the order given:</p>
 
@@ -29042,15 +29054,6 @@
    <li>A U+0025 PERCENT SIGN character (%).</li>
   </ol>
 
-  <p>A <dfn>WebSRT alignment cue setting</dfn> consists of the
-  following components, in the order given:</p>
-
-  <ol>
-   <li>A U+0041 LATIN CAPITAL LETTER A character.</li>
-   <li>A U+003A COLON character (:).</li>
-   <li>One of the following strings: "<code title="">start</code>", "<code title="">middle</code>", "<code title="">end</code>"</li>
-  </ol>
-
   <p>A <dfn>WebSRT size cue setting</dfn> consists of the
   following components, in the order given:</p>
 
@@ -29061,13 +29064,13 @@
    <li>A U+0025 PERCENT SIGN character (%).</li>
   </ol>
 
-  <p>A <dfn>WebSRT vertical text cue setting</dfn> consists of the
+  <p>A <dfn>WebSRT alignment cue setting</dfn> consists of the
   following components, in the order given:</p>
 
   <ol>
-   <li>A U+0044 LATIN CAPITAL LETTER D character.</li>
+   <li>A U+0041 LATIN CAPITAL LETTER A character.</li>
    <li>A U+003A COLON character (:).</li>
-   <li>The string "<code title="">vertical</code>".</li>
+   <li>One of the following strings: "<code title="">start</code>", "<code title="">middle</code>", "<code title="">end</code>"</li>
   </ol>
 
   <p class="XXX"><dfn>WebSRT voice declaration</dfn>; <dfn>WebSRT cue text line</dfn></p>
@@ -29131,27 +29134,62 @@
    characters</span> that are either U+000D CARRIAGE RETURN (CR) or
    U+000A LINE FEED (LF) characters.</p></li>
 
-   <li><p>Let <var title="">id</var> be the empty string.</p></li>
+   <li><p>Let <var title="">cue</var> be a new <span>timed track
+   cue</span>.</p></li>
 
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   identifier</span> be the empty string.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   pause-on-exit flag</span> be false.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   writing direction</span> be <span title="timed track cue
+   horizontal writing direction">horizontal</span>.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   snap-to-lines flag</span> be true.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue line
+   position</span> be <span title="timed track cue automatic line
+   position">auto</span>.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   text position</span> be 50.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   size</span> be 100.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   alignment</span> be <span title="timed track cue middle
+   alignment">middle alignment</span>.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   voice identifier</span> be the empty string.</p></li>
+
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   text</span> be the empty string.</p></li>
+
    <li><p><span>Collect a sequence of characters</span> that are
    <em>not</em> U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF)
    characters. Let <var title="">line</var> be those characters, if
    any.</p></li>
 
-   <li><p>If <var title="">line</var> is the empty string, then jump
-   to the step labeled <i>end</i>.</p></li>
+   <li><p>If <var title="">line</var> is the empty string, then
+   discard <var title="">cue</var> and jump to the step labeled
+   <i>end</i>.</p></li>
 
    <li><p>If <var title="">line</var> contains the three-character
    substring "<code title="">--></code>" (U+002D HYPHEN-MINUS, U+002D
    HYPHEN-MINUS, U+003E GREATER-THAN SIGN), then jump to the step
    labeled <i>timings</i> below.</p></li>
 
-   <li><p>Let <var title="">id</var> be <var
-   title="">line</var>.<p></li>
+   <li><p>Let <var title="">cue</var>'s <span>timed track cue
+   identifier</span> be <var title="">line</var>.<p></li>
 
    <li><p>If <var title="">position</var> is past the end of <var
-   title="">input</var>, then jump to the step labeled
-   <i>end</i>.</p></li>
+   title="">input</var>, then discard <var title="">cue</var> and jump
+   to the step labeled <i>end</i>.</p></li>
 
    <li><p>If the character indicated by <var title="">position</var>
    is a U+000D CARRIAGE RETURN (CR) character, advance <var
@@ -29168,8 +29206,9 @@
    characters. Let <var title="">line</var> be those characters, if
    any.</p></li>
 
-   <li><p>If <var title="">line</var> is the empty string, then jump
-   to the step labeled <i>cue loop</i>.</p></li>
+   <li><p>If <var title="">line</var> is the empty string, then
+   discard <var title="">cue</var> and jump to the step labeled <i>cue
+   loop</i>.</p></li>
 
    <li><p>If <var title="">line</var> does not contain the
    three-character substring "<code title="">--></code>" (U+002D
@@ -29177,21 +29216,24 @@
    jump to the step labeled <i>bad cue</i> below.</p></li>
 
    <li><p><i>Timings</i>: <span>Collect WebSRT cue timings and
-   settings</span> from <var title="">line</var>. If that fails, jump
-   to the step labeled <i>bad cue</i>. Otherwise, let <var
-   title="">start time</var> be the first collected time, <var
-   title="">end time</var> be the second collected time, and
-   <span class="XXX">...settings...</span>.</p></li>
+   settings</span> from <var title="">line</var>, using <var
+   title="">cue</var> for the results. If that fails, jump to the step
+   labeled <i>bad cue</i>.</p></li>
 
    <li><p class="XXX">...voice...</p></li>
 
    <li><p class="XXX">...cues...</p></li>
 
-   <li><p>Let <var title="">cue</var> be a newly created <span>timed
-   track cue</span>.</p></li>
+   <li><p>Add <var title="">cue</var> to the <span>timed track list of
+   cues</span> <var title="">output</var>.</p></li>
 
-   <li><p class="XXX">...fill cue...</p></li>
+   <li><p>Jump to the step labeled <i>cue loop</i>.</p></li>
 
+   <li><p><i>Bad cue</i>: Discard <var title="">cue</var>.</p></li>
+
+   <li><p class="XXX">read until the next blank line; if you hit the
+   end of the file jump to <i>end</i>.</p></li>
+
    <li><p>Jump to the step labeled <i>cue loop</i>.</p></li>
 
    <li><p><i>End</i>: The file has ended. Abort these steps. The
@@ -29200,9 +29242,10 @@
   </ol>
 
   <p>When the algorithm above requires that the user agent
-  <dfn>collect WebSRT cue timings and settings</dfn> from a string,
-  the user agent must run the following algorithm. This algorithm
-  either fails, or returns two timestamps and <span class="XXX">...settings...</span>.</p>
+  <dfn>collect WebSRT cue timings and settings</dfn> from a string
+  <var title="">input</var> for a <span>timed track cue</span> <var
+  title="">cue</var>, the user agent must run the following
+  algorithm.</p>
 
   <ol>
 
@@ -29216,23 +29259,290 @@
    <li><p><span>Skip whitespace</span>.</p></li>
 
    <li><p><span>Collect a WebSRT timestamp</span>. If that algorithm
-   fails, then abort these steps and return failure.</p></li>
+   fails, then abort these steps and return failure. Otherwise, let
+   <var title="">cue</var>'s <span>timed track cue start time</span>
+   be the collected time.</p></li>
 
    <li><p><span>Skip whitespace</span>.</p></li>
 
-   <li><p class="XXX">check that we're at "<--" and fail if we're not</p></li>
+   <!-- we can't be beyond the end of the string until we've seen the
+   arrow, since we know the arrow is in the string and nothing we've
+   done so far would move us past the first "-". -->
 
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var
+   title="">position</var> is not a U+002D HYPHEN-MINUS character (-)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</p></li>
+
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var
+   title="">position</var> is not a U+002D HYPHEN-MINUS character (-)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</p></li>
+
+   <li><p>If <!--<var title="">position</var> is beyond the end of
+   <var title="">input</var> or if--> the character at <var
+   title="">position</var> is not a U+003E GREATER-THAN SIGN character (>)
+   then fail. Otherwise, move <var title="">position</var> forwards
+   one character.</p></li>
+
    <li><p><span>Skip whitespace</span>.</p></li>
 
    <li><p><span>Collect a WebSRT timestamp</span>. If that algorithm
-   fails, then abort these steps and return failure.</p></li>
+   fails, then abort these steps and return failure. Otherwise, let
+   <var title="">cue</var>'s <span>timed track cue end time</span>
+   be the collected time.</p></li>
 
    <li><p><span>Skip whitespace</span>.</p></li>
 
-   <li><p class="XXX">...settings...</p></li>
+   <li><p><i>Settings</i>: If <var title="">position</var> is beyond
+   the end of <var title="">input</var> then abort these
+   steps.</p></li>
 
-   <li><p>Return the two collected timestamps and <span class="XXX">...settings...</span>.</p></li>
+   <li><p>Let <var title="">setting</var> be the character at <var
+   title="">position</var>, and move <var title="">position</var>
+   forwards one character.</p>
 
+   <li><p>If <var title="">position</var> is beyond the end of <var
+   title="">input</var> then abort these steps.</p></li>
+
+   <li><p>If the character at <var title="">position</var> is not a
+   U+003A COLON character (:), then set <var title="">setting</var> to
+   the empty string.</p></li>
+
+   <li><p>Move <var title="">position</var> forwards one
+   character.</p></li>
+
+   <li><p>If <var title="">position</var> is beyond the end of <var
+   title="">input</var> then abort these steps.</p></li>
+
+   <li>
+
+    <p>Run the appropriate substeps that apply for the value of <var
+    title="">setting</var>, as follows:</p>
+
+    <dl>
+
+     <dt>If <var title="">setting</var> is a U+0044 LATIN CAPITAL
+     LETTER D character</dt>
+
+     <dd>
+
+      <ol>
+
+       <li><p><span>Collect a sequence of characters</span> that are
+       not <span title="space character">space characters</span>. Let
+       <var title="">value</var> be those characters, if any.</p></li>
+
+       <li><p>If <var title="">value</var> is a
+       <span>case-sensitive</span> match for the string "<code
+       title="">vertical</code>", then let <var title="">cue</var>'s
+       <span>timed track cue writing direction</span> be <span
+       title="timed track cue horizontal writing
+       direction">horizontal</span>.</p></li>
+
+      </ol>
+
+     </dd>
+
+     <dt>If <var title="">setting</var> is a U+004C LATIN CAPITAL
+     LETTER L character</dt>
+
+     <dd>
+
+      <ol>
+
+       <li><p><span>Collect a sequence of characters</span> that are
+       either U+002D HYPHEN-MINUS characters (-), U+0025 PERCENT SIGN
+       characters (%), or characters in the range U+0030 DIGIT ZERO
+       (0) to U+0039 DIGIT NINE (9). Let <var title="">value</var> be
+       those characters, if any.</p></li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var
+       title="">position</var> is not a <span>space character</span>,
+       then jump to the "otherwise" case below.</p></li>
+
+       <li><p>If <var title="">value</var> does not contain at least
+       one character in the range U+0030 DIGIT ZERO (0) to U+0039
+       DIGIT NINE (9), then jump back to the step labeled
+       <i>settings</i>.</p></li>
+
+       <li><p>If any character in <var title="">value</var> other than
+       the first character is a U+002D HYPHEN-MINUS character (-),
+       then jump back to the step labeled <i>settings</i>.</p></li>
+
+       <li><p>If any character in <var title="">value</var> other than
+       the last character is a U+0025 PERCENT SIGN character (%), then
+       jump back to the step labeled <i>settings</i>.</p></li>
+
+       <li><p>If the first character in <var title="">value</var> is a
+       U+002D HYPHEN-MINUS character (-) <em>and</em> the last
+       character in <var title="">value</var> is a U+0025 PERCENT SIGN
+       character (%), then jump back to the step labeled
+       <i>settings</i>.</p></li>
+
+       <li><p>If the last character in <var title="">value</var> is a
+       U+0025 PERCENT SIGN character (%), then let <var
+       title="">cue</var>'s <span>timed track cue snap-to-lines
+       flag</span> to true.</p></li>
+
+       <li><p>Ignoring the trailing percent sign, if any, interpret
+       <var title="">value</var> as a (potentially signed) integer,
+       and let <var title="">number</var> be that number.</p></li>
+
+       <li><p>If the modulus of <var title="">number</var> is not in
+       the range 0 ≤ <var
+       title="">number</var> ≤ 100, then jump back to the
+       step labeled <i>settings</i>.</p></li>
+
+       <li><p>Let <var title="">cue</var>'s <span>timed track cue line
+       position</span> be <var title="">number</var>.</p></li>
+
+      </ol>
+
+     </dd>
+
+     <dt>If <var title="">setting</var> is a U+0054 LATIN CAPITAL
+     LETTER T character</dt>
+
+     <dd>
+
+      <ol>
+
+       <li><p><span>Collect a sequence of characters</span> that are
+       in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
+       (9). Let <var title="">value</var> be those characters, if
+       any.</p></li>
+
+       <li><p>If <var title="">position</var> is beyond the end of
+       <var title="">input</var> then jump back to the step labeled
+       <i>settings</i>.</p></li>
+
+       <li><p>If the character at <var title="">position</var> is not
+       a U+0025 PERCENT SIGN character (%), then then jump to the
+       "otherwise" case below.</p></li>
+
+       <li><p>Move <var title="">position</var> forwards one
+       character.</p></li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var
+       title="">position</var> is not a <span>space character</span>,
+       then jump to the "otherwise" case below.</p></li>
+
+       <li><p>If <var title="">value</var> is the empty string, then
+       jump back to the step labeled <i>settings</i>.</p></li>
+
+       <li><p>Interpret <var title="">value</var> as an integer, and
+       let <var title="">number</var> be that number.</p></li>
+
+       <li><p>If <var title="">number</var> is not in the range
+       0 ≤ <var title="">number</var> ≤ 100,
+       then jump back to the step labeled <i>settings</i>.</p></li>
+
+       <li><p>Let<var title="">cue</var>'s <span>timed track cue text
+       position</span> be <var title="">number</var>.</p></li>
+
+      </ol>
+
+     </dd>
+
+     <dt>If <var title="">setting</var> is a U+0053 LATIN CAPITAL
+     LETTER S character</dt>
+
+     <dd>
+
+      <ol>
+
+       <li><p><span>Collect a sequence of characters</span> that are
+       in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
+       (9). Let <var title="">value</var> be those characters, if
+       any.</p></li>
+
+       <li><p>If <var title="">position</var> is beyond the end of
+       <var title="">input</var> then jump back to the step labeled
+       <i>settings</i>.</p></li>
+
+       <li><p>If the character at <var title="">position</var> is not
+       a U+0025 PERCENT SIGN character (%), then then jump to the
+       "otherwise" case below.</p></li>
+
+       <li><p>Move <var title="">position</var> forwards one
+       character.</p></li>
+
+       <li><p>If <var title="">position</var> is not beyond the end of
+       <var title="">input</var> but the character at <var
+       title="">position</var> is not a <span>space character</span>,
+       then jump to the "otherwise" case below.</p></li>
+
+       <li><p>If <var title="">value</var> is the empty string, then
+       jump back to the step labeled <i>settings</i>.</p></li>
+
+       <li><p>Interpret <var title="">value</var> as an integer, and
+       let <var title="">number</var> be that number.</p></li>
+
+       <li><p>If <var title="">number</var> is not in the range
+       0 ≤ <var title="">number</var> ≤ 100,
+       then jump back to the step labeled <i>settings</i>.</p></li>
+
+       <li><p>Let<var title="">cue</var>'s <span>timed track cue
+       size</span> be <var title="">number</var>.</p></li>
+
+      </ol>
+
+     </dd>
+
+     <dt>If <var title="">setting</var> is a U+0041 LATIN CAPITAL
+     LETTER A character</dt>
+
+     <dd>
+
+      <ol>
+
+       <li><p><span>Collect a sequence of characters</span> that are
+       not <span title="space character">space characters</span>. Let
+       <var title="">value</var> be those characters, if any.</p></li>
+
+       <li><p>If <var title="">value</var> is a
+       <span>case-sensitive</span> match for the string "<code
+       title="">start</code>", then let <var title="">cue</var>'s
+       <span>timed track cue alignment</span> be <span title="timed
+       track cue start alignment">start alignment</span>.</p></li>
+
+       <li><p>If <var title="">value</var> is a
+       <span>case-sensitive</span> match for the string "<code
+       title="">middle</code>", then let <var title="">cue</var>'s
+       <span>timed track cue alignment</span> be <span title="timed
+       track cue middle alignment">middle alignment</span>.</p></li>
+
+       <li><p>If <var title="">value</var> is a
+       <span>case-sensitive</span> match for the string "<code
+       title="">end</code>", then let <var title="">cue</var>'s
+       <span>timed track cue alignment</span> be <span title="timed
+       track cue end alignment">end alignment</span>.</p></li>
+
+      </ol>
+
+     </dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>
+
+       <p><span>Collect a sequence of characters</span> that are not
+       <span title="space character">space characters</span> and
+       discard them.</p>
+
+     </dd>
+
+    </dl>
+
+   </li>
+
+   <li><p>Jump back to the step labeled <i>settings</i>.</p></li>
+
   </ol>
 
   <p class="XXX"><dfn>Collect a WebSRT timestamp</dfn>...</p>




More information about the Commit-Watchers mailing list