hixie: Fire addtrack events whenver a track is added to a media element. (whatwg r6609)

hixie: Fire addtrack events whenver a track is added to a media element.
(whatwg r6609)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5301&r2=1.5302&f=h
http://html5.org/tools/web-apps-tracker?from=6608&to=6609

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.5301
retrieving revision 1.5302
diff -u -d -r1.5301 -r1.5302
--- Overview.html 30 Sep 2011 23:30:44 -0000 1.5301
+++ Overview.html 30 Sep 2011 23:57:59 -0000 1.5302
@@ -22662,6 +22662,48 @@
      
      
 
+     <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,
@@ -25815,7 +25857,9 @@
   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>
+
+  
 
   <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>
@@ -25863,6 +25907,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
@@ -25921,13 +25973,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> 
 
   <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
@@ -26494,6 +26552,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>

Received on Friday, 30 September 2011 23:58:16 UTC