Skip to content

Commit

Permalink
Drop line: and position: settings with invalid linealign/colalign
Browse files Browse the repository at this point in the history
Fixes #336.
  • Loading branch information
zcorpan committed Mar 3, 2017
1 parent b17a2be commit 879247c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 47 deletions.
57 changes: 32 additions & 25 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2632,10 +2632,11 @@ run the following steps:</p>

<ol>

<li><p>If |value| contains a U+002C COMMA character (,), then let |linepos| be the leading
substring of |value| up to and excluding the first U+002C COMMA character (,) in that string
and let |linealign| be the trailing substring of |value| starting from the character
immediately after the first U+002C COMMA character (,) in that string.</p></li>
<li><p>If |value| contains a U+002C COMMA character (,) that is not the last character in
|value|, then let |linepos| be the leading substring of |value| up to and excluding the first
U+002C COMMA character (,) in that string and let |linealign| be the trailing substring of
|value| starting from the character immediately after the first U+002C COMMA character (,) in
that string.</p></li>

<li><p>Otherwise let |linepos| be the full |value| string and |linealign| be the empty
string.</p></li>
Expand Down Expand Up @@ -2675,22 +2676,25 @@ run the following steps:</p>
</dl>
</li>

<li><p>Let |cue|'s <a>WebVTT cue line</a> be |number|.</p></li>

<li><p>If the last character in |linepos| is a U+0025 PERCENT SIGN character (%), then let
|cue|'s <a>WebVTT cue snap-to-lines flag</a> be false. Otherwise, let it be true.</p></li>

<li><p>If |linealign| is a <a>case-sensitive</a> match for the string "<code>start</code>",
then let |cue|'s <a>WebVTT cue line alignment</a> be <a lt="WebVTT cue line start
alignment">start alignment</a>.</p></li>

<li><p>If |linealign| is a <a>case-sensitive</a> match for the string "<code>center</code>",
then let |cue|'s <a>WebVTT cue line alignment</a> be <a lt="WebVTT cue line center
alignment">center alignment</a>.</p></li>
<li><p>Otherwise, if |linealign| is a <a>case-sensitive</a> match for the string
"<code>center</code>", then let |cue|'s <a>WebVTT cue line alignment</a> be <a lt="WebVTT cue
line center alignment">center alignment</a>.</p></li>

<li><p>Otherwise, if |linealign| is a <a>case-sensitive</a> match for the string
"<code>end</code>", then let |cue|'s <a>WebVTT cue line alignment</a> be <a lt="WebVTT cue
line end alignment">end alignment</a>.</p></li>

<li><p>Otherwise, if |linealign| is not the empty string, then jump to the step labeled
<i>next setting</i>.</p></li>

<li><p>Let |cue|'s <a>WebVTT cue line</a> be |number|.</p></li>

<li><p>If |linealign| is a <a>case-sensitive</a> match for the string "<code>end</code>",
then let |cue|'s <a>WebVTT cue line alignment</a> be <a lt="WebVTT cue line end
alignment">end alignment</a>.</p></li>
<li><p>If the last character in |linepos| is a U+0025 PERCENT SIGN character (%), then let
|cue|'s <a>WebVTT cue snap-to-lines flag</a> be false. Otherwise, let it be true.</p></li>

</ol>

Expand All @@ -2702,10 +2706,11 @@ run the following steps:</p>

<ol>

<li><p>If |value| contains a U+002C COMMA character (,), then let |colpos| be the leading
substring of |value| up to and excluding the first U+002C COMMA character (,) in that string
and let |colalign| be the trailing substring of |value| starting from the character
immediately after the first U+002C COMMA character (,) in that string.</p></li>
<li><p>If |value| contains a U+002C COMMA character (,) that is not the last character in
|value|, then let |colpos| be the leading substring of |value| up to and excluding the first
U+002C COMMA character (,) in that string and let |colalign| be the trailing substring of
|value| starting from the character immediately after the first U+002C COMMA character (,) in
that string.</p></li>

<li><p>Otherwise let |colpos| be the full |value| string and |colalign| be the empty
string.</p></li>
Expand All @@ -2715,20 +2720,22 @@ run the following steps:</p>
cue position">position</a>'s value remains the special value <a lt="WebVTT cue automatic
position">auto</a>).</p></li>

<li><p>Let |cue|'s <a lt="WebVTT cue position">position</a> be |number|.</p></li>

<li><p>If |colalign| is a <a>case-sensitive</a> match for the string
"<code>line-left</code>", then let |cue|'s <a>WebVTT cue position alignment</a> be <a
lt="WebVTT cue position line-left alignment">line-left alignment</a>.</p></li>

<li><p>If |colalign| is a <a>case-sensitive</a> match for the string "<code>center</code>",
then let |cue|'s <a>WebVTT cue position alignment</a> be <a lt="WebVTT cue position center
alignment">center alignment</a>.</p></li>
<li><p>Otherwise, if |colalign| is a <a>case-sensitive</a> match for the string
"<code>center</code>", then let |cue|'s <a>WebVTT cue position alignment</a> be <a lt="WebVTT
cue position center alignment">center alignment</a>.</p></li>

<li><p>If |colalign| is a <a>case-sensitive</a> match for the string
<li><p>Otherwise, if |colalign| is a <a>case-sensitive</a> match for the string
"<code>line-right</code>", then let |cue|'s <a>WebVTT cue position alignment</a> be <a
lt="WebVTT cue position line-right alignment">line-right alignment</a>.</p></li>

<li><p>Otherwise, if |colalign| is not the empty string, then jump to the step labeled <i>next setting</i>.</p></li>

<li><p>Let |cue|'s <a lt="WebVTT cue position">position</a> be |number|.</p></li>

</ol>

</dd>
Expand Down
46 changes: 24 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">WebVTT: The Web Video Text Tracks Format</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="2017-02-22">22 February 2017</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="2017-03-03">3 March 2017</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
Expand Down Expand Up @@ -3431,10 +3431,9 @@ <h3 class="heading settled algorithm" data-algorithm="WebVTT cue timings and set
<dd>
<ol>
<li>
<p>If <var>value</var> contains a U+002C COMMA character (,), then let <var>linepos</var> be the leading
substring of <var>value</var> up to and excluding the first U+002C COMMA character (,) in that string
and let <var>linealign</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>
<p>If <var>value</var> contains a U+002C COMMA character (,) that is not the last character in <var>value</var>, then let <var>linepos</var> be the leading substring of <var>value</var> up to and excluding the first
U+002C COMMA character (,) in that string and let <var>linealign</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>
<p>Otherwise let <var>linepos</var> be the full <var>value</var> string and <var>linealign</var> be the empty
string.</p>
Expand Down Expand Up @@ -3470,45 +3469,48 @@ <h3 class="heading settled algorithm" data-algorithm="WebVTT cue timings and set
that number.</p>
</ol>
</dl>
<li>
<p>Let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-line" id="ref-for-webvtt-cue-line-22">WebVTT cue line</a> be <var>number</var>.</p>
<li>
<p>If the last character in <var>linepos</var> is a U+0025 PERCENT SIGN character (%), then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-snap-to-lines-flag" id="ref-for-webvtt-cue-snap-to-lines-flag-10">WebVTT cue snap-to-lines flag</a> be false. Otherwise, let it be true.</p>
<li>
<p>If <var>linealign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string "<code>start</code>",
then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-line-alignment" id="ref-for-webvtt-cue-line-alignment-7">WebVTT cue line alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-line-start-alignment" id="ref-for-webvtt-cue-line-start-alignment-5">start alignment</a>.</p>
<li>
<p>If <var>linealign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string "<code>center</code>",
then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-line-alignment" id="ref-for-webvtt-cue-line-alignment-8">WebVTT cue line alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-line-center-alignment" id="ref-for-webvtt-cue-line-center-alignment-2">center alignment</a>.</p>
<p>Otherwise, if <var>linealign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string
"<code>center</code>", then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-line-alignment" id="ref-for-webvtt-cue-line-alignment-8">WebVTT cue line alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-line-center-alignment" id="ref-for-webvtt-cue-line-center-alignment-2">center alignment</a>.</p>
<li>
<p>Otherwise, if <var>linealign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string
"<code>end</code>", then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-line-alignment" id="ref-for-webvtt-cue-line-alignment-9">WebVTT cue line alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-line-end-alignment" id="ref-for-webvtt-cue-line-end-alignment-2">end alignment</a>.</p>
<li>
<p>Otherwise, if <var>linealign</var> is not the empty string, then jump to the step labeled <i>next setting</i>.</p>
<li>
<p>Let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-line" id="ref-for-webvtt-cue-line-22">WebVTT cue line</a> be <var>number</var>.</p>
<li>
<p>If <var>linealign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string "<code>end</code>",
then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-line-alignment" id="ref-for-webvtt-cue-line-alignment-9">WebVTT cue line alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-line-end-alignment" id="ref-for-webvtt-cue-line-end-alignment-2">end alignment</a>.</p>
<p>If the last character in <var>linepos</var> is a U+0025 PERCENT SIGN character (%), then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-snap-to-lines-flag" id="ref-for-webvtt-cue-snap-to-lines-flag-10">WebVTT cue snap-to-lines flag</a> be false. Otherwise, let it be true.</p>
</ol>
<dt>If <var>name</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for "<code>position</code>"
<dd>
<ol>
<li>
<p>If <var>value</var> contains a U+002C COMMA character (,), then let <var>colpos</var> be the leading
substring of <var>value</var> up to and excluding the first U+002C COMMA character (,) in that string
and let <var>colalign</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>
<p>If <var>value</var> contains a U+002C COMMA character (,) that is not the last character in <var>value</var>, then let <var>colpos</var> be the leading substring of <var>value</var> up to and excluding the first
U+002C COMMA character (,) in that string and let <var>colalign</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>
<p>Otherwise let <var>colpos</var> be the full <var>value</var> string and <var>colalign</var> be the empty
string.</p>
<li>
<p>If <a data-link-type="dfn" href="#parse-a-percentage-string" id="ref-for-parse-a-percentage-string-7">parse a percentage string</a> from <var>colpos</var> doesn’t fail, let <var>number</var> be the
returned <var>percentage</var>, otherwise jump to the step labeled <i>next setting</i> (<a data-link-type="dfn" href="#webvtt-cue-position" id="ref-for-webvtt-cue-position-21">position</a>’s value remains the special value <a data-link-type="dfn" href="#webvtt-cue-automatic-position" id="ref-for-webvtt-cue-automatic-position-7">auto</a>).</p>
<li>
<p>Let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-position" id="ref-for-webvtt-cue-position-22">position</a> be <var>number</var>.</p>
<li>
<p>If <var>colalign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string
"<code>line-left</code>", then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-position-alignment" id="ref-for-webvtt-cue-position-alignment-8">WebVTT cue position alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-position-line-left-alignment" id="ref-for-webvtt-cue-position-line-left-alignment-4">line-left alignment</a>.</p>
<li>
<p>If <var>colalign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string "<code>center</code>",
then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-position-alignment" id="ref-for-webvtt-cue-position-alignment-9">WebVTT cue position alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-position-center-alignment" id="ref-for-webvtt-cue-position-center-alignment-2">center alignment</a>.</p>
<p>Otherwise, if <var>colalign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string
"<code>center</code>", then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-position-alignment" id="ref-for-webvtt-cue-position-alignment-9">WebVTT cue position alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-position-center-alignment" id="ref-for-webvtt-cue-position-center-alignment-2">center alignment</a>.</p>
<li>
<p>If <var>colalign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string
<p>Otherwise, if <var>colalign</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for the string
"<code>line-right</code>", then let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-position-alignment" id="ref-for-webvtt-cue-position-alignment-10">WebVTT cue position alignment</a> be <a data-link-type="dfn" href="#webvtt-cue-position-line-right-alignment" id="ref-for-webvtt-cue-position-line-right-alignment-3">line-right alignment</a>.</p>
<li>
<p>Otherwise, if <var>colalign</var> is not the empty string, then jump to the step labeled <i>next setting</i>.</p>
<li>
<p>Let <var>cue</var>’s <a data-link-type="dfn" href="#webvtt-cue-position" id="ref-for-webvtt-cue-position-22">position</a> be <var>number</var>.</p>
</ol>
<dt>If <var>name</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive">case-sensitive</a> match for "<code>size</code>"
<dd>
Expand Down

0 comments on commit 879247c

Please sign in to comment.