Skip to content

Commit

Permalink
[giow] (0) Captions - Stage 11.2: minor fixes and steps towards compl…
Browse files Browse the repository at this point in the history
…etion

git-svn-id: http://svn.whatwg.org/webapps@5110 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 24, 2010
1 parent 8a1a5c2 commit 2360b08
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 95 deletions.
151 changes: 120 additions & 31 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -26098,17 +26098,27 @@ <h6 id=timed-track-model><span class=secno>4.8.10.10.1 </span>Timed track model<
timed track</a> can change dynamically, either because the
<a href=#timed-track>timed track</a> has <a href=#timed-track-not-loaded title="timed track not
loaded">not yet been loaded</a> or is still <a href=#timed-track-loading title="timed
track loading">loading</a>, or in the case of a <a href=#timed-track>timed
track</a> corresponding to a <code><a href=#mutabletimedtrack>MutableTimedTrack</a></code>
object, where individual cues can be added or removed
dynamically using the API.</p>
track loading">loading</a>, or because the the <a href=#timed-track>timed
track</a> corresponds to a <code><a href=#mutabletimedtrack>MutableTimedTrack</a></code>
object, whose API allows individual cues can be added or removed
dynamically.</p>

</dd>

</dl><p>Each <a href=#timed-track>timed track</a> has a corresponding
<code><a href=#timedtrack>TimedTrack</a></code> object.</p>

<p>A <dfn id=timed-track-cue>timed track cue</dfn> is the unit of time-sensitive data
<p>The <a href=#timed-track title="timed track">timed tracks</a> of a
<a href=#media-element>media element</a> are <dfn id=the-timed-tracks-are-ready title="the timed tracks are
ready">ready</dfn> if all the <a href=#timed-track title="timed track">timed
tracks</a> whose <a href=#timed-track-mode title="timed track mode">mode</a> was
not in the <a href=#timed-track-disabled title="timed track disabled">disabled</a> state
when the element's <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
algorithm</a> last started now have a <a href=#timed-track-readiness-state>timed track readiness
state</a> of <a href=#timed-track-loaded title="timed track loaded">loaded</a> or
<a href=#timed-track-failed-to-load title="timed track failed to load">failed to load</a>.</p>

<hr><p>A <dfn id=timed-track-cue>timed track cue</dfn> is the unit of time-sensitive data
in a <a href=#timed-track>timed track</a>, corresponding for instance for
subtitles and captions to the text that appears at a particular time
and disappears at another time.</p>
Expand Down Expand Up @@ -26152,6 +26162,22 @@ <h6 id=timed-track-model><span class=secno>4.8.10.10.1 </span>Timed track model<
line extends vertically and is positioned horizontally, with
consecutive lines displayed to the left of each other<!-- used for
mongolian -->).</p>

<p>If the <a href=#timed-track-cue-writing-direction title="timed track cue writing direction">writing
direction</a> is <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue horizontal
writing direction">horizontal</a>, then <a href=#timed-track-cue-line-position title="timed
track cue line position">line position</a> percentages are
relative to the height of the video, and <a href=#timed-track-cue-text-position title="timed track
cue text position">text position</a> and <a href=#timed-track-cue-size title="timed
track cue size">size</a> percentages are relative to the width
of the video.</p>

<p>Otherwise, <a href=#timed-track-cue-line-position title="timed track cue line position">line
position</a> percentages are relative to the width of the
video, and <a href=#timed-track-cue-text-position title="timed track cue text position">text
position</a> and <a href=#timed-track-cue-size title="timed track cue size">size</a>
percentages are relative to the height of the video.</p>

</dd>

<dt><dfn id=timed-track-cue-snap-to-lines-flag title="timed track cue snap-to-lines flag">A snap-to-lines flag</dfn>
Expand Down Expand Up @@ -26219,16 +26245,6 @@ <h6 id=timed-track-model><span class=secno>4.8.10.10.1 </span>Timed track model<
cue</a> is associated with a particular <a href=#timed-track>timed track</a>,
the association is permanent.</p>

<p>The <a href=#timed-track title="timed track">timed tracks</a> of a
<a href=#media-element>media element</a> are <dfn id=the-timed-tracks-are-ready title="the timed tracks are
ready">ready</dfn> if all the <a href=#timed-track title="timed track">timed
tracks</a> whose <a href=#timed-track-mode title="timed track mode">mode</a> was
not in the <a href=#timed-track-disabled title="timed track disabled">disabled</a> state
when the element's <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
algorithm</a> last started now have a <a href=#timed-track-readiness-state>timed track readiness
state</a> of <a href=#timed-track-loaded title="timed track loaded">loaded</a> or
<a href=#timed-track-failed-to-load title="timed track failed to load">failed to load</a>.</p>


<h6 id=sourcing-in-band-timed-tracks><span class=secno>4.8.10.10.2 </span>Sourcing in-band timed tracks</h6>

Expand Down Expand Up @@ -26306,8 +26322,9 @@ <h6 id=sourcing-in-band-timed-tracks><span class=secno>4.8.10.10.2 </span>Sourci
<h6 id=sourcing-out-of-band-timed-tracks><span class=secno>4.8.10.10.3 </span>Sourcing out-of-band timed tracks</h6>

<p>When a <code><a href=#the-track-element>track</a></code> element is created, it must be
associated with a new <a href=#timed-track>timed track</a> and its corresponding
new <code><a href=#timedtrack>TimedTrack</a></code> object.</p>
associated with a new <a href=#timed-track>timed track</a> (with its value set
as defined below) and its corresponding new <code><a href=#timedtrack>TimedTrack</a></code>
object.</p>

<p>The <a href=#timed-track-kind>timed track kind</a> is determined from the state of
the element's <code title=attr-track-kind><a href=#attr-track-kind>kind</a></code> attribute
Expand Down Expand Up @@ -26341,25 +26358,68 @@ <h6 id=sourcing-out-of-band-timed-tracks><span class=secno>4.8.10.10.3 </span>So
<p class=note>Changes to the <a href=#track-url>track URL</a> are handled in
the algorithm below.</p>

<p class=XXX>...cues...</p>
<p>The <a href=#timed-track-list-of-cues>timed track list of cues</a> is initially empty. It
is dynamically modified when the referenced file is parsed.</p>

<p>When a <code><a href=#the-track-element>track</a></code> element's parent element changes and
the new parent is a <a href=#media-element>media element</a>, then add the
<code><a href=#the-track-element>track</a></code> element's corresponding <a href=#timed-track>timed track</a>
to the <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of timed
the new parent is a <a href=#media-element>media element</a>, then the user agent
must add the <code><a href=#the-track-element>track</a></code> element's corresponding <a href=#timed-track>timed
track</a> to the <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of timed
tracks</a>.</p>

<p>When a <code><a href=#the-track-element>track</a></code> element's parent element changes and
the old parent was a <a href=#media-element>media element</a>, then remove the
<code><a href=#the-track-element>track</a></code> element's corresponding <a href=#timed-track>timed track</a>
from the <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of timed
tracks</a>.</p>
the old parent was a <a href=#media-element>media element</a>, then the user agent
must remove the <code><a href=#the-track-element>track</a></code> element's corresponding
<a href=#timed-track>timed track</a> from the <a href=#media-element>media element</a>'s
<a href=#list-of-timed-tracks>list of timed tracks</a>.</p>

<p>When a <a href=#timed-track>timed track</a> corresponding to a
<code><a href=#the-track-element>track</a></code> element is added to a <a href=#media-element>media
element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a>, <span class=XXX>update the mode appropriately</span>.</p>
element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a>, the user agent
must set the <a href=#timed-track-mode>timed track mode</a> appropriately, as
determined by the following conditions:</p>

<dl class=switch><dt>If the <a href=#timed-track-kind>timed track kind</a> is <code title=dom-TimedTrack-kind-subtitles><a href=#dom-timedtrack-kind-subtitles>subtitles</a></code> or <code title=dom-TimedTrack-kind-captions><a href=#dom-timedtrack-kind-captions>captions</a></code> and the user
has indicated an interest in having a track with this <a href=#timed-track-kind>timed
track kind</a>, <a href=#timed-track-language>timed track language</a>, and
<a href=#timed-track-label>timed track label</a> enabled, and there is no other
<a href=#timed-track>timed track</a> in the <a href=#media-element>media element</a>'s
<a href=#list-of-timed-tracks>list of timed tracks</a> with a <a href=#timed-track-kind>timed track
kind</a> of either <code title=dom-TimedTrack-kind-subtitles><a href=#dom-timedtrack-kind-subtitles>subtitles</a></code> or <code title=dom-TimedTrack-kind-captions><a href=#dom-timedtrack-kind-captions>captions</a></code> whose
<a href=#timed-track-mode>timed track mode</a> is <a href=#timed-track-showing title="timed track
showing">showing</a></dt>

<dt>If the <a href=#timed-track-kind>timed track kind</a> is <code title=dom-TimedTrack-kind-descriptions><a href=#dom-timedtrack-kind-descriptions>descriptions</a></code> and
the user has indicated an interest in having text descriptions with
this <a href=#timed-track-language>timed track language</a> and <a href=#timed-track-label>timed track
label</a> enabled, and there is no other <a href=#timed-track>timed
track</a> in the <a href=#media-element>media element</a>'s <a href=#list-of-timed-tracks>list of
timed tracks</a> with a <a href=#timed-track-kind>timed track kind</a> of <code title=dom-TimedTrack-kind-descriptions><a href=#dom-timedtrack-kind-descriptions>descriptions</a></code> whose
<a href=#timed-track-mode>timed track mode</a> is <a href=#timed-track-showing title="timed track
showing">showing</a></dt>

<dt>If the <a href=#timed-track-kind>timed track kind</a> is <code title=dom-TimedTrack-kind-chapters><a href=#dom-timedtrack-kind-chapters>chapters</a></code> and the
<a href=#timed-track-language>timed track language</a> is one that the user agent has
reason to believe is appropriate for the user, and there is no
other <a href=#timed-track>timed track</a> in the <a href=#media-element>media element</a>'s
<a href=#list-of-timed-tracks>list of timed tracks</a> with a <a href=#timed-track-kind>timed track
kind</a> of <code title=dom-TimedTrack-kind-chapters><a href=#dom-timedtrack-kind-chapters>chapters</a></code> whose
<a href=#timed-track-mode>timed track mode</a> is <a href=#timed-track-showing title="timed track
showing">showing</a></dt>

<dd>
<p>Let the <a href=#timed-track-mode>timed track mode</a> be <a href=#timed-track-showing title="timed
track showing">showing</a>.</p>
</dd>

<p>When a <a href=#timed-track>timed track</a> corresponding to a
<dt>Otherwise</dt>

<dd>
<p>Let the <a href=#timed-track-mode>timed track mode</a> be <a href=#timed-track-disabled title="timed
track disabled">disabled</a>.</p>
</dd>

</dl><p>When a <a href=#timed-track>timed track</a> corresponding to a
<code><a href=#the-track-element>track</a></code> element is created with <a href=#timed-track-mode>timed track
mode</a> set to <a href=#timed-track-hidden title="timed track hidden">hidden</a> or
<a href=#timed-track-showing title="timed track showing">showing</a>, and when a
Expand All @@ -26368,8 +26428,11 @@ <h6 id=sourcing-out-of-band-timed-tracks><span class=secno>4.8.10.10.3 </span>So
changes its <a href=#timed-track-mode>timed track mode</a> to <a href=#timed-track-hidden title="timed
track hidden">hidden</a> or <a href=#timed-track-showing title="timed track
showing">showing</a> for the first time, the user agent must
immediately and synchronously run the
following steps:</p>
immediately and synchronously run the following algorithm. This
algorithm interacts closely with the <a href=#event-loop>event loop</a>
mechanism; in particular, it has a <a href=#synchronous-section>synchronous section</a>
(which is triggered as part of the <a href=#event-loop>event loop</a>
algorithm). The step in that section is marked with &#8987;.</p>

<ol><li><p>Set the <a href=#timed-track-readiness-state>timed track readiness state</a> to <a href=#timed-track-loading title="timed track loading">loading</a>.</li>

Expand All @@ -26392,9 +26455,17 @@ <h6 id=sourcing-out-of-band-timed-tracks><span class=secno>4.8.10.10.3 </span>So
<p>The <a href=#concept-task title=concept-task>tasks</a> <a href=#queue-a-task title="queue
a task">queued</a> by the <a href=#fetch title=fetch>fetching
algorithm</a> on the <a href=#networking-task-source>networking task source</a> to
process the data as it is being fetched must <span class=XXX>...this is where cross-origin checks go</span>.</p>
process the data as it is being fetched must run the following
steps:</p>

<ol><li><p><span class=XXX>...this is where cross-origin checks
go...</span></li>

<li><p class=XXX>determine format...</li>

<p>If the <a href=#fetch title=fetch>fetching algorithm</a> fails for
<li><p class=XXX>hand off to appropriate parser...</li>

</ol><p>If the <a href=#fetch title=fetch>fetching algorithm</a> fails for
any reason (network error, the server returns an error code, the
cross-origin checks mentioned above fail, etc), or if <var title="">URL</var> is the empty string, then <a href=#queue-a-task>queue a
task</a> to first change the <a href=#timed-track-readiness-state>timed track readiness state</a>
Expand Down Expand Up @@ -26448,6 +26519,24 @@ <h6 id=sourcing-out-of-band-timed-tracks><span class=secno>4.8.10.10.3 </span>So
hidden">hidden</a> or <a href=#timed-track-showing title="timed track
showing">showing</a>.</li>

<li><p>Wait until the <a href=#timed-track-readiness-state>timed track readiness state</a> is
no longer set to <a href=#timed-track-loading title="timed track
loading">loading</a>.</li>

<li><p><a href=#await-a-stable-state>Await a stable state</a>. The <a href=#synchronous-section>synchronous
section</a> consists of the following step. (The step in the
<a href=#synchronous-section>synchronous section</a> is marked with &#8987;.)</li>

<li><p>&#8987; Set the <a href=#timed-track-readiness-state>timed track readiness state</a> to
<a href=#timed-track-loading title="timed track loading">loading</a>.</li>

<!-- if you add more, change the grammar of the sentences above to
be plural with respect to the number of synchronous steps (both in
the step above and in the intro to the whole algorithm) -->

<li><p>End the <a href=#synchronous-section>synchronous section</a>, continuing the
remaining steps asynchronously.</li>

<li><p>Jump to the step labeled <i>download</i>.</li>

</ol></div>
Expand Down
Loading

0 comments on commit 2360b08

Please sign in to comment.