Started making changes for redesigning the positioning mechanism:
authorSilvia Pfeiffer
Mon, 12 Aug 2013 11:17:58 +1000
changeset 133 783e536e79aa
parent 132 eb24a56b673f
child 134 03d90fa466a5
Started making changes for redesigning the positioning mechanism:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20037

This change adapts the data model (section 3.1)
and the syntax description (section 4.4.2).
The latter mainly has changes of the notes.
webvtt/webvtt.html
--- a/webvtt/webvtt.html	Sun Aug 11 17:40:05 2013 +1000
+++ b/webvtt/webvtt.html	Mon Aug 12 11:17:58 2013 +1000
@@ -613,6 +613,10 @@
     relative to the width of the video, and <a title="text track cue text position">text
     position</a> and <a title="text track cue size">size</a> percentages are relative to
     the height of the video.</p>
+
+    <p>The <a title="text track cue writing direction">writing direction</a> defaults to
+    <a title="text track cue horizontal writing direction">horizontal</a>.</p>
+
    </dd>
 
    <dt><dfn title="text track cue snap-to-lines flag">A snap-to-lines flag</dfn>
@@ -626,6 +630,9 @@
     title-safe area on user agents that use overscan. Cues with the flag unset will be positioned as
     requested (modulo overlap avoidance if multiple cues are in the same place).</p>
 
+    <p>By default, the <a title="text track cue snap-to-lines flag">snap-to-lines flag</a>
+    is set to 'true'.</p>
+
    </dd>
 
    <dt><dfn title="text track cue line position">A line position</dfn>
@@ -634,7 +641,7 @@
     the <a title="text track cue writing direction">writing direction</a> and <a
     title="text track cue snap-to-lines flag">snap-to-lines flag</a> of the cue, or the special
     value <dfn title="text track cue automatic line position">auto</dfn>, which means the position
-    is to depend on the other active tracks.</p>
+    is to depend on the other active cues.</p>
 
     <p>A <a>text track cue</a> has a <dfn>text track cue computed line position</dfn> whose
     value is that returned by the following algorithm, which is defined in terms of the other
@@ -683,39 +690,67 @@
 
    </dd>
 
-   <dt><dfn title="text track cue text position">A text position</dfn>
-   <dd>
-     <p>A number giving the position of the text of the cue within each line. If the cue is not within a region, to be interpreted as a percentage of the video, as defined by the <span title="text track cue writing direction">writing direction</span>, otherwise to be interpreted as a percentage of the region width.</p>
-   </dd>
-
    <dt><dfn title="text track cue size">A size</dfn>
    <dd>
     <p>A number giving the size of the box within which the text of each line of the cue is to be
-    aligned, to be interpreted as a percentage of the video, as defined by the <a title="text
-    track cue writing direction">writing direction</a>.</p>
+    rendered, to be interpreted as a percentage of the video, as defined by the <a title="text
+    track cue writing direction">writing direction</a>. This box is called the <dfn>cue box</dfn>.</p>
    </dd>
 
+   <dt><dfn title="text track cue text position">A text position</dfn>
+   <dd>
+     <p>A number giving the position of the text within the <a>cue box</a>. If the cue is not within
+     a region, the value is to be interpreted as a percentage of the box's 
+     <a title="text track cue size">size</a>, otherwise as a percentage of the region width.</p>
+
+     <p>A <a>text track cue</a> has a default <a>text track cue text position</a>, which is defined
+     in terms of the value of the <a>text track cue alignment</a>:</p>
+     
+     <ol>
+
+       <li>For <a title="text track cue start alignment">start aligned</a> cues: 0%.</li>
+
+       <li>For <a title="text track cue middle alignment">middle aligned</a> cues: 50%.</li>
+
+       <li>For <a title="text track cue end alignment">end aligned</a> cues: 100%.</li>
+
+       <li>For <a title="text track cue left alignment">left aligned</a> cues with left-to-right
+       <i>paragraph direction</i> <a href="#refsBIDI">[BIDI]</a>: 0%, otherwise 100%.</li>
+
+       <li>For <a title="text track cue right alignment">right aligned</a> cues with left-to-right
+       <i>paragraph direction</i> <a href="#refsBIDI">[BIDI]</a>: 100%, otherwise 0%.</li>
+
+     </ol>
+
+     <p class="note">Since the default value of the <a>text track cue text position</a> is
+     <a title="text track cue middle alignment">middle</a>, if there is no
+     <a>text track cue alignment</a> setting for a cue, the <a>text track cue text position</a>
+     defaults to 50%.</p>
+
+   </dd>
+
+
    <dt><dfn title="text track cue alignment">An alignment</dfn>
    <dd>
 
-    <p>An alignment for the text of each line of the cue, one of:</p>
+    <p>An alignment for all lines of text within the <a>cue box</a>, one of:</p>
 
     <dl>
 
      <dt><dfn title="text track cue start alignment">Start alignment</dfn></dt>
-     <dd>The text is aligned towards its start side.</dd>
+     <dd>The text is aligned towards the box's start side.</dd>
 
      <dt><dfn title="text track cue middle alignment">Middle alignment</dfn></dt>
-     <dd>The text is aligned centered between its start and end sides.</dd>
+     <dd>The text is aligned centered between the box's start and end sides.</dd>
 
      <dt><dfn title="text track cue end alignment">End alignment</dfn></dt>
-     <dd>The text is aligned towards its end side.</dd>
+     <dd>The text is aligned towards the box's end side.</dd>
 
      <dt><dfn title="text track cue left alignment">Left alignment</dfn></dt>
-     <dd>The text is aligned to the left.</dd>
+     <dd>The text is aligned to the box's left side.</dd>
 
      <dt><dfn title="text track cue right alignment">Right alignment</dfn></dt>
-     <dd>The text is aligned to the right.</dd>
+     <dd>The text is aligned to the box's right side.</dd>
 
     </dl>
 
@@ -723,6 +758,40 @@
     the <a title="text track cue writing direction">writing direction</a>. <a
     href="#refsBIDI">[BIDI]</a></p>
 
+    <p>By default, the value of the <a>text track cue alignment</a> is
+    <a title="text track cue middle alignment">middle aligned</a>.</p>
+
+    <p>A <a>text track cue</a> has a <dfn>computed text position anchor point</dfn>,
+    which signifies the point in the text whose position within the <a>cue box</a> can be manipulated
+    through the <a title="text track cue text position">text position</a> cue setting. The value of
+    the <a>computed text position anchor point</a> is set as follows:</p>
+
+    <ol>
+
+      <li>For <a title="text track cue start alignment">start aligned</a> cues: the first character
+      of each line of text is positioned at the <a>text track cue text position</a> point within
+      the <a>cue box</a>.</li>
+
+      <li>For <a title="text track cue middle alignment">middle aligned</a> cues: the middle character
+      of each line of text is positioned at the <a>text track cue text position</a> point within
+      the <a>cue box</a>.</li>
+
+      <li>For <a title="text track cue end alignment">end aligned</a> cues: the last character
+      of each line of text is positioned at the <a>text track cue text position</a> point within
+      the <a>cue box</a>.</li>
+
+      <li>For <a title="text track cue left alignment">left aligned</a> cues with left-to-right
+      <i>paragraph direction</i> <a href="#refsBIDI">[BIDI]</a>: the first character of each line of
+      text is positioned at the <a>text track cue text position</a> point within the <a>cue box</a>,
+      otherwise the last character is positioned there.</li>
+
+      <li>For <a title="text track cue right alignment">right aligned</a> cues with left-to-right
+      <i>paragraph direction</i> <a href="#refsBIDI">[BIDI]</a>: the last character of each line of
+      text is positioned at the <a>text track cue text position</a> point within the <a>cue box</a>,
+      otherwise the first character is positioned there.</li>
+
+    </ol>
+
    </dd>
 
    <dt><dfn title="text track cue region identifier">A region identifier</dfn></dt>
@@ -1474,10 +1543,10 @@
   <ul class="brief"> 
    <li>A <a>WebVTT vertical text cue setting</a>.</li> <!-- vertical:rl/lr -->
    <li>A <a>WebVTT line position cue setting</a>.</li> <!-- line:100% line:1 line:-1 -->
-   <li>A <a>WebVTT text position cue setting</a>.</li> <!-- position:100% -->
    <li>A <a>WebVTT size cue setting</a>.</li>          <!-- size:100% -->
+   <li>A <a>WebVTT text position cue setting</a>.</li> <!-- position:100% -->
    <li>A <a>WebVTT alignment cue setting</a>.</li>     <!-- align:start/middle/end/left/right -->
-   <li>A <a>WebVTT region cue setting</a>.</li>         <!-- region:fred -->
+   <li>A <a>WebVTT region cue setting</a>.</li>        <!-- region:fred -->
   </ul>
 
   <p class="note">A <a>WebVTT cue settings list</a> gives configuration
@@ -1534,6 +1603,26 @@
   line is numbered 0), negative line numbers from the bottom of the
   frame (the bottom line is numbered &#x2212;1).</p>
 
+  <p>A <dfn>WebVTT size cue setting</dfn> consists of the
+  following components, in the order given:</p>
+
+  <ol>
+   <li><p>The string "<code title="">size</code>" as the <a>WebVTT cue setting name</a>.</p></li>
+   <li><p>A U+003A COLON character (:).</p></li>
+   <li>As the <a>WebVTT cue setting value</a>:
+    <ol>
+     <li>One or more <a>ASCII digits</a>.</li>
+     <li>A U+0025 PERCENT SIGN character (%).</li>
+    </ol>
+   </li>
+  </ol>
+
+  <p class="note">A <a>WebVTT size cue setting</a> configures
+  the size of the <a>cue box</a> in the same direction as the <a>WebVTT text
+  position cue setting</a>. For horizontal cues, this is the width
+  of the <a>cue box</a>. It is given as a percentage of the width of the
+  frame.</p>
+
   <p>A <dfn>WebVTT text position cue setting</dfn> consists of the
   following components, in the order given:</p>
 
@@ -1553,29 +1642,9 @@
   the <a>WebVTT line position cue setting</a>. For horizontal
   cues, this is the horizontal position. The <a>WebVTT text
   position cue setting</a> is given as a percentage, calculated
-  from the edge of the frame that the text begins (so for
+  from the edge of the <a>cue box</a> that the text begins (so for
   left-to-right English text, the left edge).</p>
 
-  <p>A <dfn>WebVTT size cue setting</dfn> consists of the
-  following components, in the order given:</p>
-
-  <ol>
-   <li><p>The string "<code title="">size</code>" as the <a>WebVTT cue setting name</a>.</p></li>
-   <li><p>A U+003A COLON character (:).</p></li>
-   <li>As the <a>WebVTT cue setting value</a>:
-    <ol>
-     <li>One or more <a>ASCII digits</a>.</li>
-     <li>A U+0025 PERCENT SIGN character (%).</li>
-    </ol>
-   </li>
-  </ol>
-
-  <p class="note">A <a>WebVTT size cue setting</a> configures
-  the size of the cue in the same direction as the <a>WebVTT text
-  position cue setting</a>. For horizontal cues, this is the width
-  of the cue. It is given as a percentage of the width of the
-  frame.</p>
-
   <p>A <dfn>WebVTT alignment cue setting</dfn> consists of the
   following components, in the order given:</p>