Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (0) Captions - Stage 9.2: More parser rules for WebSRT.
git-svn-id: http://svn.whatwg.org/webapps@5081 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 6, 2010
1 parent 02c2631 commit 452a0f1
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 42 deletions.
66 changes: 51 additions & 15 deletions complete.html
Expand Up @@ -186,7 +186,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 &mdash; 5 May 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 6 May 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>-->
Expand Down Expand Up @@ -1311,7 +1311,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
<li><a href=#application/xhtml+xml><span class=secno>16.3 </span><code>application/xhtml+xml</code></a></li>
<li><a href=#text/cache-manifest><span class=secno>16.4 </span><code>text/cache-manifest</code></a></li>
<li><a href=#text/ping><span class=secno>16.5 </span><code>text/ping</code></a></li>
<li><a href=#text/websrt><span class=secno>16.6 </span><code>text/websrt</code></a></li>
<li><a href=#text/srt><span class=secno>16.6 </span><code>text/srt</code></a></li>
<li><a href=#application/microdata+json><span class=secno>16.7 </span><code>application/microdata+json</code></a></li>
<li><a href=#ping-from><span class=secno>16.8 </span><code>Ping-From</code></a></li>
<li><a href=#ping-to><span class=secno>16.9 </span><code>Ping-To</code></a></ol></li>
Expand Down Expand Up @@ -26267,7 +26267,8 @@ <h6 id=parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</h6>
according to the <a href=#websrt-parser-algorithm>WebSRT parser algorithm</a> below. A
<a href=#websrt-parser>WebSRT parser</a>, specifically its conversion and parsing
steps, is typically run asynchronously, with the input byte stream
being updated incrementally as the resource is downloaded.</p>
being updated incrementally as the resource is downloaded; this is
called an <dfn id=incremental-websrt-parser>incremental WebSRT parser</dfn>.</p>

<p>When convering the bytes into Unicode characters, bytes or
sequences of bytes that are not valid UTF-8 sequences must be
Expand All @@ -26280,22 +26281,57 @@ <h6 id=parsing-0><span class=secno>4.8.10.11.2 </span>Parsing</h6>
parsed.</li>

<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
string.</li>
string. In an <a href=#incremental-websrt-parser>incremental WebSRT parser</a>, when this
algorithm (or further algorithms that it uses) moves the <var title="">position</var> pointer, the user agent must wait until
appropriate further characters from the byte stream have been added
to <var title="">input</var> before moving the pointer, so that the
algorithm never reads past the end of the <var title="">input</var>
string. Once the byte stream has ended, and all characters have
been added to <var title="">input</var>, then the <var title="">position</var> pointer may, when so instructed by the
algorithms, be moved past the end of <var title="">input</var>.</li>

<li><p><i>Cue loop</i>: <a href=#collect-a-sequence-of-characters>Collect a sequence of
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><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
either U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF)
characters.</li>
<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> contains the three-character
substring "<code title="">--&gt;</code>" (U+002D HYPHEN-MINUS, U+002D
HYPHEN-MINUS, U+003E GREATER-THAN SIGN), then jump to the step
labeled <i>timing</i> below.</li>

<li><p>Let <var title="">id</var> 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 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>

<li><p>If the character indicated by <var title="">position</var>
is a U+000A LINE FEED (LF) character, advance <var title="">position</var> to the next character in <var title="">input</var>.</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>
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 the
file has ended. Abort these steps. The <a href=#websrt-parser>WebSRT parser</a>
has finished.</li>
<li><p><i>Timings</i>: <span class=XXX>...</span></li>

<li><p class=XXX>...</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></div>

Expand Down Expand Up @@ -86981,7 +87017,7 @@ <h3 id=text/ping><span class=secno>16.5 </span><dfn><code>text/ping</code></dfn>
<code><a href=#text/ping>text/ping</a></code> resources.</p>
<!--PING-->

<h3 id=text/websrt><span class=secno>16.6 </span><dfn><code>text/websrt</code></dfn></h3>
<h3 id=text/srt><span class=secno>16.6 </span><dfn><code>text/srt</code></dfn></h3>

<p>This registration is for community review and will be submitted
to the IESG for review, approval, and registration with IANA.</p>
Expand All @@ -86994,7 +87030,7 @@ <h3 id=text/websrt><span class=secno>16.6 </span><dfn><code>text/websrt</code></
<dl><dt>Type name:</dt>
<dd>text</dd>
<dt>Subtype name:</dt>
<dd>websrt</dd>
<dd>srt</dd>
<dt>Required parameters:</dt>
<dd>No parameters</dd>
<dt>Optional parameters:</dt>
Expand Down Expand Up @@ -87045,7 +87081,7 @@ <h3 id=text/websrt><span class=secno>16.6 </span><dfn><code>text/websrt</code></
<dt>Change controller:</dt>
<dd>WHATWG</dd>
</dl><p>Fragment identifiers have no meaning with
<code><a href=#text/websrt>text/websrt</a></code> resources.</p>
<code>text/websrt</code> resources.</p>



Expand Down
66 changes: 51 additions & 15 deletions index
Expand Up @@ -190,7 +190,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 &mdash; 5 May 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 6 May 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>-->
Expand Down Expand Up @@ -1183,7 +1183,7 @@
<li><a href=#application/xhtml+xml><span class=secno>14.3 </span><code>application/xhtml+xml</code></a></li>
<li><a href=#text/cache-manifest><span class=secno>14.4 </span><code>text/cache-manifest</code></a></li>
<li><a href=#text/ping><span class=secno>14.5 </span><code>text/ping</code></a></li>
<li><a href=#text/websrt><span class=secno>14.6 </span><code>text/websrt</code></a></li>
<li><a href=#text/srt><span class=secno>14.6 </span><code>text/srt</code></a></li>
<li><a href=#application/microdata+json><span class=secno>14.7 </span><code>application/microdata+json</code></a></li>
<li><a href=#ping-from><span class=secno>14.8 </span><code>Ping-From</code></a></li>
<li><a href=#ping-to><span class=secno>14.9 </span><code>Ping-To</code></a></ol></li>
Expand Down Expand Up @@ -26168,7 +26168,8 @@ CueEvent
according to the <a href=#websrt-parser-algorithm>WebSRT parser algorithm</a> below. A
<a href=#websrt-parser>WebSRT parser</a>, specifically its conversion and parsing
steps, is typically run asynchronously, with the input byte stream
being updated incrementally as the resource is downloaded.</p>
being updated incrementally as the resource is downloaded; this is
called an <dfn id=incremental-websrt-parser>incremental WebSRT parser</dfn>.</p>

<p>When convering the bytes into Unicode characters, bytes or
sequences of bytes that are not valid UTF-8 sequences must be
Expand All @@ -26181,22 +26182,57 @@ CueEvent
parsed.</li>

<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
string.</li>
string. In an <a href=#incremental-websrt-parser>incremental WebSRT parser</a>, when this
algorithm (or further algorithms that it uses) moves the <var title="">position</var> pointer, the user agent must wait until
appropriate further characters from the byte stream have been added
to <var title="">input</var> before moving the pointer, so that the
algorithm never reads past the end of the <var title="">input</var>
string. Once the byte stream has ended, and all characters have
been added to <var title="">input</var>, then the <var title="">position</var> pointer may, when so instructed by the
algorithms, be moved past the end of <var title="">input</var>.</li>

<li><p><i>Cue loop</i>: <a href=#collect-a-sequence-of-characters>Collect a sequence of
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><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
either U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF)
characters.</li>
<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> contains the three-character
substring "<code title="">--&gt;</code>" (U+002D HYPHEN-MINUS, U+002D
HYPHEN-MINUS, U+003E GREATER-THAN SIGN), then jump to the step
labeled <i>timing</i> below.</li>

<li><p>Let <var title="">id</var> 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 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>

<li><p>If the character indicated by <var title="">position</var>
is a U+000A LINE FEED (LF) character, advance <var title="">position</var> to the next character in <var title="">input</var>.</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>
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 the
file has ended. Abort these steps. The <a href=#websrt-parser>WebSRT parser</a>
has finished.</li>
<li><p><i>Timings</i>: <span class=XXX>...</span></li>

<li><p class=XXX>...</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></div>

Expand Down Expand Up @@ -80224,7 +80260,7 @@ interface <a href=#htmldocument>HTMLDocument</a> {
<code><a href=#text/ping>text/ping</a></code> resources.</p>
<!--PING-->

<h3 id=text/websrt><span class=secno>14.6 </span><dfn><code>text/websrt</code></dfn></h3>
<h3 id=text/srt><span class=secno>14.6 </span><dfn><code>text/srt</code></dfn></h3>

<p>This registration is for community review and will be submitted
to the IESG for review, approval, and registration with IANA.</p>
Expand All @@ -80237,7 +80273,7 @@ interface <a href=#htmldocument>HTMLDocument</a> {
<dl><dt>Type name:</dt>
<dd>text</dd>
<dt>Subtype name:</dt>
<dd>websrt</dd>
<dd>srt</dd>
<dt>Required parameters:</dt>
<dd>No parameters</dd>
<dt>Optional parameters:</dt>
Expand Down Expand Up @@ -80288,7 +80324,7 @@ interface <a href=#htmldocument>HTMLDocument</a> {
<dt>Change controller:</dt>
<dd>WHATWG</dd>
</dl><p>Fragment identifiers have no meaning with
<code><a href=#text/websrt>text/websrt</a></code> resources.</p>
<code>text/websrt</code> resources.</p>



Expand Down
69 changes: 57 additions & 12 deletions source
Expand Up @@ -28392,7 +28392,8 @@ CueEvent
according to the <span>WebSRT parser algorithm</span> below. A
<span>WebSRT parser</span>, specifically its conversion and parsing
steps, is typically run asynchronously, with the input byte stream
being updated incrementally as the resource is downloaded.</p>
being updated incrementally as the resource is downloaded; this is
called an <dfn>incremental WebSRT parser</dfn>.</p>

<p>When convering the bytes into Unicode characters, bytes or
sequences of bytes that are not valid UTF-8 sequences must be
Expand All @@ -28408,22 +28409,66 @@ CueEvent

<li><p>Let <var title="">position</var> be a pointer into <var
title="">input</var>, initially pointing at the start of the
string.</p></li>
string. In an <span>incremental WebSRT parser</span>, when this
algorithm (or further algorithms that it uses) moves the <var
title="">position</var> pointer, the user agent must wait until
appropriate further characters from the byte stream have been added
to <var title="">input</var> before moving the pointer, so that the
algorithm never reads past the end of the <var title="">input</var>
string. Once the byte stream has ended, and all characters have
been added to <var title="">input</var>, then the <var
title="">position</var> pointer may, when so instructed by the
algorithms, be moved past the end of <var
title="">input</var>.</p></li>

<li><p><i>Cue loop</i>: <span>Collect a sequence of
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><span>Collect a sequence of characters</span> that are
either U+000D CARRIAGE RETURN (CR) or U+000A LINE FEED (LF)
characters.</p></li>
<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> 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>timing</i> below.</p></li>

<li><p>Let <var title="">id</var> 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>

<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>.</p></li>

<li><p>If the character indicated by <var title="">position</var>
is a U+000A LINE FEED (LF) character, advance <var
title="">position</var> to the next character in <var
title="">input</var>.</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>
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 the
file has ended. Abort these steps. The <span>WebSRT parser</span>
has finished.</p></li>
<li><p><i>Timings</i>: <span class="XXX">...</span></p></li>

<li><p class="XXX">...</p></li>
<li><p><i>End</i>: The file has ended. Abort these steps. The
<span>WebSRT parser</span> has finished.</p></li>

</ol>

Expand Down Expand Up @@ -99143,7 +99188,7 @@ interface <span>HTMLDocument</span> {
<code>text/ping</code> resources.</p>
<!--START w3c-html--><!--PING-->

<h3><dfn><code>text/websrt</code></dfn></h3>
<h3><dfn><code>text/srt</code></dfn></h3>

<p>This registration is for community review and will be submitted
to the IESG for review, approval, and registration with IANA.</p>
Expand All @@ -99157,7 +99202,7 @@ interface <span>HTMLDocument</span> {
<dt>Type name:</dt>
<dd>text</dd>
<dt>Subtype name:</dt>
<dd>websrt</dd>
<dd>srt</dd>
<dt>Required parameters:</dt>
<dd>No parameters</dd>
<dt>Optional parameters:</dt>
Expand Down

0 comments on commit 452a0f1

Please sign in to comment.