[html5] r5123 - [giow] (0) Captions - Stage 11.11: Finish the WebSRT parser (technically - but o [...]
whatwg at whatwg.org
whatwg at whatwg.org
Tue Jun 29 16:09:48 PDT 2010
Author: ianh
Date: 2010-06-29 16:09:47 -0700 (Tue, 29 Jun 2010)
New Revision: 5123
Modified:
complete.html
index
source
Log:
[giow] (0) Captions - Stage 11.11: Finish the WebSRT parser (technically - but only because cue parsing happens separately, that still needs writing and that's the 'fun' part)
Modified: complete.html
===================================================================
--- complete.html 2010-06-29 22:42:40 UTC (rev 5122)
+++ complete.html 2010-06-29 23:09:47 UTC (rev 5123)
@@ -564,7 +564,8 @@
<li><a href=#websrt-0><span class=secno>4.8.10.11 </span>WebSRT</a>
<ol>
<li><a href=#syntax-0><span class=secno>4.8.10.11.1 </span>Syntax</a></li>
- <li><a href=#parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</a></ol></li>
+ <li><a href=#parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</a></li>
+ <li><a href=#websrt-cue-text-parsing-and-rendering-rules><span class=secno>4.8.10.11.3 </span>WebSRT cue text parsing and rendering rules</a></ol></li>
<li><a href=#user-interface><span class=secno>4.8.10.12 </span>User interface</a></li>
<li><a href=#time-ranges><span class=secno>4.8.10.13 </span>Time ranges</a></li>
<li><a href=#mediaevents><span class=secno>4.8.10.14 </span>Event summary</a></li>
@@ -27033,9 +27034,9 @@
<li><p>Return to the step labeled <i>cue text loop</i>.</li>
- <li><i>Cue text processing</i>: <a href=#collect-websrt-cue-voice-and-text>Collect WebSRT cue voice and
- text</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><i>Cue text processing</i>: <a href=#collect-websrt-cue-voice-and-text>Collect WebSRT cue voice
+ and text</a> from <var title="">cue text</var>, using <var title="">cue</var> for the results. If that fails, discard <var title="">cue</var> and jump to the step labeled <i>cue
+ loop</i>.</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>
@@ -27245,7 +27246,7 @@
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
+ <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>
@@ -27285,7 +27286,7 @@
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
+ <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>
@@ -27429,8 +27430,7 @@
<li><p>Return <var title="">result</var>.</li>
</ol><p>When the steps above say that a user agent is to <dfn id=collect-websrt-cue-voice-and-text>collect
- WebSRT cue voice and text</dfn>, the user agent must run the
- following steps:</p>
+ WebSRT cue voice and text</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 steps:</p>
<ol><li><p>Let <var title="">input</var> be the string being
parsed.</li>
@@ -27441,12 +27441,87 @@
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error and abort these
steps.</li>
- <li><p class=XXX>...voice...</li>
+ <li>
- <li><p class=XXX>...cues...</li>
+ <p>Examine the first few characters of <var title="">input</var>
+ and process them as described by the match set of rules from the
+ following list:</p>
- </ol></div>
+ <dl class=switch><dt>If <var title="">input</var> starts with the string "<code title=""><narrator></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">narrator</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+ <dt>If <var title="">input</var> starts with the string "<code title=""><music></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">music</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code title=""><sound></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">sound</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code title=""><comment></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">comment</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code title=""><credit></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">credit</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+
+ <dt>If <var title="">input</var> starts with a U+003C LESS-THAN
+ SIGN character (<), followed by a character in the range
+ U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE (9), followed by zero
+ or more characters in the range U+0030 DIGIT ZERO (0) to U+0039
+ DIGIT NINE (9), followed by a U+003E GREATER-THAN SIGN character
+ (>)</dt>
+
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string of digits (characters in the
+ range U+0030 DIGIT ZERO to U+0039 DIGIT NINE) in the matching
+ substring, and advance <var title="">position</var> past the
+ matching substring.</p>
+ </dd>
+
+ <dt>Otherwise</dt>
+ <dd>
+ <p>Leave the <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> set to the empty string.</p>
+ </dd>
+
+ </dl></li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error and abort these
+ steps.</li>
+
+ <li><p>Let the <a href=#timed-track-cue-text>timed track cue text</a> of <var title="">cue</var> be the substring of <var title="">input</var>
+ from the position indicated by <var title="">input</var> to the end
+ of the <var title="">input</var>, and let the rules for its
+ interpretation be the <a href=#websrt-cue-text-parsing-and-rendering-rules>WebSRT cue text parsing and rendering
+ rules</a> defined below.</li>
+
+ </ol><h6 id=websrt-cue-text-parsing-and-rendering-rules><span class=secno>4.8.10.11.3 </span><dfn>WebSRT cue text parsing and rendering rules</dfn></h6>
+
+ <p class=XXX>...</p>
+
+
+ </div>
+
</div>
<!--TT-->
Modified: index
===================================================================
--- index 2010-06-29 22:42:40 UTC (rev 5122)
+++ index 2010-06-29 23:09:47 UTC (rev 5123)
@@ -571,7 +571,8 @@
<li><a href=#websrt-0><span class=secno>4.8.10.11 </span>WebSRT</a>
<ol>
<li><a href=#syntax-0><span class=secno>4.8.10.11.1 </span>Syntax</a></li>
- <li><a href=#parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</a></ol></li>
+ <li><a href=#parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</a></li>
+ <li><a href=#websrt-cue-text-parsing-and-rendering-rules><span class=secno>4.8.10.11.3 </span>WebSRT cue text parsing and rendering rules</a></ol></li>
<li><a href=#user-interface><span class=secno>4.8.10.12 </span>User interface</a></li>
<li><a href=#time-ranges><span class=secno>4.8.10.13 </span>Time ranges</a></li>
<li><a href=#mediaevents><span class=secno>4.8.10.14 </span>Event summary</a></li>
@@ -26960,9 +26961,9 @@
<li><p>Return to the step labeled <i>cue text loop</i>.</li>
- <li><i>Cue text processing</i>: <a href=#collect-websrt-cue-voice-and-text>Collect WebSRT cue voice and
- text</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><i>Cue text processing</i>: <a href=#collect-websrt-cue-voice-and-text>Collect WebSRT cue voice
+ and text</a> from <var title="">cue text</var>, using <var title="">cue</var> for the results. If that fails, discard <var title="">cue</var> and jump to the step labeled <i>cue
+ loop</i>.</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>
@@ -27172,7 +27173,7 @@
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
+ <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>
@@ -27212,7 +27213,7 @@
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
+ <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>
@@ -27356,8 +27357,7 @@
<li><p>Return <var title="">result</var>.</li>
</ol><p>When the steps above say that a user agent is to <dfn id=collect-websrt-cue-voice-and-text>collect
- WebSRT cue voice and text</dfn>, the user agent must run the
- following steps:</p>
+ WebSRT cue voice and text</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 steps:</p>
<ol><li><p>Let <var title="">input</var> be the string being
parsed.</li>
@@ -27368,12 +27368,87 @@
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error and abort these
steps.</li>
- <li><p class=XXX>...voice...</li>
+ <li>
- <li><p class=XXX>...cues...</li>
+ <p>Examine the first few characters of <var title="">input</var>
+ and process them as described by the match set of rules from the
+ following list:</p>
- </ol></div>
+ <dl class=switch><dt>If <var title="">input</var> starts with the string "<code title=""><narrator></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">narrator</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+ <dt>If <var title="">input</var> starts with the string "<code title=""><music></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">music</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code title=""><sound></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">sound</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code title=""><comment></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">comment</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code title=""><credit></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string "<code title="">credit</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+
+ <dt>If <var title="">input</var> starts with a U+003C LESS-THAN
+ SIGN character (<), followed by a character in the range
+ U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE (9), followed by zero
+ or more characters in the range U+0030 DIGIT ZERO (0) to U+0039
+ DIGIT NINE (9), followed by a U+003E GREATER-THAN SIGN character
+ (>)</dt>
+
+ <dd>
+ <p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> be the string of digits (characters in the
+ range U+0030 DIGIT ZERO to U+0039 DIGIT NINE) in the matching
+ substring, and advance <var title="">position</var> past the
+ matching substring.</p>
+ </dd>
+
+ <dt>Otherwise</dt>
+ <dd>
+ <p>Leave the <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
+ identifier</a> set to the empty string.</p>
+ </dd>
+
+ </dl></li>
+
+ <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error and abort these
+ steps.</li>
+
+ <li><p>Let the <a href=#timed-track-cue-text>timed track cue text</a> of <var title="">cue</var> be the substring of <var title="">input</var>
+ from the position indicated by <var title="">input</var> to the end
+ of the <var title="">input</var>, and let the rules for its
+ interpretation be the <a href=#websrt-cue-text-parsing-and-rendering-rules>WebSRT cue text parsing and rendering
+ rules</a> defined below.</li>
+
+ </ol><h6 id=websrt-cue-text-parsing-and-rendering-rules><span class=secno>4.8.10.11.3 </span><dfn>WebSRT cue text parsing and rendering rules</dfn></h6>
+
+ <p class=XXX>...</p>
+
+
+ </div>
+
</div>
<!--TT-->
Modified: source
===================================================================
--- source 2010-06-29 22:42:40 UTC (rev 5122)
+++ source 2010-06-29 23:09:47 UTC (rev 5123)
@@ -29314,10 +29314,11 @@
<li><p>Return to the step labeled <i>cue text loop</i>.</p></li>
- <li><i>Cue text processing</i>: <span>Collect WebSRT cue voice and
- text</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><i>Cue text processing</i>: <span>Collect WebSRT cue voice
+ and text</span> from <var title="">cue text</var>, using <var
+ title="">cue</var> for the results. If that fails, discard <var
+ title="">cue</var> and jump to the step labeled <i>cue
+ loop</i>.</p></li>
<li><p>Add <var title="">cue</var> to the <span>timed track list of
cues</span> <var title="">output</var>.</p></li>
@@ -29563,7 +29564,7 @@
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
+ <li><p>Let <var title="">cue</var>'s <span>timed track cue text
position</span> be <var title="">number</var>.</p></li>
</ol>
@@ -29608,7 +29609,7 @@
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
+ <li><p>Let <var title="">cue</var>'s <span>timed track cue
size</span> be <var title="">number</var>.</p></li>
</ol>
@@ -29798,8 +29799,9 @@
</ol>
<p>When the steps above say that a user agent is to <dfn>collect
- WebSRT cue voice and text</dfn>, the user agent must run the
- following steps:</p>
+ WebSRT cue voice and text</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 steps:</p>
<ol>
@@ -29814,10 +29816,99 @@
title="">input</var>, return an error and abort these
steps.</p></li>
- <li><p class="XXX">...voice...</p></li>
+ <li>
- <li><p class="XXX">...cues...</p></li>
+ <p>Examine the first few characters of <var title="">input</var>
+ and process them as described by the match set of rules from the
+ following list:</p>
+ <dl class="switch">
+
+ <dt>If <var title="">input</var> starts with the string "<code
+ title=""><narrator></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <span>timed track cue voice
+ identifier</span> be the string "<code title="">narrator</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code
+ title=""><music></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <span>timed track cue voice
+ identifier</span> be the string "<code title="">music</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code
+ title=""><sound></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <span>timed track cue voice
+ identifier</span> be the string "<code title="">sound</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code
+ title=""><comment></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <span>timed track cue voice
+ identifier</span> be the string "<code title="">comment</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+ <dt>If <var title="">input</var> starts with the string "<code
+ title=""><credit></code>"</dt>
+ <dd>
+ <p>Let <var title="">cue</var>'s <span>timed track cue voice
+ identifier</span> be the string "<code title="">credit</code>"
+ and advance <var title="">position</var> past the matching substring.</p>
+ </dd>
+
+
+ <dt>If <var title="">input</var> starts with a U+003C LESS-THAN
+ SIGN character (<), followed by a character in the range
+ U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE (9), followed by zero
+ or more characters in the range U+0030 DIGIT ZERO (0) to U+0039
+ DIGIT NINE (9), followed by a U+003E GREATER-THAN SIGN character
+ (>)</dt>
+
+ <dd>
+ <p>Let <var title="">cue</var>'s <span>timed track cue voice
+ identifier</span> be the string of digits (characters in the
+ range U+0030 DIGIT ZERO to U+0039 DIGIT NINE) in the matching
+ substring, and advance <var title="">position</var> past the
+ matching substring.</p>
+ </dd>
+
+ <dt>Otherwise</dt>
+ <dd>
+ <p>Leave the <var title="">cue</var>'s <span>timed track cue voice
+ identifier</span> set to the empty string.</p>
+ </dd>
+
+ </dl>
+
+ </li>
+
+ <li><p>If <var title="">position</var> is past the end of <var
+ title="">input</var>, return an error and abort these
+ steps.</p></li>
+
+ <li><p>Let the <span>timed track cue text</span> of <var
+ title="">cue</var> be the substring of <var title="">input</var>
+ from the position indicated by <var title="">input</var> to the end
+ of the <var title="">input</var>, and let the rules for its
+ interpretation be the <span>WebSRT cue text parsing and rendering
+ rules</span> defined below.</p></li>
+
+ </ol>
+
+
+ <h6><dfn>WebSRT cue text parsing and rendering rules</dfn></h6>
+
+ <p class="XXX">...</p>
+
+
</div>
</div>
More information about the Commit-Watchers
mailing list