[html5] r5148 - [giow] (0) Captions - Stage 21.2: rendering: wip.

whatwg at whatwg.org whatwg at whatwg.org
Fri Jul 9 15:43:30 PDT 2010


Author: ianh
Date: 2010-07-09 15:43:28 -0700 (Fri, 09 Jul 2010)
New Revision: 5148

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Captions - Stage 21.2: rendering: wip.

Modified: complete.html
===================================================================
--- complete.html	2010-07-09 19:29:58 UTC (rev 5147)
+++ complete.html	2010-07-09 22:43:28 UTC (rev 5148)
@@ -26342,7 +26342,12 @@
 
    <dt>The <dfn id=timed-track-cue-display-state title="timed track cue display state">display state</dfn>
    <dd>
-    <p>This is used as part of the rendering model.</p>
+
+    <p>This is used as part of the rendering model, to keep cues in a
+    consistent position. It must initially be empty. Whenever the
+    <a href=#timed-track-cue-active-flag>timed track cue active flag</a> is unset, the user agent
+    must empty the <a href=#timed-track-cue-display-state>timed track cue display state</a>.</p>
+
    </dd>
 
   </dl><p>The <a href=#timed-track-cue title="timed track cue">timed track cues</a> of a
@@ -86391,36 +86396,96 @@
    of cues</a> that have their <a href=#timed-track-cue-active-flag>timed track cue active
    flag</a> set.</li>
 
+   <li><p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var> in <var title="">cues</var>: if <var title="">cue</var>'s <a href=#timed-track-cue-display-state>timed track cue display state</a> has
+   a set of CSS boxes, then add those boxes to <var title="">output</var>, and remove <var title="">cue</var> from <var title="">cues</var>.</li>
+
    <li>
 
-    <p>Sort <var title="">cues</var> in <a href=#timed-track-cue-order>timed track cue
-    order</a>.</p>
+    <p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var>
+    in <var title="">cues</var> that remains, in <a href=#timed-track-cue-order>timed track cue
+    order</a>, run the following substeps:</p>
 
-    <p class=note>If the tracks and cues in the previous steps were
-    added to the lists in the same order as the lists from which they
-    were sourced, the <var title="">cues</var> list will already be in
-    <a href=#timed-track-cue-order>timed track cue order</a>.</p>
+    <ol><li><p>Let <var title="">nodes</var> be the <a href=#list-of-websrt-node-objects>list of WebSRT
+     Node Objects</a> obtained by applying the <a href=#websrt-cue-text-parsing-rules>WebSRT cue
+     text parsing rules</a> to the <var title="">cue</var>'s
+     <a href=#timed-track-cue-text>timed track cue text</a>.</p>
 
-   </li>
+     <li><p class=XXX>turn the nodes into css boxes, assuming infinite width and height</li>
 
-   <li><p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var> in <var title="">cues</var>: if <var title="">cue</var>'s <a href=#timed-track-cue-display-state>timed track cue display state</a> has
-   a set of CSS boxes, then add those boxes to <var title="">output</var>, and remove <var title="">cue</var> from <var title="">cues</var>.</li>
+     <li><p class=XXX>establish direction (ltr vs rtl)</li>
 
-   <li>
+     <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)
+-->
 
-    <p class=XXX>...</p>
+     <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>
 
-  <!--XXX
-      for each cue in cues:
-       - find default position per http://damowmow.com/temp/srtspec
-       - shunt it around to fit the current active ones
-       - add it to the list
-  -->
+<!--
+ * If D=horizontal:
+     Let H = the height of the first line box of /lines/
+     If A=start and 'direction' is 'ltr':
+     If A=end and 'direction' is 'rtl':
+       Let X = min(T * VW, VW - width of /container/)
+     If A=end and 'direction' is 'ltr':
+     If A=start and 'direction' is 'rtl':
+       Let X = min(T * VW - width of /container/, 0)
+     If A=middle and T <= 50%:
+       Let X = max(T * VW - (width of /container/)/2, 0)
+     If A=middle and T > 50%:
+       Let X = min(T * VW + (width of /container/)/2, VW) - (width of /container/)
+   If D=vertical:
+     Let H = the width of the first line box of /lines/
+     If A=start:
+       Let Y = min(T * VH, VH - height of /container/)
+     If A=end:
+       Let Y = min(T * VH - height of /container/, 0)
+     If A=middle and T <= 50%:
+       Let Y = max(T * VH - (height of /container/)/2, 0)
+     If A=middle and T > 50%:
+       Let Y = min(T * VH + (height of /container/)/2, VH) - (height of /container/)
+-->
 
-   </li>
+     <li><p class=XXX>if not snap-to-lines: position the box according to the given position information, and then spiral around clockwise until no overlap is found</li>
 
-  </ol><!-- XXX
+     <li><p class=XXX>otherwise: position the block in the inline direction; then determine the block-direction position of the first line, then slide the line away from the reference edge until it fits, or if that goes off the edge slide it in the other direction; sliding must snap to multiples of the height of the first line box.</li>
 
+     <li><p class=XXX>from the resulting position, remove any lines that don't completely render on the video</li>
+
+     <li><p class=XXX>add the boxes to the output</li>
+
+     <li><p class=XXX>save the boxes to the <a href=#timed-track-cue-display-state>timed track cue display state</a></li>
+
+    </ol></li>
+
+  </ol><h5 id=css-extensions><span class=secno>14.3.2.2 </span>CSS extensions</h5>
+
+  <p class=note>This section is intended to be moved to a CSS
+  specification once an editor is found to run with it.</p>
+
+  <p>When a user agent is rendering one or more <a href=#timed-track-cue title="timed
+  track cue">timed track cues</a> according to the <a href=#websrt-cue-text-rendering-rules>WebSRT cue
+  text rendering rules</a>, <a href=#websrt-node-object title="WebSRT Node Object">WebSRT
+  Node Objects</a> in the <a href=#list-of-websrt-node-objects>list of WebSRT Node Objects</a>
+  used in the rendering can be matched by certain pseudo-selectors as
+  defined below. These selector can begin or stop matching individual
+  <a href=#websrt-node-object title="WebSRT Node Object">WebSRT Node Objects</a> while a
+  <a href=#timed-track-cue title="timed track cue">cue</a> is being rendered, even in
+  between applications of the <a href=#websrt-cue-text-rendering-rules>WebSRT cue text rendering
+  rules</a> (which are only run when the set of active cues
+  changes). User agents that support these pseudo-elements must
+  dynamically update renderings accordingly.</p>
+
+  <!-- XXX
+
    rules for rendering the list of active cues:
     - for each segment, decide if it's before or after the current
       playback position.
@@ -86433,11 +86498,19 @@
    propagate towards the end of the segment so that it reaches the end
    of the segment when the next segment becomes "before".
 
-  --><h5 id=css-extensions><span class=secno>14.3.2.2 </span>CSS extensions</h5>
+   properties that only apply to the cue as a whole, and i, b, ruby, rt:
+    - font
+    - line-height
+    - anything else that affects the size of CSS boxes but not their kind or their position independant of their size
 
-  <p class=note>This section is intended to be moved to a CSS
-  specification once an editor is found to run with it.</p>
+   properties that apply to the above as well as 'before' and 'after' parts:
+    - color
+    - background
+    - outline
+    - anything else that doesn't affect the size or position or kind of CSS boxes
 
+  -->
+
   <p class=XXX>...</p>
 
   </div>

Modified: index
===================================================================
--- index	2010-07-09 19:29:58 UTC (rev 5147)
+++ index	2010-07-09 22:43:28 UTC (rev 5148)
@@ -26269,7 +26269,12 @@
 
    <dt>The <dfn id=timed-track-cue-display-state title="timed track cue display state">display state</dfn>
    <dd>
-    <p>This is used as part of the rendering model.</p>
+
+    <p>This is used as part of the rendering model, to keep cues in a
+    consistent position. It must initially be empty. Whenever the
+    <a href=#timed-track-cue-active-flag>timed track cue active flag</a> is unset, the user agent
+    must empty the <a href=#timed-track-cue-display-state>timed track cue display state</a>.</p>
+
    </dd>
 
   </dl><p>The <a href=#timed-track-cue title="timed track cue">timed track cues</a> of a
@@ -79632,36 +79637,96 @@
    of cues</a> that have their <a href=#timed-track-cue-active-flag>timed track cue active
    flag</a> set.</li>
 
+   <li><p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var> in <var title="">cues</var>: if <var title="">cue</var>'s <a href=#timed-track-cue-display-state>timed track cue display state</a> has
+   a set of CSS boxes, then add those boxes to <var title="">output</var>, and remove <var title="">cue</var> from <var title="">cues</var>.</li>
+
    <li>
 
-    <p>Sort <var title="">cues</var> in <a href=#timed-track-cue-order>timed track cue
-    order</a>.</p>
+    <p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var>
+    in <var title="">cues</var> that remains, in <a href=#timed-track-cue-order>timed track cue
+    order</a>, run the following substeps:</p>
 
-    <p class=note>If the tracks and cues in the previous steps were
-    added to the lists in the same order as the lists from which they
-    were sourced, the <var title="">cues</var> list will already be in
-    <a href=#timed-track-cue-order>timed track cue order</a>.</p>
+    <ol><li><p>Let <var title="">nodes</var> be the <a href=#list-of-websrt-node-objects>list of WebSRT
+     Node Objects</a> obtained by applying the <a href=#websrt-cue-text-parsing-rules>WebSRT cue
+     text parsing rules</a> to the <var title="">cue</var>'s
+     <a href=#timed-track-cue-text>timed track cue text</a>.</p>
 
-   </li>
+     <li><p class=XXX>turn the nodes into css boxes, assuming infinite width and height</li>
 
-   <li><p>For each <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var> in <var title="">cues</var>: if <var title="">cue</var>'s <a href=#timed-track-cue-display-state>timed track cue display state</a> has
-   a set of CSS boxes, then add those boxes to <var title="">output</var>, and remove <var title="">cue</var> from <var title="">cues</var>.</li>
+     <li><p class=XXX>establish direction (ltr vs rtl)</li>
 
-   <li>
+     <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)
+-->
 
-    <p class=XXX>...</p>
+     <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>
 
-  <!--XXX
-      for each cue in cues:
-       - find default position per http://damowmow.com/temp/srtspec
-       - shunt it around to fit the current active ones
-       - add it to the list
-  -->
+<!--
+ * If D=horizontal:
+     Let H = the height of the first line box of /lines/
+     If A=start and 'direction' is 'ltr':
+     If A=end and 'direction' is 'rtl':
+       Let X = min(T * VW, VW - width of /container/)
+     If A=end and 'direction' is 'ltr':
+     If A=start and 'direction' is 'rtl':
+       Let X = min(T * VW - width of /container/, 0)
+     If A=middle and T <= 50%:
+       Let X = max(T * VW - (width of /container/)/2, 0)
+     If A=middle and T > 50%:
+       Let X = min(T * VW + (width of /container/)/2, VW) - (width of /container/)
+   If D=vertical:
+     Let H = the width of the first line box of /lines/
+     If A=start:
+       Let Y = min(T * VH, VH - height of /container/)
+     If A=end:
+       Let Y = min(T * VH - height of /container/, 0)
+     If A=middle and T <= 50%:
+       Let Y = max(T * VH - (height of /container/)/2, 0)
+     If A=middle and T > 50%:
+       Let Y = min(T * VH + (height of /container/)/2, VH) - (height of /container/)
+-->
 
-   </li>
+     <li><p class=XXX>if not snap-to-lines: position the box according to the given position information, and then spiral around clockwise until no overlap is found</li>
 
-  </ol><!-- XXX
+     <li><p class=XXX>otherwise: position the block in the inline direction; then determine the block-direction position of the first line, then slide the line away from the reference edge until it fits, or if that goes off the edge slide it in the other direction; sliding must snap to multiples of the height of the first line box.</li>
 
+     <li><p class=XXX>from the resulting position, remove any lines that don't completely render on the video</li>
+
+     <li><p class=XXX>add the boxes to the output</li>
+
+     <li><p class=XXX>save the boxes to the <a href=#timed-track-cue-display-state>timed track cue display state</a></li>
+
+    </ol></li>
+
+  </ol><h5 id=css-extensions><span class=secno>12.3.2.2 </span>CSS extensions</h5>
+
+  <p class=note>This section is intended to be moved to a CSS
+  specification once an editor is found to run with it.</p>
+
+  <p>When a user agent is rendering one or more <a href=#timed-track-cue title="timed
+  track cue">timed track cues</a> according to the <a href=#websrt-cue-text-rendering-rules>WebSRT cue
+  text rendering rules</a>, <a href=#websrt-node-object title="WebSRT Node Object">WebSRT
+  Node Objects</a> in the <a href=#list-of-websrt-node-objects>list of WebSRT Node Objects</a>
+  used in the rendering can be matched by certain pseudo-selectors as
+  defined below. These selector can begin or stop matching individual
+  <a href=#websrt-node-object title="WebSRT Node Object">WebSRT Node Objects</a> while a
+  <a href=#timed-track-cue title="timed track cue">cue</a> is being rendered, even in
+  between applications of the <a href=#websrt-cue-text-rendering-rules>WebSRT cue text rendering
+  rules</a> (which are only run when the set of active cues
+  changes). User agents that support these pseudo-elements must
+  dynamically update renderings accordingly.</p>
+
+  <!-- XXX
+
    rules for rendering the list of active cues:
     - for each segment, decide if it's before or after the current
       playback position.
@@ -79674,11 +79739,19 @@
    propagate towards the end of the segment so that it reaches the end
    of the segment when the next segment becomes "before".
 
-  --><h5 id=css-extensions><span class=secno>12.3.2.2 </span>CSS extensions</h5>
+   properties that only apply to the cue as a whole, and i, b, ruby, rt:
+    - font
+    - line-height
+    - anything else that affects the size of CSS boxes but not their kind or their position independant of their size
 
-  <p class=note>This section is intended to be moved to a CSS
-  specification once an editor is found to run with it.</p>
+   properties that apply to the above as well as 'before' and 'after' parts:
+    - color
+    - background
+    - outline
+    - anything else that doesn't affect the size or position or kind of CSS boxes
 
+  -->
+
   <p class=XXX>...</p>
 
   </div>

Modified: source
===================================================================
--- source	2010-07-09 19:29:58 UTC (rev 5147)
+++ source	2010-07-09 22:43:28 UTC (rev 5148)
@@ -28513,7 +28513,12 @@
 
    <dt>The <dfn title="timed track cue display state">display state</dfn>
    <dd>
-    <p>This is used as part of the rendering model.</p>
+
+    <p>This is used as part of the rendering model, to keep cues in a
+    consistent position. It must initially be empty. Whenever the
+    <span>timed track cue active flag</span> is unset, the user agent
+    must empty the <span>timed track cue display state</span>.</p>
+
    </dd>
 
   </dl>
@@ -98553,18 +98558,6 @@
    of cues</span> that have their <span>timed track cue active
    flag</span> set.</p></li>
 
-   <li>
-
-    <p>Sort <var title="">cues</var> in <span>timed track cue
-    order</span>.</p>
-
-    <p class="note">If the tracks and cues in the previous steps were
-    added to the lists in the same order as the lists from which they
-    were sourced, the <var title="">cues</var> list will already be in
-    <span>timed track cue order</span>.</p>
-
-   </li>
-
    <li><p>For each <span>timed track cue</span> <var
    title="">cue</var> in <var title="">cues</var>: if <var
    title="">cue</var>'s <span>timed track cue display state</span> has
@@ -98574,19 +98567,95 @@
 
    <li>
 
-    <p class="XXX">...</p>
+    <p>For each <span>timed track cue</span> <var title="">cue</var>
+    in <var title="">cues</var> that remains, in <span>timed track cue
+    order</span>, run the following substeps:</p>
 
-  <!--XXX
-      for each cue in cues:
-       - find default position per http://damowmow.com/temp/srtspec
-       - shunt it around to fit the current active ones
-       - add it to the list
-  -->
+    <ol>
 
+     <li><p>Let <var title="">nodes</var> be the <span>list of WebSRT
+     Node Objects</span> obtained by applying the <span>WebSRT cue
+     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><p class="XXX">establish direction (ltr vs rtl)</p></li>
+
+     <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)
+-->
+
+     <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>
+
+<!--
+ * If D=horizontal:
+     Let H = the height of the first line box of /lines/
+     If A=start and 'direction' is 'ltr':
+     If A=end and 'direction' is 'rtl':
+       Let X = min(T * VW, VW - width of /container/)
+     If A=end and 'direction' is 'ltr':
+     If A=start and 'direction' is 'rtl':
+       Let X = min(T * VW - width of /container/, 0)
+     If A=middle and T <= 50%:
+       Let X = max(T * VW - (width of /container/)/2, 0)
+     If A=middle and T > 50%:
+       Let X = min(T * VW + (width of /container/)/2, VW) - (width of /container/)
+   If D=vertical:
+     Let H = the width of the first line box of /lines/
+     If A=start:
+       Let Y = min(T * VH, VH - height of /container/)
+     If A=end:
+       Let Y = min(T * VH - height of /container/, 0)
+     If A=middle and T <= 50%:
+       Let Y = max(T * VH - (height of /container/)/2, 0)
+     If A=middle and T > 50%:
+       Let Y = min(T * VH + (height of /container/)/2, VH) - (height of /container/)
+-->
+
+     <li><p class="XXX">if not snap-to-lines: position the box according to the given position information, and then spiral around clockwise until no overlap is found</p></li>
+
+     <li><p class="XXX">otherwise: position the block in the inline direction; then determine the block-direction position of the first line, then slide the line away from the reference edge until it fits, or if that goes off the edge slide it in the other direction; sliding must snap to multiples of the height of the first line box.</p></li>
+
+     <li><p class="XXX">from the resulting position, remove any lines that don't completely render on the video</p></li>
+
+     <li><p class="XXX">add the boxes to the output</p></li>
+
+     <li><p class="XXX">save the boxes to the <span>timed track cue display state</span></p></li>
+
+    </ol>
+
    </li>
 
   </ol>
 
+  <h5>CSS extensions</h5>
+
+  <p class="note">This section is intended to be moved to a CSS
+  specification once an editor is found to run with it.</p>
+
+  <p>When a user agent is rendering one or more <span title="timed
+  track cue">timed track cues</span> according to the <span>WebSRT cue
+  text rendering rules</span>, <span title="WebSRT Node Object">WebSRT
+  Node Objects</span> in the <span>list of WebSRT Node Objects</span>
+  used in the rendering can be matched by certain pseudo-selectors as
+  defined below. These selector can begin or stop matching individual
+  <span title="WebSRT Node Object">WebSRT Node Objects</span> while a
+  <span title="timed track cue">cue</span> is being rendered, even in
+  between applications of the <span>WebSRT cue text rendering
+  rules</span> (which are only run when the set of active cues
+  changes). User agents that support these pseudo-elements must
+  dynamically update renderings accordingly.</p>
+
   <!-- XXX
 
    rules for rendering the list of active cues:
@@ -98601,12 +98670,18 @@
    propagate towards the end of the segment so that it reaches the end
    of the segment when the next segment becomes "before".
 
-  -->
+   properties that only apply to the cue as a whole, and i, b, ruby, rt:
+    - font
+    - line-height
+    - anything else that affects the size of CSS boxes but not their kind or their position independant of their size
 
-  <h5>CSS extensions</h5>
+   properties that apply to the above as well as 'before' and 'after' parts:
+    - color
+    - background
+    - outline
+    - anything else that doesn't affect the size or position or kind of CSS boxes
 
-  <p class="note">This section is intended to be moved to a CSS
-  specification once an editor is found to run with it.</p>
+  -->
 
   <p class="XXX">...</p>
 




More information about the Commit-Watchers mailing list