Skip to content

Commit

Permalink
[giow] (1) Step two: Make snap-to-line cues not overlap the overscan …
Browse files Browse the repository at this point in the history
…area in the direction of the text (i.e. horizontally for english captions).

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=16864
Affected topics: Video Text Tracks

git-svn-id: http://svn.whatwg.org/webapps@7447 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 9, 2012
1 parent 19eadad commit 3eb9617
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
6 changes: 6 additions & 0 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -33979,11 +33979,17 @@ <h6 id=text-track-model><span class=secno>4.8.10.12.1 </span>Text track model</h

<dt><dfn id=text-track-cue-snap-to-lines-flag title="text track cue snap-to-lines flag">A snap-to-lines flag</dfn>
<dd>

<p>A boolean indicating whether the <a href=#text-track-cue-line-position title="text track cue
line position">line's position</a> is a line position
(positioned to a multiple of the line dimensions of the first line
of the cue), or whether it is a percentage of the dimension of the
video.</p>

<p>Cues whose <a href=#text-track-cue-snap-to-lines-flag>text track cue snap-to-lines flag</a> is set will be placed within the
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>

</dd>

<dt><dfn id=text-track-cue-line-position title="text track cue line position">A line position</dfn>
Expand Down
6 changes: 6 additions & 0 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -33979,11 +33979,17 @@ interface <dfn id=mediacontroller>MediaController</dfn> : <a href=#eventtarget>E

<dt><dfn id=text-track-cue-snap-to-lines-flag title="text track cue snap-to-lines flag">A snap-to-lines flag</dfn>
<dd>

<p>A boolean indicating whether the <a href=#text-track-cue-line-position title="text track cue
line position">line's position</a> is a line position
(positioned to a multiple of the line dimensions of the first line
of the cue), or whether it is a percentage of the dimension of the
video.</p>

<p>Cues whose <a href=#text-track-cue-snap-to-lines-flag>text track cue snap-to-lines flag</a> is set will be placed within the
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>

</dd>

<dt><dfn id=text-track-cue-line-position title="text track cue line position">A line position</dfn>
Expand Down
80 changes: 80 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -37234,11 +37234,17 @@ interface <dfn>MediaController</dfn> : <span>EventTarget</span> {

<dt><dfn title="text track cue snap-to-lines flag">A snap-to-lines flag</dfn>
<dd>

<p>A boolean indicating whether the <span title="text track cue
line position">line's position</span> is a line position
(positioned to a multiple of the line dimensions of the first line
of the cue), or whether it is a percentage of the dimension of the
video.</p>

<p>Cues whose <span>text track cue snap-to-lines flag</span> is set will be placed within the
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>

</dd>

<dt><dfn title="text track cue line position">A line position</dfn>
Expand Down Expand Up @@ -114313,6 +114319,80 @@ iframe[seamless] { display: block; }

</li>

<li>

<p>If the <span>text track cue snap-to-lines flag</span> is set, then run the appropriate
steps from the following list:</p>

<dl class="switch">

<dt>If the <span>text track cue writing direction</span> is <span title="text track cue horizontal writing direction">horizontal</span></dt>
<dd>

<ol>

<li><p>Let <var title="">edge margin</var> be a user-agent-defined horizontal length,
expressed as a percentage of the width of the <var title="">video</var>'s rendering area,
which will be used to define a margin at the left and right edges of the video into which
this cue will not be placed. In situations with overscan, this margin should be sufficient
to place the cue within the title-safe area. In the absence of overscan, this value should
be picked for aesthetics (to avoid text being aligned precisely on the left or right edge
of the video, which can be ugly).</p></li>

<li><p>If <var title="">x-position</var> is less than <var title="">edge margin</var> and
the sum of <var title="">x-position</var> and <var title="">size</var> is more than <var
title="">edge margin</var>, then increase <var title="">x-position</var> by <var
title="">edge margin</var> and decrease <var title="">size</var> by the same
amount.</p></li>

<li><p>Let <var title="">right margin edge</var> be 100 minus <var title="">edge
margin</var>.</p></li>

<li><p>If <var title="">x-position</var> is less than <var title="">right margin
edge</var>, and the sum of <var title="">x-position</var> and <var title="">size</var> is
more than <var title="">right margin edge</var>, then decrease <var title="">size</var> by
<var title="">edge margin</var>.</p></li>

</ol>

</dd>

<dt>If the <span>text track cue writing direction</span> is <span title="text track cue vertical growing left writing direction">vertical growing left</span></dt>
<dt>If the <span>text track cue writing direction</span> is <span title="text track cue vertical growing right writing direction">vertical growing right</span></dt>
<dd>

<ol>

<li><p>Let <var title="">edge margin</var> be a user-agent-defined vertical length,
expressed as a percentage of the height of the <var title="">video</var>'s rendering area,
which will be used to define a margin at the top and bottom edges of the video into which
this cue will not be placed. In situations with overscan, this margin should be sufficient
to place the cue within the title-safe area. In the absence of overscan, this value should
be picked for aesthetics (to avoid text being aligned precisely on the top or bottom edge
of the video, which can be ugly).</p></li>

<li><p>If <var title="">y-position</var> is less than <var title="">edge margin</var> and
the sum of <var title="">y-position</var> and <var title="">size</var> is more than <var
title="">edge margin</var>, then increase <var title="">y-position</var> by <var
title="">edge margin</var> and decrease <var title="">size</var> by the same
amount.</p></li>

<li><p>Let <var title="">bottom margin edge</var> be 100 minus <var title="">edge
margin</var>.</p></li>

<li><p>If <var title="">y-position</var> is less than <var title="">bottom margin
edge</var>, and the sum of <var title="">y-position</var> and <var title="">size</var> is
more than <var title="">right margin edge</var>, then decrease <var title="">size</var> by
<var title="">edge margin</var>.</p></li>

</ol>

</dd>

</dl>

</li>

<li><p>Let <var title="">left</var> be '<var
title="">x-position</var>&#x2009;vw' and <var title="">top</var>
be '<var title="">y-position</var>&#x2009;vh'. (These again are
Expand Down

0 comments on commit 3eb9617

Please sign in to comment.