Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some introductory paragraphs to the Data model section. #409

Merged
merged 12 commits into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ To generate a WD snapshot, run e.g.:
$ ./snapshot.sh WD 2016-01-01 2015-12-08

Also see https://github.com/w3c/webvtt/commit/754f13e3cf03d6036c3e4628c6920d17b412f778 for manual fixup of the generated output.

To format the index.bs file, run:

$ ./format.py index.bs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it has nothing to do with #383, but whatever, no big deal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's just for future editors - had to come in somewhere. ;-)

27 changes: 27 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,18 @@ precomposed character).</p>
<h2 id=data-model>Data model</h2>
<!-- Describe metadata, caption/subtitle, chapter & description cues -->

<p class=note>The box model of WebVTT consists of three key elements: the video viewport, cues, and
regions. The video viewport is the rendering area into which cues and regions are rendered. Cues are
boxes consisting of a set of cue lines. Regions are subareas of the video viewport that are used to
group cues together. Cues are positioned either inside the video viewport directly or inside a
region, which is positioned inside the video viewport.</p>

<p class=note>The position of a cue inside the video viewport is defined by a set of cue settings.
The position of a region inside the video viewport is defined by a set of region settings. Cues that
are inside regions can only use a limited set of their cue settings. Specifically, if the cue has a
"vertical", "line" or "size" setting, the cue drops out of the region. Otherwise, the cue's width is
calculated to be relative to the region width rather than the viewport. </p>

<h3 id=model-overview>Overview</h3>

<p><i>This section is non-normative.</i></p>
Expand Down Expand Up @@ -1324,6 +1336,10 @@ together, which is particularly important when scrolling up.</p>
<dd>
<p>A number giving the number of lines of the box within which the text of each line of the
containing cues is to be rendered. Defaults to 3.</p>

<p class="note">Since a WebVTT region defines a fixed rendering area, a cue that has more lines
than the region allows will be clipped. For scrolling regions, the clipping happens at the top,
for non-scrolling regions it happens at the bottom.</p>
</dd>

<dt><dfn lt="WebVTT region anchor">A region anchor point</dfn></dt>
Expand Down Expand Up @@ -2988,6 +3004,10 @@ run the following steps:</p>
"<code>lr</code>", then let |cue|'s <a>WebVTT cue writing direction</a> be <a lt="WebVTT cue
vertical growing right writing direction">vertical growing right</a>.</p></li>

<li><p>If |cue|'s <a>WebVTT cue writing direction</a> is not <a lt="WebVTT cue horizontal
writing direction">horizontal</a>, let |cue|'s <a>WebVTT cue region</a> be null (there are no
vertical regions).</p></li>

</ol>

</dd>
Expand Down Expand Up @@ -3063,6 +3083,10 @@ run the following steps:</p>
<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 |cue|'s <a>WebVTT cue line</a> is not <a lt="WebVTT cue line automatic">auto</a>,
let |cue|'s <a>WebVTT cue region</a> be null (the cue has been explicitly positioned with a
line offset and thus drops out of the region).</p></li>

</ol>

</dd>
Expand Down Expand Up @@ -3117,6 +3141,9 @@ run the following steps:</p>

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

<li><p>If |cue|'s <a>WebVTT cue size</a> is not 100, let |cue|'s <a>WebVTT cue region</a> be
null (the cue has been explicitly sized and thus drops out of the region).</p></li>

</ol>

</dd>
Expand Down
Loading