--- a/608toVTT/region.html Thu Feb 07 12:40:59 2013 +1100
+++ b/608toVTT/region.html Sat Feb 09 08:33:59 2013 +1100
@@ -8,8 +8,11 @@
For the three scripts below, if your spec resides on dev.w3 you can check them
out in the same tree and use relative links so that they'll work offline,
-->
- <!-- old but local: <script src='../../2009/dap/ReSpec.js/js/respec.js' class='remove'></script> -->
+ <!-- old but local: -->
+ <script src='../../2009/dap/ReSpec.js/js/respec.js' class='remove'></script>
+ <!--
<script src='http://www.w3.org/Tools/respec/respec-w3c-common' class='remove' async></script>
+ -->
<script class='remove'>
var respecConfig = {
// specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
@@ -106,7 +109,7 @@
<li>It introduces the ability to style the region's background and border differently from the cues it contains.</li>
<li>It introduces a means to specify an anchor point and a growth direction for the text that is rendered on screen and thus gives the author more control over the placement of text when the user changes the font size.</li>
<li>It introduces the ability to specify a caption rendering region of fixed width with a fixed number of rendered lines to also give the author more control over the amount of space on the video viewport that captions will take up when the user changes font size.</li>
- <li>It introduces the ability to specify which region should be rendered in the foreground in the case of region overlap e.g. when the user increases caption font size.</li>
+ <li>It introduces the ability to specify which region is to be rendered in the foreground in the case of region overlap e.g. when the user increases caption font size.</li>
</ul>
<p>Many of these features are part of what the US FCC (Federal Communications Commission) has required for Captioning of Internet Video Programming <a
@@ -178,7 +181,7 @@
<dt><dfn id="text-track-region-width">A width</dfn></dt>
<dd>
- <p>A number giving the width of the box within which the text of each line of the containing cues is to be rendered, to be interpreted as a percentage of the video width. Defaults to 100%.</p>
+ <p>A number giving the width of the box within which the text of each line of the containing cues is to be rendered, to be interpreted as a percentage of the video width. Defaults to 100.</p>
</dd>
<dt><dfn id="text-track-region-height">A height</dfn></dt>
@@ -188,22 +191,22 @@
<dt><dfn id="text-track-region-anchor">A region anchor point</dfn></dt>
<dd>
- <p>Two numbers giving the x and y coordinates within the region which is anchored to the video viewport and does not change location even when the region does, e.g. because of font size changes. Defaults to (0%,100%), i.e. the bottom left corner of the region.</p>
+ <p>Two numbers giving the x and y coordinates within the region which is anchored to the video viewport and does not change location even when the region does, e.g. because of font size changes. Defaults to (0,100), i.e. the bottom left corner of the region.</p>
</dd>
<dt><dfn id="text-track-region-viewport-anchor">A region viewport anchor point</dfn></dt>
<dd>
- <p>Two numbers giving the x and y coordinates within the video viewport to which the region anchor point is anchored. Defaults to (0%,100%), i.e. the bottom left corner of the viewport.</p>
+ <p>Two numbers giving the x and y coordinates within the video viewport to which the region anchor point is anchored. Defaults to (0,100), i.e. the bottom left corner of the viewport.</p>
</dd>
<dt><dfn id="text-track-region-scroll">A scroll value</dfn></dt>
<dd>
<p>One of the following:</p>
<dl>
- <dt>None</dt>
+ <dt><dfn id="text-track-region-scroll-none">None</dfn></dt>
<dd>Indicates that the cues in the region are not to scroll and instead stay fixed at the location they were first painted in.</dd>
- <dt>Up</dt>
+ <dt><dfn id="text-track-region-scroll-up">Up</dfn></dt>
<dd>Indicates that the cues in the region will be added at the bottom of the region and push any already displayed cues in the region up until all lines of the new cue are visible in the region.</dd>
<!-- in the future we may introduce scroll="down"-->
</dl>
@@ -386,7 +389,7 @@
location. The first percentage measures the x-dimension and the second percentage
y-dimension from the top left corner of the region box. If no
<a href="#webvtt-region-anchor">WebVTT region anchor setting</a> is given, the anchor
- defaults to 0%,100% (i.e. the bottom left corner).</p>
+ defaults to 0%, 100% (i.e. the bottom left corner).</p>
<p>A <dfn id="webvtt-region-viewport-anchor">WebVTT region viewport anchor setting</dfn>
consists of the following components, in the order given:</p>
@@ -439,7 +442,7 @@
<section>
<h3>WebVTT region cue setting syntax</h3>
- <p>We extend the existing set of <a class="externalDFN"
+ <p>This specification extends the existing set of <a class="externalDFN"
href="http://dev.w3.org/html5/webvtt/#webvtt-cue-settings">WebVTT cue settings</a> with a
new setting.</p>
@@ -490,12 +493,24 @@
<ol start="15">
<li><i>Metadata header loop</i>: If <var>line</var> is not the empty string, run the following substeps:
<ol>
- <li><i>Metadata header creation</i>: Let <var>metadata</var> be a new <a class="internalDFN" href="#webvtt-metadata-header">WebVTT metadata header</a>.
- <li>Let <a href="#webvtt-metadata-header-name" class="internalDFN">metadata's name</a> be the empty string.</li>
- <li>Let <a href="#webvtt-metadata-header-value" class="internalDFN">metadata's value</a> be the empty string.</li>
- <li>If <var>line</var> contains the character ":" (A U+003A COLON), then set <a href="#webvtt-metadata-header-name" class="internalDFN">metadata's name</a> to the substring of <var>line</var> before the first ":" character and <a href="#webvtt-metadata-header-value" class="internalDFN">metadata's value</a> to the substring after this character.</li>
- <li>If <a href="#webvtt-metadata-header-name" class="internalDFN">metadata's name</a> equals "Region" exactly: Add <var>metadata</var> to the <a href="#text-track-list-of-regions" class="internalDFN">text track list of regions</a>.</li>
- <li>Jump back to the step labeled header.</li>
+ <li><p><i>Metadata header creation</i>: Let <var>metadata</var> be a new <a class="internalDFN" href="#webvtt-metadata-header">WebVTT metadata header</a>.</p></li>
+ <li><p>Let <a href="#webvtt-metadata-header-name" class="internalDFN">metadata's name</a> be the empty string.</p></li>
+ <li><p>Let <a href="#webvtt-metadata-header-value" class="internalDFN">metadata's value</a> be the empty string.</p></li>
+ <li><p>If <var>line</var> contains the character ":" (A U+003A COLON), then set <a href="#webvtt-metadata-header-name" class="internalDFN">metadata's name</a> to the substring of <var>line</var> before the first ":" character and <a href="#webvtt-metadata-header-value" class="internalDFN">metadata's value</a> to the substring after this character.</p></li>
+ <li><p>If <a href="#webvtt-metadata-header-name" class="internalDFN">metadata's name</a> equals "Region":</p>
+ <ol>
+ <li><i>Region creation</i>: Let <var>region</var> be a new <a href="#text-track-region" class="internalDFN">text track region</a>.</li>
+ <li>Let <var>region</var>'s <a href="#text-track-region-identifier">identifier</a> be the empty string.</li>
+ <li>Let <var>region</var>'s <a href="#text-track-region-width">width</a> be 100.</li>
+ <li>Let <var>region</var>'s <a href="#text-track-region-height">height</a> be 3.</li>
+ <li>Let <var>region</var>'s <a href="#text-track-region-anchor">anchor point</a> be (0,100).</li>
+ <li>Let <var>region</var>'s <a href="#text-track-region-viewport-anchor">viewport anchor point</a> be (0,100).</li>
+ <li>Let <var>region</var>'s <a href="#text-track-region-scroll">scroll value</a> be <a href="#text-track-region-scroll-none" class="interalDFN">NONE</a>.</li>
+ <li><dfn id="collect-webvtt-region-settings">Collect WebVTT region settings</dfn> from <a href="#webvtt-metadata-header-value" class="internalDFN">metadata's value</a> using <var>region</var> for the results.</li>
+ <li>Add <var>region</var> to the <a href="#text-track-list-of-regions" class="internalDFN">text track list of regions</a>.</li>
+ </ol>
+ </li>
+ <li><p>Jump back to the step labeled header.</p></li>
</ol>
</li>
</ol>
@@ -504,12 +519,146 @@
</section>
<section>
+ <h3>Introduction of a WebVTT region settings parser</h3>
+
+ <p>We first introduce an algorithm to <a href="#parse-a-percentage-string" class="internalDFN">parse a percentage string</a> and then the algorithm to <a href="#collect-webvtt-region-settings" class="internalDFN">collect WebVTT region settings</a>.</p>
+
+ <p>The rules to <dfn id="parse-a-percentage-string">parse a percentage string</dfn> are as follows. This will return a percentage value or, if at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.</p>
+ <ol>
+ <li><p>Let <var>input</var> be the string being parsed.</p></li>
+
+ <li><p>If <var>input</var> contains any characters other than U+0025 PERCENT SIGN characters (%) and <span>ASCII digits</span>, then fail.</p></li>
+
+ <li><p>If <var>input</var> does not contain at least one <a href="http://www.w3.org/TR/html5/single-page.html#ascii-digits" class="externalDFN">ASCII digit</a>, then fail.</p></li>
+
+ <li><p>If any character in <var>input</var> other than the last character is a U+0025 PERCENT SIGN character (%), then fail.</p></li>
+
+ <li><p>If the last character in <var>input</var> is not a U+0025 PERCENT SIGN character (%), then fail.</p></li>
+
+ <li><p>Ignoring the trailing percent sign, interpret <var>input</var> as a base-ten integer. Let that number be the <var>percentage</var>.</p></li>
+
+ <li><p>Return <var>percentage</var>.</p></li>
+ </ol>
+
+ <p>When the algorithm above requires that the user agent <dfn id="collect-webvtt-region-settings">collect WebVTT region settings</dfn> from a string <var>input</var> for a <a href="http://www.w3.org/html/wg/drafts/html/master/single-page.html#text-track" class="externalDFN">text track</a>, the user agent must run the following algorithm:</p>
+
+ <ol>
+ <li><p>Let <var>settings</var> be the result of <a href="http://www.w3.org/TR/html5/single-page.html#split-a-string-on-spaces" class="externalDFN">splitting <var
+ title="">input</var> on spaces</a>.</p></li>
+
+ <li>For each token <var>setting</var> in the list <var>settings</var>, run the following substeps:</p>
+ <ol>
+ <li><p>If <var>setting</var> does not contain a U+003D EQUALS SIGN character (=), or if the first U+003D EQUALS SIGN character (=) in <var>setting</var> is either the first or last character of <var>setting</var>, then jump to the step labeled <i>next setting</i>.</p></li>
+
+ <li><p>Let <var>name</var> be the leading substring of <var>setting</var> up to and excluding the first U+003D EQUALS SIGN character (=) in that string.</p></li>
+
+ <li><p>Let <var>value</var> be the trailing substring of <var>setting</var> starting from the character immediately after the first U+003D EQUALS SIGN character (=) in that string.</p></li>
+
+ <li><p>Run the appropriate substeps that apply for the value of <var>name</var>, as follows:</p>
+
+ <dl>
+ <dt><p>If <var>name</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive</a> match for "<code title="">id</code>"</p></dt>
+ <dd><p>Let <var>region's <a href="#text-track-region-identifier">identifier</a> be <var>value</var>.</p>
+ </dd>
+
+ <dt><p>Otherwise if <var>name</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive</a> match for "<code title="">width</code>"</p></dt>
+ <dd><p>If <a href="#parse-a-percentage-string">parse a percentage string</a> from <var>value</var> returns a <var>percentage</var>, let <var>region</var>'s <a href="#text-track-region-width">text track region width</a> be <var>percentage</var>.</p>
+ </dd>
+
+ <dt>Otherwise if <var>name</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive</a> match for "<code title="">height</code>"</dt>
+ <dd>
+ <ol>
+ <li><p>If <var>value</var> contains any characters other than <span>ASCII digits</span>, then jump to the step labeled <i>next setting</i>.</p></li>
+
+ <li><p>Interpret <var>value</var> as an integer, and let <var>number</var> be that number.</p></li>
+
+ <li><p>Let <var>region</var>'s <a href="#text-track-region-height">text track region height</a> be <var>number</var>.</p></li>
+ </ol>
+ </dd>
+
+ <dt>Otherwise if <var>name</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive</a> match for "<code title="">regionanchor</code>"</dt>
+ <dd>
+ <ol>
+ <li><p>If <var>value</var> does not contain a U+002C COMMA character (,), then jump to the step labeled <i>next setting</i>.</p></li>
+
+ <li><p>Let <var>anchorX</var> be the leading substring of <var>value</var> up to and excluding the first U+002C COMMA character (,) in that string.</p></li>
+
+ <li><p>Let <var>anchorY</var> be the trailing substring of <var>value</var> starting from the character immediately after the first U+002C COMMA character (,) in that string.</p></li>
+
+ <li><p>If <a href="#parse-a-percentage-string">parse a percentage string</a> from <var>anchorX</var> or <a href="#parse-a-percentage-string">parse a percentage string</a> from <var>anchorY</var> don't return a <var>percentage</var>, then jump to the step labeled <i>next setting</i>.</p></li>
+
+ <li><p>Let <var>region</var>'s <a href="#text-track-region-anchor">text track region anchor point</a> be the tuple of the <var>percentage</var> values calculated from <var>anchorX</var> and <var>anchorY</var>.</p></li>
+ </ol>
+ </dd>
+
+ <dt>Otherwise if <var>name</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive</a> match for "<code title="">regionviewport</code>"</dt>
+ <dd>
+ <ol>
+ <li><p>If <var>value</var> does not contain a U+002C COMMA character (,), then jump to the step labeled <i>next setting</i>.</p></li>
+
+ <li><p>Let <var>viewportanchorX</var> be the leading substring of <var>value</var> up to and excluding the first U+002C COMMA character (,) in that string.</p></li>
+
+ <li><p>Let <var>viewportanchorY</var> be the trailing substring of <var>value</var> starting from the character immediately after the first U+002C COMMA character (,) in that string.</p></li>
+
+ <li><p>If <a href="#parse-a-percentage-string">parse a percentage string</a> from <var>viewportanchorX</var> or <a href="#parse-a-percentage-string">parse a percentage string</a> from <var>viewportanchorY</var> don't return a <var>percentage</var>, then jump to the step labeled <i>next setting</i>.</p></li>
+
+ <li><p>Let <var>region</var>'s <a href="#text-track-region-anchor">text track region viewport anchor point</a> be the tuple of the <var>percentage</var> values calculated from <var>viewportanchorX</var> and <var>viewportanchorY</var>.</p></li>
+ </ol>
+ </dd>
+
+ <dt>If <var>name</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive</a> match for "<code>scroll</code>"</dt>
+ <dd>
+ <ol>
+ <li><p>If <var>value</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive match for the string "<code>up</code>", then let <var>region</var>'s <a href="#text-track-region-scroll">scroll value</a> be "<a href="#text-track-region-scroll-up" class="internalDFN">scroll up</a>".</li>
+ </ol>
+ </dd>
+ </dl>
+ </li>
+
+ <li><i>Next setting</i>: Continue to the next setting, if any.</li>
+ </ol>
+ </li>
+ </ol>
+
+ </section>
+
+ <section>
<h3>Extension of WebVTT cue creation (step 20-35)</h3>
- <p>This is an extension of the <a class="externalDFN"
- href="http://dev.w3.org/html5/webvtt/#webvtt-parser-algorithm">WebVTT parser algorithm</a>.</p>
+ <p>This is an extension of the <a class="externalDFN" href="http://dev.w3.org/html5/webvtt/#webvtt-parser-algorithm">WebVTT parser algorithm</a>.</p>
+ <p>Introduce an additional assignment step after step 28.</p>
+ <ul>
+ <li>Let <var>cue</var>'s <a href="#text-track-cue-region" class="internalDFN">region reference</a> be the empty string.
+ </li>
+ </ul>
+ </section>
+
+ <section>
+ <h3>Extension of WebVTT cue setting parsing</h3>
+
+ <p>This is an extension of the algorithm to <a class="externalDFN" href="http://dev.w3.org/html5/webvtt/#parse-the-webvtt-settings">parse the WebVTT settings</a>.</p>
+
+ <p>Introduce an additional substep for step 4.</p>
+
+ <dl>
+ <dt>If <var>name</var> is a <a href="http://www.w3.org/TR/html5/single-page.html#case-sensitive" class="externalDFN">case-sensitive</a> match for "<code>region</code>"</dt>
+
+ <dd>
+ <ol>
+ <li>Let <var>cue</var>'s <a href="#text-track-cue-region-identifier" class="internalDFN">region reference</a> be <var>value</var>.</li>
+ </ol>
+ </dd>
+ </dl>
+
+ <p>Also add an additional step 5 to the algorithm to <A class="externalDFN" href="http://dev.w3.org/html5/webvtt/#parse-the-webvtt-settings">parse the WebVTT settings</a>:</p>
+
+ <ol start="5">
+ <li>If <var>cue</var>'s <a href="http://www.w3.org/TR/html5/single-page.html#text-track-cue-line-position" class="externalDFN">line position</a> is not <a href="http://www.w3.org/TR/html5/single-page.html#text-track-cue-automatic-line-position" class="externalDFN">auto</a> and <var>cue</var>'s <a href="http://www.w3.org/TR/html5/single-page.html#text-track-cue-size" class="externalDFN">size</a> is not 100 and <var>cue</var>'s <a href="#text-track-cue-region" class="internalDFN">region reference</a> is not the empty string, let <var>cue</var>'s <a href="#text-track-cue-region" class="internalDFN">region reference</a> be the empty string.</li>
+ </ol>
+
+ <p class="note">This makes sure that no matter in which order the cue settings are provided, if the cue has a <a href="http://www.w3.org/TR/html5/single-page.html#text-track-cue-line-position" class="externalDFN">line position</a> or a <a href="http://www.w3.org/TR/html5/single-page.html#text-track-cue-size" class="externalDFN">size</a> setting, the <a href="#text-track-cue-region" class="internalDFN">region reference</a> will be ignored.</p>
</section>
</section>