[html5] r6609 - [giow] (0) Fire addtrack events whenver a track is added to a media element. Fix [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Sep 30 16:55:13 PDT 2011


Author: ianh
Date: 2011-09-30 16:55:11 -0700 (Fri, 30 Sep 2011)
New Revision: 6609

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Fire addtrack events whenver a track is added to a media element.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=13358

Modified: complete.html
===================================================================
--- complete.html	2011-09-30 23:27:56 UTC (rev 6608)
+++ complete.html	2011-09-30 23:55:11 UTC (rev 6609)
@@ -27393,6 +27393,48 @@
      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,
@@ -30860,8 +30902,10 @@
   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>
    object. The <a href=#text-track>text track</a> is a
@@ -30908,6 +30952,14 @@
    <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
@@ -30970,13 +31022,19 @@
   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
@@ -31638,6 +31696,17 @@
 
    <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>
 
    </li>

Modified: index
===================================================================
--- index	2011-09-30 23:27:56 UTC (rev 6608)
+++ index	2011-09-30 23:55:11 UTC (rev 6609)
@@ -27260,6 +27260,48 @@
      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,
@@ -30727,8 +30769,10 @@
   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>
    object. The <a href=#text-track>text track</a> is a
@@ -30775,6 +30819,14 @@
    <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
@@ -30837,13 +30889,19 @@
   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
@@ -31505,6 +31563,17 @@
 
    <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>
 
    </li>
@@ -37019,7 +37088,7 @@
 
   <!-- 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 आ 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 Á, " height=300 src=http://images.whatwg.org/baselines.png width=738>x00FF;, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 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."></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 आ 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 Á, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 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>
 

Modified: source
===================================================================
--- source	2011-09-30 23:27:56 UTC (rev 6608)
+++ source	2011-09-30 23:55:11 UTC (rev 6609)
@@ -29601,6 +29601,62 @@
      wrong type) -->
 
 
+     <dt id="found-another-audio-track">If the <span>media
+     resource</span> is found to have an audio track</dt>
+
+     <dd>
+
+      <ol>
+
+       <li><p>Create a <code>AudioTrack</code> object to represent the
+       audio track.</p></li>
+
+       <li><p>Update the <span>media element</span>'s <code
+       title="dom-media-audioTracks">audioTracks</code> attribute's
+       <code>AudioTrackList</code> object with the new
+       <code>AudioTrack</code> object.</p></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>TrackEvent</code>
+       interface, with the <code
+       title="dom-TrackEvent-track">track</code> attribute initialized
+       to the new <code>AudioTrack</code> object, at this
+       <code>AudioTrackList</code> object.</p></li>
+
+      </ol>
+
+     </dd>
+
+
+     <dt id="found-another-video-track">If the <span>media
+     resource</span> is found to have a video track</dt>
+
+     <dd>
+
+      <ol>
+
+       <li><p>Create a <code>VideoTrack</code> object to represent the
+       video track.</p></li>
+
+       <li><p>Update the <span>media element</span>'s <code
+       title="dom-media-videoTracks">videoTracks</code> attribute's
+       <code>VideoTrackList</code> object with the new
+       <code>VideoTrack</code> object.</p></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>TrackEvent</code>
+       interface, with the <code
+       title="dom-TrackEvent-track">track</code> attribute initialized
+       to the new <code>VideoTrack</code> object, at this
+       <code>VideoTrackList</code> object.</p></li>
+
+      </ol>
+
+     </dd>
+
+
      <dt id="getting-media-metadata">Once enough of the <span>media
      data</span> has been fetched to determine the duration of the
      <span>media resource</span>, its dimensions, and other metadata,
@@ -33638,8 +33694,10 @@
   track</span>, the user agent <a
   href="#found-a-media-resource-specific-timed-track">runs</a> the
   <dfn>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 <span>text
@@ -33689,6 +33747,15 @@
    <li><p>Add the new <span>text track</span> to the <span>media
    element</span>'s <span>list of text tracks</span>.</p></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>TrackEvent</code>
+   interface, with the <code title="dom-TrackEvent-track">track</code>
+   attribute initialized to the <span>text track</span>'s
+   <code>TextTrack</code> object, at the <span>media element</span>'s
+   <code title="dom-media-textTracks">textTracks</code> attribute's
+   <code>TextTrackList</code> object.</p></li>
+
   </ol>
 
   <p>When a <span>media element</span> is to <dfn>forget the media
@@ -33766,13 +33833,21 @@
   the new parent is a <span>media element</span>, then the user agent
   must add the <code>track</code> element's corresponding <span>text
   track</span> to the <span>media element</span>'s <span>list of text
-  tracks</span>.</p>
+  tracks</span>, and then <span>queue a task</span> 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>TrackEvent</code> interface, with the <code
+  title="dom-TrackEvent-track">track</code> attribute initialized to
+  the <span>text track</span>'s <code>TextTrack</code> object, at the
+  <span>media element</span>'s <code
+  title="dom-media-textTracks">textTracks</code> attribute's
+  <code>TextTrackList</code> object.</p>
 
   <p>When a <code>track</code> element's parent element changes and
   the old parent was a <span>media element</span>, then the user agent
   must remove the <code>track</code> element's corresponding
   <span>text track</span> from the <span>media element</span>'s
-  <span>list of text tracks</span>.</p>
+  <span>list of text tracks</span>.</p> <!-- removetrack -->
 
   <p>When a <span>text track</span> corresponding to a
   <code>track</code> element is added to a <span>media
@@ -34527,6 +34602,20 @@
 
    <li>
 
+    <p><span>Queue a task</span> 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>TrackEvent</code>
+    interface, with the <code
+    title="dom-TrackEvent-track">track</code> attribute initialized to
+    the new <span>text track</span>'s <code>MutableTextTrack</code>
+    object, at the <span>media element</span>'s <code
+    title="dom-media-textTracks">textTracks</code> attribute's
+    <code>TextTrackList</code> object.</p>
+
+   </li>
+
+   <li>
+
     <p>Return the new <code>MutableTextTrack</code> object.</p>
 
    </li>




More information about the Commit-Watchers mailing list