[html5] r3647 - [] (0) Hook progress events into the media elements.

whatwg at whatwg.org whatwg at whatwg.org
Mon Aug 17 15:02:07 PDT 2009


Author: ianh
Date: 2009-08-17 15:02:05 -0700 (Mon, 17 Aug 2009)
New Revision: 3647

Modified:
   index
   source
Log:
[] (0) Hook progress events into the media elements.

Modified: index
===================================================================
--- index	2009-08-17 10:28:19 UTC (rev 3646)
+++ index	2009-08-17 22:02:05 UTC (rev 3647)
@@ -4931,7 +4931,20 @@
    downloaded. The <a href=#task-source>task source</a> for these tasks is the
    <a href=#networking-task-source>networking task source</a>.</p>
 
-  </ol><p class=note>The <a href=#application-cache>application cache</a> processing model
+  </ol><p>If the user agent can determine the actual length of the file
+  being <a href=#fetch title=fetch>fetched</a> for an instance of this
+  algorithm, and if that length is finite, then that length is the
+  file's <dfn id=concept-fetch-total title=concept-fetch-total>size</dfn>. Otherwise, the
+  subject of the algorithm (that is, the file being fetched) has no
+  known <a href=#concept-fetch-total title=concept-fetch-total>size</a>. (For example,
+  the HTTP <code title=http-content-length>Content-Length</code>
+  header might provide this information.)</p>
+
+  <p>The user agent must also keep track of the <dfn id=concept-fetch-loaded title=concept-fetch-loaded>number of bytes downloaded</dfn> for
+  each instance of this algorithm. This number must exclude any
+  out-of-band metadata, such as HTTP headers.</p>
+
+  <p class=note>The <a href=#application-cache>application cache</a> processing model
   introduces some <a href=#changesToNetworkingModel>changes to the
   networking model</a> to handle the returning of cached
   resources.</p>
@@ -20842,8 +20855,11 @@
 
    <li><p>If the <a href=#media-element>media element</a>'s <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> is set to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code> or <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code>, set the <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute to a new
    <code><a href=#mediaerror>MediaError</a></code> object whose <code title=dom-MediaError-code><a href=#dom-mediaerror-code>code</a></code> attribute is set to <code title=dom-MediaError-MEDIA_ERR_ABORTED><a href=#dom-mediaerror-media_err_aborted>MEDIA_ERR_ABORTED</a></code>,
-   and <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-abort><a href=#event-abort>abort</a></code> at the <a href=#media-element>media
-   element</a>.</li>
+   <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-abort><a href=#event-abort>abort</a></code> at the <a href=#media-element>media element</a>,
+   in the context of the <a href=#fetch title=fetch>fetching process</a>
+   that is in progress for the element, and <a href=#fire-a-progress-event>fire a progress
+   event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code> at
+   the <a href=#media-element>media element</a>, in the context of the same <a href=#fetch title=fetch>fetching process</a>.</li>
 
    <li><p>Set the <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute
    to null and the <a href=#autoplaying-flag>autoplaying flag</a> to true.</li>
@@ -20931,7 +20947,7 @@
 
    <li><p>⌛ <a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
    event</a> called <code title=event-loadstart><a href=#event-loadstart>loadstart</a></code>
-   at the <a href=#media-element>media element</a>.</li>
+   at the <a href=#media-element>media element</a>, with no relevant <a href=#fetch title=fetch>fetching process</a>.</li>
 
    <li>
 
@@ -20966,8 +20982,16 @@
 
      <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
      event</a> called <code title=event-error><a href=#event-error>error</a></code> at the
-     <a href=#media-element>media element</a>.</li>
+     <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> that was used to try to
+     obtain the <a href=#media-resource>media resource</a> in the <a href=#concept-media-load-resource title=concept-media-load-resource>resource fetch
+     algorithm</a>.</li>
 
+     <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
+     event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code> at
+     the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> that was used to try to
+     obtain the <a href=#media-resource>media resource</a> in the <a href=#concept-media-load-resource title=concept-media-load-resource>resource fetch
+     algorithm</a>.</li>
+
      <li><p>Set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event flag</a>
      to false. This stops <a href=#delay-the-load-event title="delay the load event">delaying
      the load event</a>.</li>
@@ -21056,7 +21080,10 @@
      the load failed.</li>
 
      <li><p><i title="">Failed</i>: <a href=#queue-a-task>Queue a task</a> to
-     <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-error><a href=#event-error>error</a></code> at the <var title="">candidate</var> element.</li>
+     <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-error><a href=#event-error>error</a></code> at the <var title="">candidate</var> element, in the context of the <a href=#fetch title=fetch>fetching process</a> that was used to try to
+     obtain <var title="">candidate</var>'s corresponding <a href=#media-resource>media
+     resource</a> in the <a href=#concept-media-load-resource title=concept-media-load-resource>resource fetch
+     algorithm</a>.</li>
 
      <li><p>Asynchronously <a href=#await-a-stable-state>await a stable state</a>. The
      <a href=#synchronous-section>synchronous section</a> consists of all the remaining
@@ -21134,13 +21161,17 @@
     <p>Begin to <a href=#fetch>fetch</a> the <var title="">current media
     resource</var>.</p>
 
-    <p>Every 350ms (±200ms) or for every byte received,
-    whichever is <em>least</em> frequent, <a href=#queue-a-task>queue a task</a>
-    to <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-progress><a href=#event-progress>progress</a></code> at the element.</p>
+    <p>Every 350ms (±200ms) or for every byte received, whichever
+    is <em>least</em> frequent, <a href=#queue-a-task>queue a task</a> to
+    <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-progress><a href=#event-progress>progress</a></code> at the element, in the
+    context of the <a href=#fetch title=fetch>fetching process</a> started
+    by this instance of this algorithm.</p>
 
     <p>If at any point the user agent has received no data for more
     than about three seconds, then <a href=#queue-a-task>queue a task</a> to
-    <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-stalled><a href=#event-stalled>stalled</a></code> at the element.</p>
+    <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-stalled><a href=#event-stalled>stalled</a></code> at the element, in the
+    context of the <a href=#fetch title=fetch>fetching process</a> started
+    by this instance of this algorithm.</p>
 
     <p>User agents may allow users to selectively block or slow
     <a href=#media-data>media data</a> downloads. When a <a href=#media-element>media
@@ -21152,14 +21183,14 @@
 
     <p>User agents may decide to not download more content at any
     time, e.g. after buffering five minutes of a one hour media
-    resource, while waiting for the user to decide whether to play
-    the resource or not, or while waiting for user input in an
-    interactive resource. When a <a href=#media-element>media element</a>'s
-    download has been suspended, the user agent must set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> and
-    <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-progress-event>fire a progress event</a>
-    called <code title=event-suspend><a href=#event-suspend>suspend</a></code> at the
-    element. If and when downloading of the resource resumes, the
-    user agent must set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code>.</p>
+    resource, while waiting for the user to decide whether to play the
+    resource or not, or while waiting for user input in an interactive
+    resource. When a <a href=#media-element>media element</a>'s download has been
+    suspended, the user agent must set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> and <a href=#queue-a-task>queue
+    a task</a> to <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-suspend><a href=#event-suspend>suspend</a></code> at the element, in the
+    context of the <a href=#fetch title=fetch>fetching process</a> started
+    by this instance of this algorithm. If and when downloading of the
+    resource resumes, the user agent must set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code>.</p>
 
     <p>The <code title=attr-media-autobuffer><a href=#attr-media-autobuffer>autobuffer</a></code>
     attribute provides a hint that the author expects that downloading
@@ -21306,7 +21337,8 @@
 
       <p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
       event</a> called <code title=event-progress><a href=#event-progress>progress</a></code>
-      at the element.</p>
+      at the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance
+      of this algorithm.</p>
 
      </dd>
 
@@ -21330,8 +21362,14 @@
 
        <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
        event</a> called <code title=event-error><a href=#event-error>error</a></code> at
-       the <a href=#media-element>media element</a>.</li>
+       the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance
+       of this algorithm.</li>
 
+       <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
+       event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code>
+       at the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance
+       of this algorithm.</li>
+
        <li><p>Set the element's <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
        the <a href=#dom-media-network_empty title=dom-media-NETWORK_EMPTY>NETWORK_EMPTY</a>
        value and <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
@@ -21366,8 +21404,14 @@
 
        <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
        event</a> called <code title=event-error><a href=#event-error>error</a></code> at
-       the <a href=#media-element>media element</a>.</li>
+       the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance
+       of this algorithm.</li>
 
+       <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
+       event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code>
+       at the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance
+       of this algorithm.</li>
+
        <li><p>Set the element's <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
        the <a href=#dom-media-network_empty title=dom-media-NETWORK_EMPTY>NETWORK_EMPTY</a>
        value and <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple
@@ -21405,8 +21449,14 @@
 
        <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
        event</a> called <code title=event-abort><a href=#event-abort>abort</a></code> at
-       the <a href=#media-element>media element</a>.</li>
+       the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance
+       of this algorithm.</li>
 
+       <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
+       event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code>
+       at the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance
+       of this algorithm.</li>
+
        <li><p>If the <a href=#media-element>media element</a>'s <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute has a
        value equal to <code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, set the
        element's <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
@@ -21444,20 +21494,28 @@
      </dd>
 
     </dl><p>When the <a href=#networking-task-source>networking task source</a> has <a href=#queue-a-task title="queue a task">queued</a> the last <a href=#concept-task title=concept-task>task</a> as part of <a href=#fetch title=fetch>fetching</a> the <a href=#media-resource>media resource</a>
-    (i.e. once the download has completed), the user agent must move
-    on to the next step. This might never happen, e.g. when streaming
-    an infinite resource such as Web radio.</p>
+    (i.e. once the download has completed), if the fetching process
+    completes without errors, including decoding the media data, then,
+    the user agent must move on to the next step. This might never
+    happen, e.g. when streaming an infinite resource such as Web
+    radio.</p>
 
    </li>
 
-   <li><p>If the fetching process completes without errors, including
-   decoding the media data, then set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
-   <code title=dom-media-NETWORK_LOADED><a href=#dom-media-network_loaded>NETWORK_LOADED</a></code>, and
-   <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-progress-event>fire a progress event</a>
-   called <code title=event-load><a href=#event-load>load</a></code> at the
-   element.</li>
+   <li><p>Set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute to
+   <code title=dom-media-NETWORK_LOADED><a href=#dom-media-network_loaded>NETWORK_LOADED</a></code>.</li>
 
-   <li><p>Then, abort the overall <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
+   <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
+   event</a> called <code title=event-load><a href=#event-load>load</a></code> at the
+   <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance of
+   this algorithm.</li>
+
+   <li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-progress-event>fire a progress
+   event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code> at
+   the <a href=#media-element>media element</a>, in the context of the <a href=#fetch title=fetch>fetching process</a> started by this instance of
+   this algorithm.</li>
+
+   <li><p>Finally, abort the overall <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
    algorithm</a>.</li>
 
   </ol><p>If a <a href=#media-element>media element</a> whose <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> has the value
@@ -21757,7 +21815,7 @@
 
    <dd>
 
-    <p class=note>A <code title=event-loadedmetadata><a href=#event-loadedmetadata>loadedmetadata</a></code> DOM event <a href=#fire-loadedmetadata>will be fired</a> as part of the <code title=dom-event-load>load()</code> algorithm.</p>
+    <p class=note>A <code title=event-loadedmetadata><a href=#event-loadedmetadata>loadedmetadata</a></code> DOM event <a href=#fire-loadedmetadata>will be fired</a> as part of the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm.</p>
 
    </dd>
 
@@ -21771,7 +21829,7 @@
    <dd>
 
     <p id=fire-loadeddata>If this is the first time this occurs for
-    this <a href=#media-element>media element</a> since the <code title=dom-event-load>load()</code> algorithm was last invoked,
+    this <a href=#media-element>media element</a> since the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> algorithm was last invoked,
     the user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
     simple event</a> called <code title=event-loadeddata><a href=#event-loadeddata>loadeddata</a></code> at the element.</p>
 
@@ -22748,6 +22806,10 @@
      <td>An error occurs while fetching the <a href=#media-data>media data</a>.
      <td><code title=dom-media-error><a href=#dom-media-error>error</a></code> is an object with the code <code title=dom-MediaError-MEDIA_ERR_NETWORK><a href=#dom-mediaerror-media_err_network>MEDIA_ERR_NETWORK</a></code> or higher.
          <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> equals either <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code> or <code title=dom-media-NETWORK_LOADED><a href=#dom-media-network_loaded>NETWORK_LOADED</a></code>, depending on when the download was aborted.
+    <tr><td><dfn id=event-loadend title=event-loadend><code>loadend</code></dfn>
+     <td><code>ProgressEvent</code> <a href=#refsPROGRESS>[PROGRESS]</a>
+     <td>The user agent stops fetching the <a href=#media-data>media data</a>, for whatever reason.
+     <td>One of <code title=event-load><a href=#event-load>load</a></code>, <code title=event-abort><a href=#event-abort>abort</a></code>, or <code title=event-error><a href=#event-error>error</a></code> has just fired.
     <tr><td><dfn id=event-emptied title=event-emptied><code>emptied</code></dfn>
      <td><code>Event</code>
      <td>A <a href=#media-element>media element</a> whose <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> was previously not in the <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code> state has just switched to that state (either because of a fatal error during load that's about to be reported, or because the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> method was invoked while the <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection algorithm</a> was already running, in which case it is fired synchronously during the <code title=dom-media-load><a href=#dom-media-load>load()</a></code> method call).
@@ -48317,9 +48379,22 @@
   and which uses the <code>Event</code> interface, must be dispatched
   at the given target.</p>
 
-  <p class=XXX><dfn id=fire-a-progress-event title="fire a progress event">Firing a
-  progress event called <var title="">e</var></dfn> means something
-  that hasn't yet been defined, in the <a href=#refsPROGRESS>[PROGRESS]</a> spec.</p>
+  <p><dfn id=fire-a-progress-event title="fire a progress event">Firing a progress event called
+  <var title="">e</var></dfn>, optionally in the context of a
+  particular instance of the <a href=#fetch title=fetch>fetching
+  algorithm</a>, means that an event with the name <var title="">e</var>, with no namespace, which does not bubble (unless
+  otherwise stated) and is not cancelable (unless otherwise stated),
+  and which uses the <code>ProgressEvent</code> interface, must be
+  dispatched at the given target. If there is a <a href=#fetch title=fetch>fetching algorithm</a>, then the <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code>
+  attribute must be set to true if the <a href=#fetch title=fetch>fetching
+  algorithm</a>'s subject has a known <a href=#concept-fetch-total title=concept-fetch-total>size</a>; the <code title=dom-ProgressEvents-total>total</code> attribute must be set
+  to the subject's <a href=#concept-fetch-total title=concept-fetch-total>size</a> if it
+  is known and zero otherwise; and the <code title=dom-ProgressEvents-loaded>loaded</code> attribute must be
+  set to the <a href=#concept-fetch-loaded title=concept-fetch-loaded>number of bytes
+  downloaded</a>, excluding HTTP headers <a href=#concept-http-equivalent-headers title=concept-http-equivalent-headers>or
+  equivalent</a>. Otherwise, the <code title=dom-ProgressEvents-lengthComputable>lengthComputable</code>
+  attribute must be set to false, and the <code title=dom-ProgressEvents-total>total</code> and the <code title=dom-ProgressEvents-loaded>loaded</code> attributes must be
+  set to zero. <a href=#refsPROGRESS>[PROGRESS]</a></p>
 
   <p>The default action of these event is to do nothing unless
   otherwise stated.</p>

Modified: source
===================================================================
--- source	2009-08-17 10:28:19 UTC (rev 3646)
+++ source	2009-08-17 22:02:05 UTC (rev 3647)
@@ -4628,6 +4628,20 @@
 
   </ol>
 
+  <p>If the user agent can determine the actual length of the file
+  being <span title="fetch">fetched</span> for an instance of this
+  algorithm, and if that length is finite, then that length is the
+  file's <dfn title="concept-fetch-total">size</dfn>. Otherwise, the
+  subject of the algorithm (that is, the file being fetched) has no
+  known <span title="concept-fetch-total">size</span>. (For example,
+  the HTTP <code title="http-content-length">Content-Length</code>
+  header might provide this information.)</p>
+
+  <p>The user agent must also keep track of the <dfn
+  title="concept-fetch-loaded">number of bytes downloaded</dfn> for
+  each instance of this algorithm. This number must exclude any
+  out-of-band metadata, such as HTTP headers.</p>
+
   <p class="note">The <span>application cache</span> processing model
   introduces some <a href="#changesToNetworkingModel">changes to the
   networking model</a> to handle the returning of cached
@@ -22417,9 +22431,13 @@
    <code>MediaError</code> object whose <code
    title="dom-MediaError-code">code</code> attribute is set to <code
    title="dom-MediaError-MEDIA_ERR_ABORTED">MEDIA_ERR_ABORTED</code>,
-   and <span>fire a progress event</span> called <code
-   title="event-abort">abort</code> at the <span>media
-   element</span>.</p></li>
+   <span>fire a progress event</span> called <code
+   title="event-abort">abort</code> at the <span>media element</span>,
+   in the context of the <span title="fetch">fetching process</span>
+   that is in progress for the element, and <span>fire a progress
+   event</span> called <code title="event-loadend">loadend</code> at
+   the <span>media element</span>, in the context of the same <span
+   title="fetch">fetching process</span>.</p></li>
 
    <li><p>Set the <code title="dom-media-error">error</code> attribute
    to null and the <span>autoplaying flag</span> to true.</p></li>
@@ -22533,7 +22551,8 @@
 
    <li><p>&#x231B; <span>Queue a task</span> to <span>fire a progress
    event</span> called <code title="event-loadstart">loadstart</code>
-   at the <span>media element</span>.</p></li>
+   at the <span>media element</span>, with no relevant <span
+   title="fetch">fetching process</span>.</p></li>
 
    <li>
 
@@ -22577,8 +22596,20 @@
 
      <li><p><span>Queue a task</span> to <span>fire a progress
      event</span> called <code title="event-error">error</code> at the
-     <span>media element</span>.</p></li>
+     <span>media element</span>, in the context of the <span
+     title="fetch">fetching process</span> that was used to try to
+     obtain the <span>media resource</span> in the <span
+     title="concept-media-load-resource">resource fetch
+     algorithm</span>.</p></li>
 
+     <li><p><span>Queue a task</span> to <span>fire a progress
+     event</span> called <code title="event-loadend">loadend</code> at
+     the <span>media element</span>, in the context of the <span
+     title="fetch">fetching process</span> that was used to try to
+     obtain the <span>media resource</span> in the <span
+     title="concept-media-load-resource">resource fetch
+     algorithm</span>.</p></li>
+
      <li><p>Set the element's <span>delaying-the-load-event flag</span>
      to false. This stops <span title="delay the load event">delaying
      the load event</span>.</p></li>
@@ -22693,7 +22724,12 @@
      <li><p><i title="">Failed</i>: <span>Queue a task</span> to
      <span>fire a simple event</span> called <code
      title="event-error">error</code> at the <var
-     title="">candidate</var> element.</p></li>
+     title="">candidate</var> element, in the context of the <span
+     title="fetch">fetching process</span> that was used to try to
+     obtain <var title="">candidate</var>'s corresponding <span>media
+     resource</span> in the <span
+     title="concept-media-load-resource">resource fetch
+     algorithm</span>.</p></li>
 
      <li><p>Asynchronously <span>await a stable state</span>. The
      <span>synchronous section</span> consists of all the remaining
@@ -22786,15 +22822,19 @@
     <p>Begin to <span>fetch</span> the <var title="">current media
     resource</var>.</p>
 
-    <p>Every 350ms (&#xB1;200ms) or for every byte received,
-    whichever is <em>least</em> frequent, <span>queue a task</span>
-    to <span>fire a progress event</span> called <code
-    title="event-progress">progress</code> at the element.</p>
+    <p>Every 350ms (&#xB1;200ms) or for every byte received, whichever
+    is <em>least</em> frequent, <span>queue a task</span> to
+    <span>fire a progress event</span> called <code
+    title="event-progress">progress</code> at the element, in the
+    context of the <span title="fetch">fetching process</span> started
+    by this instance of this algorithm.</p>
 
     <p>If at any point the user agent has received no data for more
     than about three seconds, then <span>queue a task</span> to
     <span>fire a progress event</span> called <code
-    title="event-stalled">stalled</code> at the element.</p>
+    title="event-stalled">stalled</code> at the element, in the
+    context of the <span title="fetch">fetching process</span> started
+    by this instance of this algorithm.</p>
 
     <p>User agents may allow users to selectively block or slow
     <span>media data</span> downloads. When a <span>media
@@ -22806,16 +22846,17 @@
 
     <p>User agents may decide to not download more content at any
     time, e.g. after buffering five minutes of a one hour media
-    resource, while waiting for the user to decide whether to play
-    the resource or not, or while waiting for user input in an
-    interactive resource. When a <span>media element</span>'s
-    download has been suspended, the user agent must set the <code
+    resource, while waiting for the user to decide whether to play the
+    resource or not, or while waiting for user input in an interactive
+    resource. When a <span>media element</span>'s download has been
+    suspended, the user agent must set the <code
     title="dom-media-networkState">networkState</code> to <code
-    title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> and
-    <span>queue a task</span> to <span>fire a progress event</span>
-    called <code title="event-suspend">suspend</code> at the
-    element. If and when downloading of the resource resumes, the
-    user agent must set the <code
+    title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> and <span>queue
+    a task</span> to <span>fire a progress event</span> called <code
+    title="event-suspend">suspend</code> at the element, in the
+    context of the <span title="fetch">fetching process</span> started
+    by this instance of this algorithm. If and when downloading of the
+    resource resumes, the user agent must set the <code
     title="dom-media-networkState">networkState</code> to <code
     title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.</p>
 
@@ -22994,7 +23035,9 @@
 
       <p><span>Queue a task</span> to <span>fire a progress
       event</span> called <code title="event-progress">progress</code>
-      at the element.</p>
+      at the <span>media element</span>, in the context of the <span
+      title="fetch">fetching process</span> started by this instance
+      of this algorithm.</p>
 
      </dd>
 
@@ -23022,8 +23065,16 @@
 
        <li><p><span>Queue a task</span> to <span>fire a progress
        event</span> called <code title="event-error">error</code> at
-       the <span>media element</span>.</p></li>
+       the <span>media element</span>, in the context of the <span
+       title="fetch">fetching process</span> started by this instance
+       of this algorithm.</p></li>
 
+       <li><p><span>Queue a task</span> to <span>fire a progress
+       event</span> called <code title="event-loadend">loadend</code>
+       at the <span>media element</span>, in the context of the <span
+       title="fetch">fetching process</span> started by this instance
+       of this algorithm.</p></li>
+
        <li><p>Set the element's <code
        title="dom-media-networkState">networkState</code> attribute to
        the <span title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</span>
@@ -23067,8 +23118,16 @@
 
        <li><p><span>Queue a task</span> to <span>fire a progress
        event</span> called <code title="event-error">error</code> at
-       the <span>media element</span>.</p></li>
+       the <span>media element</span>, in the context of the <span
+       title="fetch">fetching process</span> started by this instance
+       of this algorithm.</p></li>
 
+       <li><p><span>Queue a task</span> to <span>fire a progress
+       event</span> called <code title="event-loadend">loadend</code>
+       at the <span>media element</span>, in the context of the <span
+       title="fetch">fetching process</span> started by this instance
+       of this algorithm.</p></li>
+
        <li><p>Set the element's <code
        title="dom-media-networkState">networkState</code> attribute to
        the <span title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</span>
@@ -23114,8 +23173,16 @@
 
        <li><p><span>Queue a task</span> to <span>fire a progress
        event</span> called <code title="event-abort">abort</code> at
-       the <span>media element</span>.</p></li>
+       the <span>media element</span>, in the context of the <span
+       title="fetch">fetching process</span> started by this instance
+       of this algorithm.</p></li>
 
+       <li><p><span>Queue a task</span> to <span>fire a progress
+       event</span> called <code title="event-loadend">loadend</code>
+       at the <span>media element</span>, in the context of the <span
+       title="fetch">fetching process</span> started by this instance
+       of this algorithm.</p></li>
+
        <li><p>If the <span>media element</span>'s <code
        title="dom-media-readyState">readyState</code> attribute has a
        value equal to <code
@@ -23165,21 +23232,32 @@
     title="queue a task">queued</span> the last <span
     title="concept-task">task</span> as part of <span
     title="fetch">fetching</span> the <span>media resource</span>
-    (i.e. once the download has completed), the user agent must move
-    on to the next step. This might never happen, e.g. when streaming
-    an infinite resource such as Web radio.</p>
+    (i.e. once the download has completed), if the fetching process
+    completes without errors, including decoding the media data, then,
+    the user agent must move on to the next step. This might never
+    happen, e.g. when streaming an infinite resource such as Web
+    radio.</p>
 
    </li>
 
-   <li><p>If the fetching process completes without errors, including
-   decoding the media data, then set the <code
+   <li><p>Set the <code
    title="dom-media-networkState">networkState</code> attribute to
-   <code title="dom-media-NETWORK_LOADED">NETWORK_LOADED</code>, and
-   <span>queue a task</span> to <span>fire a progress event</span>
-   called <code title="event-load">load</code> at the
-   element.</p></li>
+   <code
+   title="dom-media-NETWORK_LOADED">NETWORK_LOADED</code>.</p></li>
 
-   <li><p>Then, abort the overall <span
+   <li><p><span>Queue a task</span> to <span>fire a progress
+   event</span> called <code title="event-load">load</code> at the
+   <span>media element</span>, in the context of the <span
+   title="fetch">fetching process</span> started by this instance of
+   this algorithm.</p></li>
+
+   <li><p><span>Queue a task</span> to <span>fire a progress
+   event</span> called <code title="event-loadend">loadend</code> at
+   the <span>media element</span>, in the context of the <span
+   title="fetch">fetching process</span> started by this instance of
+   this algorithm.</p></li>
+
+   <li><p>Finally, abort the overall <span
    title="concept-media-load-algorithm">resource selection
    algorithm</span>.</p></li>
 
@@ -23526,7 +23604,7 @@
     <p class="note">A <code
     title="event-loadedmetadata">loadedmetadata</code> DOM event <a
     href="#fire-loadedmetadata">will be fired</a> as part of the <code
-    title="dom-event-load">load()</code> algorithm.</p>
+    title="dom-media-load">load()</code> algorithm.</p>
 
    </dd>
 
@@ -23542,7 +23620,7 @@
 
     <p id="fire-loadeddata">If this is the first time this occurs for
     this <span>media element</span> since the <code
-    title="dom-event-load">load()</code> algorithm was last invoked,
+    title="dom-media-load">load()</code> algorithm was last invoked,
     the user agent must <span>queue a task</span> to <span>fire a
     simple event</span> called <code
     title="event-loadeddata">loadeddata</code> at the element.</p>
@@ -24678,6 +24756,11 @@
      <td><code title="dom-media-error">error</code> is an object with the code <code title="dom-MediaError-MEDIA_ERR_NETWORK">MEDIA_ERR_NETWORK</code> or higher.
          <code title="dom-media-networkState">networkState</code> equals either <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> or <code title="dom-media-NETWORK_LOADED">NETWORK_LOADED</code>, depending on when the download was aborted.
     <tr>
+     <td><dfn title="event-loadend"><code>loadend</code></dfn>
+     <td><code>ProgressEvent</code> <a href="#refsPROGRESS">[PROGRESS]</a>
+     <td>The user agent stops fetching the <span>media data</span>, for whatever reason.
+     <td>One of <code title="event-load">load</code>, <code title="event-abort">abort</code>, or <code title="event-error">error</code> has just fired.
+    <tr>
      <td><dfn title="event-emptied"><code>emptied</code></dfn>
      <td><code>Event</code>
      <td>A <span>media element</span> whose <code title="dom-media-networkState">networkState</code> was previously not in the <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> state has just switched to that state (either because of a fatal error during load that's about to be reported, or because the <code title="dom-media-load">load()</code> method was invoked while the <span title="concept-media-load-algorithm">resource selection algorithm</span> was already running, in which case it is fired synchronously during the <code title="dom-media-load">load()</code> method call).
@@ -54640,10 +54723,32 @@
   and which uses the <code>Event</code> interface, must be dispatched
   at the given target.</p>
 
-  <p class="XXX"><dfn title="fire a progress event">Firing a
-  progress event called <var title="">e</var></dfn> means something
-  that hasn't yet been defined, in the <a
-  href="#refsPROGRESS">[PROGRESS]</a> spec.</p>
+  <p><dfn title="fire a progress event">Firing a progress event called
+  <var title="">e</var></dfn>, optionally in the context of a
+  particular instance of the <span title="fetch">fetching
+  algorithm</span>, means that an event with the name <var
+  title="">e</var>, with no namespace, which does not bubble (unless
+  otherwise stated) and is not cancelable (unless otherwise stated),
+  and which uses the <code>ProgressEvent</code> interface, must be
+  dispatched at the given target. If there is a <span
+  title="fetch">fetching algorithm</span>, then the <code
+  title="dom-ProgressEvents-lengthComputable">lengthComputable</code>
+  attribute must be set to true if the <span title="fetch">fetching
+  algorithm</span>'s subject has a known <span
+  title="concept-fetch-total">size</span>; the <code
+  title="dom-ProgressEvents-total">total</code> attribute must be set
+  to the subject's <span title="concept-fetch-total">size</span> if it
+  is known and zero otherwise; and the <code
+  title="dom-ProgressEvents-loaded">loaded</code> attribute must be
+  set to the <span title="concept-fetch-loaded">number of bytes
+  downloaded</span>, excluding HTTP headers <span
+  title="concept-http-equivalent-headers">or
+  equivalent</span>. Otherwise, the <code
+  title="dom-ProgressEvents-lengthComputable">lengthComputable</code>
+  attribute must be set to false, and the <code
+  title="dom-ProgressEvents-total">total</code> and the <code
+  title="dom-ProgressEvents-loaded">loaded</code> attributes must be
+  set to zero. <a href="#refsPROGRESS">[PROGRESS]</a></p>
 
   <p>The default action of these event is to do nothing unless
   otherwise stated.</p>




More information about the Commit-Watchers mailing list