[html5] r5149 - [giow] (0) Captions - Stage 21.3: rendering: direction and size calculations

whatwg at whatwg.org whatwg at whatwg.org
Mon Jul 12 13:08:23 PDT 2010


Author: ianh
Date: 2010-07-12 13:08:21 -0700 (Mon, 12 Jul 2010)
New Revision: 5149

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Captions - Stage 21.3: rendering: direction and size calculations

Modified: complete.html
===================================================================
--- complete.html	2010-07-09 22:43:28 UTC (rev 5148)
+++ complete.html	2010-07-12 20:08:21 UTC (rev 5149)
@@ -209,7 +209,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 — 9 July 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 12 July 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>-->
@@ -86410,25 +86410,123 @@
      text parsing rules</a> to the <var title="">cue</var>'s
      <a href=#timed-track-cue-text>timed track cue text</a>.</p>
 
-     <li><p class=XXX>turn the nodes into css boxes, assuming infinite width and height</li>
+     <li>
 
-     <li><p class=XXX>establish direction (ltr vs rtl)</li>
+      <p>Apply the Unicode Bidirectional Algorithm's Paragraph Level
+      steps to <var title="">nodes</var> using the following
+      constraints, to determine the <i>paragraph embedding level</i>
+      of the cue:</p>
 
-     <li><p class=XXX>establish a minimum size and a maximum size</li>
-<!--
- * Calculate MinS:
-     If A=start and 'direction' is 'ltr' or D=vertical:
-     If A=end and 'direction' is 'rtl':
-       Let MinS = min(S, (100%-T))
-     If A=end and 'direction' is 'ltr' or D=vertical:
-     If A=start and 'direction' is 'rtl':
-       Let MinS = min(S, T)
-     If A=middle:
-       Let MinS = min(S, T <= 50% ? T*2 : (100%-T)*2)
--->
+      <ul><li><var title="">nodes</var> represents a single paragraph.</li>
 
+       <li>The paragraph's text consists of the concatenation of the
+       values of each <a href=#websrt-text-object>WebSRT Text Object</a> in <var title="">nodes</var>, in a pre-order, depth-first traversal,
+       excluding <a href=#websrt-ruby-text-object title="WebSRT Ruby Text Object">WebSRT Ruby
+       Text Objects</a> and their descendants.</li>
+
+      </ul></li>
+
+     <li>
+
+      <p>If the <i>paragraph embedding level</i> determined in the
+      previous step is even (the <i>paragraph direction</i> is
+      left-to-right), let <var title="">direction</var> be <i>ltr</i>,
+      otherwise, let it be <i>rtl</i>.</p>
+
+     </li>
+
+     <li>
+
+      <p>Determine the value of <var title="">maximum size</var> as per the
+      appropriate rules from the following list:</p>
+
+      <dl class=switch><dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a>,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a>,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a></dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <a href=#timed-track-cue-text-position>timed track cue text position</a> subtracted from 100.</p>
+       </dd>
+
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a>,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a>,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a></dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <a href=#timed-track-cue-text-position>timed track cue text position</a>.</p>
+       </dd>
+
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50</dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50</dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <a href=#timed-track-cue-text-position>timed track cue text position</a> multiplied by two.</p>
+       </dd>
+
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50</dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50</dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the result of subtracting <a href=#timed-track-cue-text-position>timed track cue text position</a> from 100 and then multiplying the result by two.</p>
+       </dd>
+
+      </dl></li>
+
+     <li><p>If the <a href=#timed-track-cue-size>timed track cue size</a> is less than <var title="">maximum size</var>, then let <var title="">size</var> be
+     <a href=#timed-track-cue-size>timed track cue size</a>. Otherwise, let <var title="">size</var> be <var title="">maximum size</var>.</li>
+
      <li><p class=XXX>apply css rules (styles and min/max dimensions) to get dimensions for the boxes; regardless of 'white-space', force wrapping at the max width and at line breaks</li>
 
+     <li><p class=XXX>turn the nodes into css boxes</li>
+
+<!-- XXX
+construct a CSS box model tree [or whatever] from the WebSRT Node
+Object tree rooted at /whatever/, witin the following constraints:
+
+ + mappings of nodes to css 'display' values
+ + dimensions
+ + white-space rules
+
+-->
+
 <!--
  * If D=horizontal:
      Let H = the height of the first line box of /lines/

Modified: index
===================================================================
--- index	2010-07-09 22:43:28 UTC (rev 5148)
+++ index	2010-07-12 20:08:21 UTC (rev 5149)
@@ -213,7 +213,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 — 9 July 2010</h2>
+    <h2 class="no-num no-toc">Draft Standard — 12 July 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>-->
@@ -79651,25 +79651,123 @@
      text parsing rules</a> to the <var title="">cue</var>'s
      <a href=#timed-track-cue-text>timed track cue text</a>.</p>
 
-     <li><p class=XXX>turn the nodes into css boxes, assuming infinite width and height</li>
+     <li>
 
-     <li><p class=XXX>establish direction (ltr vs rtl)</li>
+      <p>Apply the Unicode Bidirectional Algorithm's Paragraph Level
+      steps to <var title="">nodes</var> using the following
+      constraints, to determine the <i>paragraph embedding level</i>
+      of the cue:</p>
 
-     <li><p class=XXX>establish a minimum size and a maximum size</li>
-<!--
- * Calculate MinS:
-     If A=start and 'direction' is 'ltr' or D=vertical:
-     If A=end and 'direction' is 'rtl':
-       Let MinS = min(S, (100%-T))
-     If A=end and 'direction' is 'ltr' or D=vertical:
-     If A=start and 'direction' is 'rtl':
-       Let MinS = min(S, T)
-     If A=middle:
-       Let MinS = min(S, T <= 50% ? T*2 : (100%-T)*2)
--->
+      <ul><li><var title="">nodes</var> represents a single paragraph.</li>
 
+       <li>The paragraph's text consists of the concatenation of the
+       values of each <a href=#websrt-text-object>WebSRT Text Object</a> in <var title="">nodes</var>, in a pre-order, depth-first traversal,
+       excluding <a href=#websrt-ruby-text-object title="WebSRT Ruby Text Object">WebSRT Ruby
+       Text Objects</a> and their descendants.</li>
+
+      </ul></li>
+
+     <li>
+
+      <p>If the <i>paragraph embedding level</i> determined in the
+      previous step is even (the <i>paragraph direction</i> is
+      left-to-right), let <var title="">direction</var> be <i>ltr</i>,
+      otherwise, let it be <i>rtl</i>.</p>
+
+     </li>
+
+     <li>
+
+      <p>Determine the value of <var title="">maximum size</var> as per the
+      appropriate rules from the following list:</p>
+
+      <dl class=switch><dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a>,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a>,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a></dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <a href=#timed-track-cue-text-position>timed track cue text position</a> subtracted from 100.</p>
+       </dd>
+
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a>,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-start-alignment title="timed track cue start alignment">start</a>,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              and the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-end-alignment title="timed track cue end alignment">end</a></dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <a href=#timed-track-cue-text-position>timed track cue text position</a>.</p>
+       </dd>
+
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50</dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50</dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <a href=#timed-track-cue-text-position>timed track cue text position</a> multiplied by two.</p>
+       </dd>
+
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal writing direction">horizontal</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              the <a href=#timed-track-cue-text-position>timed track cue text position</a> is less than or equal to 50,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-left-writing-direction title="timed track cue vertical growing left writing direction">vertical growing left</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50</dt>
+       <dt>If the <a href=#timed-track-cue-writing-direction>timed track cue writing direction</a> is <a href=#timed-track-cue-vertical-growing-right-writing-direction title="timed track cue vertical growing right writing direction">vertical growing right</a>,
+              the <a href=#timed-track-cue-alignment>timed track cue alignment</a> is <a href=#timed-track-cue-middle-alignment title="timed track cue middle alignment">middle</a>,
+              and the <a href=#timed-track-cue-text-position>timed track cue text position</a> is greater than <!-- or equal to --> 50</dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the result of subtracting <a href=#timed-track-cue-text-position>timed track cue text position</a> from 100 and then multiplying the result by two.</p>
+       </dd>
+
+      </dl></li>
+
+     <li><p>If the <a href=#timed-track-cue-size>timed track cue size</a> is less than <var title="">maximum size</var>, then let <var title="">size</var> be
+     <a href=#timed-track-cue-size>timed track cue size</a>. Otherwise, let <var title="">size</var> be <var title="">maximum size</var>.</li>
+
      <li><p class=XXX>apply css rules (styles and min/max dimensions) to get dimensions for the boxes; regardless of 'white-space', force wrapping at the max width and at line breaks</li>
 
+     <li><p class=XXX>turn the nodes into css boxes</li>
+
+<!-- XXX
+construct a CSS box model tree [or whatever] from the WebSRT Node
+Object tree rooted at /whatever/, witin the following constraints:
+
+ + mappings of nodes to css 'display' values
+ + dimensions
+ + white-space rules
+
+-->
+
 <!--
  * If D=horizontal:
      Let H = the height of the first line box of /lines/

Modified: source
===================================================================
--- source	2010-07-09 22:43:28 UTC (rev 5148)
+++ source	2010-07-12 20:08:21 UTC (rev 5149)
@@ -98578,25 +98578,134 @@
      text parsing rules</span> to the <var title="">cue</var>'s
      <span>timed track cue text</span>.</p>
 
-     <li><p class="XXX">turn the nodes into css boxes, assuming infinite width and height</p></li>
+     <li>
 
-     <li><p class="XXX">establish direction (ltr vs rtl)</p></li>
+      <p>Apply the Unicode Bidirectional Algorithm's Paragraph Level
+      steps to <var title="">nodes</var> using the following
+      constraints, to determine the <i>paragraph embedding level</i>
+      of the cue:</p>
 
-     <li><p class="XXX">establish a minimum size and a maximum size</p></li>
-<!--
- * Calculate MinS:
-     If A=start and 'direction' is 'ltr' or D=vertical:
-     If A=end and 'direction' is 'rtl':
-       Let MinS = min(S, (100%-T))
-     If A=end and 'direction' is 'ltr' or D=vertical:
-     If A=start and 'direction' is 'rtl':
-       Let MinS = min(S, T)
-     If A=middle:
-       Let MinS = min(S, T <= 50% ? T*2 : (100%-T)*2)
--->
+      <ul>
 
+       <li><var title="">nodes</var> represents a single paragraph.</li>
+
+       <li>The paragraph's text consists of the concatenation of the
+       values of each <span>WebSRT Text Object</span> in <var
+       title="">nodes</var>, in a pre-order, depth-first traversal,
+       excluding <span title="WebSRT Ruby Text Object">WebSRT Ruby
+       Text Objects</span> and their descendants.</li>
+
+      </ul>
+
+     </li>
+
+     <li>
+
+      <p>If the <i>paragraph embedding level</i> determined in the
+      previous step is even (the <i>paragraph direction</i> is
+      left-to-right), let <var title="">direction</var> be <i>ltr</i>,
+      otherwise, let it be <i>rtl</i>.</p>
+
+     </li>
+
+     <li>
+
+      <p>Determine the value of <var title="">maximum size</var> as per the
+      appropriate rules from the following list:</p>
+
+      <dl class="switch">
+
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue start alignment">start</span>,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue end alignment">end</span>,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing left writing direction">vertical growing left</span>,
+              and the <span>timed track cue alignment</span> is <span title="timed track cue start alignment">start</span></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing right writing direction">vertical growing right</span>,
+              and the <span>timed track cue alignment</span> is <span title="timed track cue start alignment">start</span></dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <span>timed track cue text position</span> subtracted from 100.</p>
+       </dd>
+
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue end alignment">end</span>,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue start alignment">start</span>,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing left writing direction">vertical growing left</span>,
+              and the <span>timed track cue alignment</span> is <span title="timed track cue end alignment">end</span></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing right writing direction">vertical growing right</span>,
+              and the <span>timed track cue alignment</span> is <span title="timed track cue end alignment">end</span></dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <span>timed track cue text position</span>.</p>
+       </dd>
+
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              the <span>timed track cue text position</span> is less than or equal to 50,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              the <span>timed track cue text position</span> is greater than <!-- or equal to --> 50,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing left writing direction">vertical growing left</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              and the <span>timed track cue text position</span> is less than or equal to 50</dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing right writing direction">vertical growing right</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              and the <span>timed track cue text position</span> is less than or equal to 50</dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the <span>timed track cue text position</span> multiplied by two.</p>
+       </dd>
+
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              the <span>timed track cue text position</span> is greater than <!-- or equal to --> 50,
+              and <var title="">direction</var> is <i>ltr</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue horizontal writing direction">horizontal</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              the <span>timed track cue text position</span> is less than or equal to 50,
+              and <var title="">direction</var> is <i>rtl</i></dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing left writing direction">vertical growing left</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              and the <span>timed track cue text position</span> is greater than <!-- or equal to --> 50</dt>
+       <dt>If the <span>timed track cue writing direction</span> is <span title="timed track cue vertical growing right writing direction">vertical growing right</span>,
+              the <span>timed track cue alignment</span> is <span title="timed track cue middle alignment">middle</span>,
+              and the <span>timed track cue text position</span> is greater than <!-- or equal to --> 50</dt>
+
+       <dd>
+        <p>Let <var title="">maximum size</var> be the result of subtracting <span>timed track cue text position</span> from 100 and then multiplying the result by two.</p>
+       </dd>
+
+      </dl>
+
+     </li>
+
+     <li><p>If the <span>timed track cue size</span> is less than <var
+     title="">maximum size</var>, then let <var title="">size</var> be
+     <span>timed track cue size</span>. Otherwise, let <var
+     title="">size</var> be <var title="">maximum size</var>.</p></li>
+
      <li><p class="XXX">apply css rules (styles and min/max dimensions) to get dimensions for the boxes; regardless of 'white-space', force wrapping at the max width and at line breaks</p></li>
 
+     <li><p class="XXX">turn the nodes into css boxes</p></li>
+
+<!-- XXX
+construct a CSS box model tree [or whatever] from the WebSRT Node
+Object tree rooted at /whatever/, witin the following constraints:
+
+ + mappings of nodes to css 'display' values
+ + dimensions
+ + white-space rules
+
+-->
+
 <!--
  * If D=horizontal:
      Let H = the height of the first line box of /lines/




More information about the Commit-Watchers mailing list