Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (0) Fire addtrack events whenver a track is added to a media e…
…lement.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=13358

git-svn-id: http://svn.whatwg.org/webapps@6609 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 30, 2011
1 parent 141309a commit 5cb5546
Show file tree
Hide file tree
Showing 3 changed files with 237 additions and 10 deletions.
75 changes: 72 additions & 3 deletions complete.html
Expand Up @@ -27393,6 +27393,48 @@ <h5 id=loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the
wrong type) -->


<dt id=found-another-audio-track>If the <a href=#media-resource>media
resource</a> is found to have an audio track</dt>

<dd>

<ol><li><p>Create a <code><a href=#audiotrack>AudioTrack</a></code> object to represent the
audio track.</li>

<li><p>Update the <a href=#media-element>media element</a>'s <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> attribute's
<code><a href=#audiotracklist>AudioTrackList</a></code> object with the new
<code><a href=#audiotrack>AudioTrack</a></code> object.</li>

<li><p>Fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and
is not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized
to the new <code><a href=#audiotrack>AudioTrack</a></code> object, at this
<code><a href=#audiotracklist>AudioTrackList</a></code> object.</li>

</ol></dd>


<dt id=found-another-video-track>If the <a href=#media-resource>media
resource</a> is found to have a video track</dt>

<dd>

<ol><li><p>Create a <code><a href=#videotrack>VideoTrack</a></code> object to represent the
video track.</li>

<li><p>Update the <a href=#media-element>media element</a>'s <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute's
<code><a href=#videotracklist>VideoTrackList</a></code> object with the new
<code><a href=#videotrack>VideoTrack</a></code> object.</li>

<li><p>Fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and
is not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized
to the new <code><a href=#videotrack>VideoTrack</a></code> object, at this
<code><a href=#videotracklist>VideoTrackList</a></code> object.</li>

</ol></dd>


<dt id=getting-media-metadata>Once enough of the <a href=#media-data>media
data</a> has been fetched to determine the duration of the
<a href=#media-resource>media resource</a>, its dimensions, and other metadata,
Expand Down Expand Up @@ -30860,7 +30902,9 @@ <h6 id=sourcing-in-band-text-tracks><span class=secno>4.8.10.12.2 </span>Sourcin
agent recognises and supports as being equivalent to a <a href=#text-track>text
track</a>, the user agent <a href=#found-a-media-resource-specific-timed-track>runs</a> the
<dfn id=steps-to-expose-a-media-resource-specific-text-track>steps to expose a media-resource-specific text track</dfn>
with the relevant data, as follows:</p>
with the relevant data, as follows.</p>

<!-- this runs synchronously from a fetch task -->

<ol><li><p>Associate the relevant data with a new <a href=#text-track>text
track</a> and its corresponding new <code><a href=#texttrack>TextTrack</a></code>
Expand Down Expand Up @@ -30908,6 +30952,14 @@ <h6 id=sourcing-in-band-text-tracks><span class=secno>4.8.10.12.2 </span>Sourcin
<li><p>Add the new <a href=#text-track>text track</a> to the <a href=#media-element>media
element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>.</li>

<li><p>Fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and is
not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code>
attribute initialized to the <a href=#text-track>text track</a>'s
<code><a href=#texttrack>TextTrack</a></code> object, at the <a href=#media-element>media element</a>'s
<code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</li>

</ol><p>When a <a href=#media-element>media element</a> is to <dfn id="forget-the-media-element's-media-resource-specific-text-tracks">forget the media
element's media-resource-specific text tracks</dfn>, the user
agent must remove from the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list
Expand Down Expand Up @@ -30970,13 +31022,19 @@ <h6 id=sourcing-out-of-band-text-tracks><span class=secno>4.8.10.12.3 </span>Sou
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=#text-track>text
track</a> to the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text
tracks</a>.</p>
tracks</a>, and then <a href=#queue-a-task>queue a task</a> to fire an event
with the name <code title=event-addtrack>addtrack</code>, that
does not bubble and is not cancelable, and that uses the
<code><a href=#trackevent>TrackEvent</a></code> interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized to
the <a href=#text-track>text track</a>'s <code><a href=#texttrack>TextTrack</a></code> object, at the
<a href=#media-element>media element</a>'s <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</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 the user agent
must remove the <code><a href=#the-track-element>track</a></code> element's corresponding
<a href=#text-track>text track</a> from the <a href=#media-element>media element</a>'s
<a href=#list-of-text-tracks>list of text tracks</a>.</p>
<a href=#list-of-text-tracks>list of text tracks</a>.</p> <!-- removetrack -->

<p>When a <a href=#text-track>text track</a> corresponding to a
<code><a href=#the-track-element>track</a></code> element is added to a <a href=#media-element>media
Expand Down Expand Up @@ -31636,6 +31694,17 @@ <h6 id=text-track-api><span class=secno>4.8.10.12.5 </span>Text track API</h6>

</li>

<li>

<p><a href=#queue-a-task>Queue a task</a> to fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and
is not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized to
the new <a href=#text-track>text track</a>'s <code><a href=#mutabletexttrack>MutableTextTrack</a></code>
object, at the <a href=#media-element>media element</a>'s <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</p>

</li>

<li>

<p>Return the new <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object.</p>
Expand Down
77 changes: 73 additions & 4 deletions index
Expand Up @@ -27260,6 +27260,48 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
wrong type) -->


<dt id=found-another-audio-track>If the <a href=#media-resource>media
resource</a> is found to have an audio track</dt>

<dd>

<ol><li><p>Create a <code><a href=#audiotrack>AudioTrack</a></code> object to represent the
audio track.</li>

<li><p>Update the <a href=#media-element>media element</a>'s <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code> attribute's
<code><a href=#audiotracklist>AudioTrackList</a></code> object with the new
<code><a href=#audiotrack>AudioTrack</a></code> object.</li>

<li><p>Fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and
is not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized
to the new <code><a href=#audiotrack>AudioTrack</a></code> object, at this
<code><a href=#audiotracklist>AudioTrackList</a></code> object.</li>

</ol></dd>


<dt id=found-another-video-track>If the <a href=#media-resource>media
resource</a> is found to have a video track</dt>

<dd>

<ol><li><p>Create a <code><a href=#videotrack>VideoTrack</a></code> object to represent the
video track.</li>

<li><p>Update the <a href=#media-element>media element</a>'s <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute's
<code><a href=#videotracklist>VideoTrackList</a></code> object with the new
<code><a href=#videotrack>VideoTrack</a></code> object.</li>

<li><p>Fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and
is not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized
to the new <code><a href=#videotrack>VideoTrack</a></code> object, at this
<code><a href=#videotracklist>VideoTrackList</a></code> object.</li>

</ol></dd>


<dt id=getting-media-metadata>Once enough of the <a href=#media-data>media
data</a> has been fetched to determine the duration of the
<a href=#media-resource>media resource</a>, its dimensions, and other metadata,
Expand Down Expand Up @@ -30727,7 +30769,9 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
agent recognises and supports as being equivalent to a <a href=#text-track>text
track</a>, the user agent <a href=#found-a-media-resource-specific-timed-track>runs</a> the
<dfn id=steps-to-expose-a-media-resource-specific-text-track>steps to expose a media-resource-specific text track</dfn>
with the relevant data, as follows:</p>
with the relevant data, as follows.</p>

<!-- this runs synchronously from a fetch task -->

<ol><li><p>Associate the relevant data with a new <a href=#text-track>text
track</a> and its corresponding new <code><a href=#texttrack>TextTrack</a></code>
Expand Down Expand Up @@ -30775,6 +30819,14 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
<li><p>Add the new <a href=#text-track>text track</a> to the <a href=#media-element>media
element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>.</li>

<li><p>Fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and is
not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code>
attribute initialized to the <a href=#text-track>text track</a>'s
<code><a href=#texttrack>TextTrack</a></code> object, at the <a href=#media-element>media element</a>'s
<code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</li>

</ol><p>When a <a href=#media-element>media element</a> is to <dfn id="forget-the-media-element's-media-resource-specific-text-tracks">forget the media
element's media-resource-specific text tracks</dfn>, the user
agent must remove from the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list
Expand Down Expand Up @@ -30837,13 +30889,19 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
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=#text-track>text
track</a> to the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text
tracks</a>.</p>
tracks</a>, and then <a href=#queue-a-task>queue a task</a> to fire an event
with the name <code title=event-addtrack>addtrack</code>, that
does not bubble and is not cancelable, and that uses the
<code><a href=#trackevent>TrackEvent</a></code> interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized to
the <a href=#text-track>text track</a>'s <code><a href=#texttrack>TextTrack</a></code> object, at the
<a href=#media-element>media element</a>'s <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</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 the user agent
must remove the <code><a href=#the-track-element>track</a></code> element's corresponding
<a href=#text-track>text track</a> from the <a href=#media-element>media element</a>'s
<a href=#list-of-text-tracks>list of text tracks</a>.</p>
<a href=#list-of-text-tracks>list of text tracks</a>.</p> <!-- removetrack -->

<p>When a <a href=#text-track>text track</a> corresponding to a
<code><a href=#the-track-element>track</a></code> element is added to a <a href=#media-element>media
Expand Down Expand Up @@ -31503,6 +31561,17 @@ interface <dfn id=mediacontroller>MediaController</dfn> {

</li>

<li>

<p><a href=#queue-a-task>Queue a task</a> to fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and
is not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized to
the new <a href=#text-track>text track</a>'s <code><a href=#mutabletexttrack>MutableTextTrack</a></code>
object, at the <a href=#media-element>media element</a>'s <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</p>

</li>

<li>

<p>Return the new <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object.</p>
Expand Down Expand Up @@ -37019,7 +37088,7 @@ hairline width with transform. ack Shaun Morris.

<!-- this is filler to make sure the TCP packet boundary doesn't fall in the middle of one of the NCRs below -->
<!-- (because otherwise the parser in anolis screws it up) -->
<p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like &#2310; are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like &Aacute;, " height=300 src=http://images.whatwg.org/baselines.png width=738>x00FF;, f, and &Omega; are anchored, the ideographic baseline is where glyphs like &#31169; and &#36948; are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square."&gt;</p>
<p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like &#2310; are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like &Aacute;, &yuml;, f, and &Omega; are anchored, the ideographic baseline is where glyphs like &#31169; and &#36948; are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square." height=300 src=http://images.whatwg.org/baselines.png width=738></p>

<p>The keywords map to these alignment points as follows:</p>

Expand Down

0 comments on commit 5cb5546

Please sign in to comment.