HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/2849

File a bug

SVNBugCommentTime (UTC)
2849[Gecko] [Webkit] Change the way resources are loaded for media elements to make it actually work.2009-02-23 07:19
Index: source
===================================================================
--- source	(revision 2848)
+++ source	(revision 2849)
@@ -19291,8 +19291,8 @@
   <code>audio</code> element). If the <var title="">src</var> argument
   is present, the object created must have its <code
   title="dom-media-src">src</code> content attribute set to the
-  provided value, and the user agent must invoke the <code
-  title="dom-media-load">load()</code> method on the object before
+  provided value, and the user agent must invoke the object's <span
+  title="concept-media-load-algorithm">load algorithm</span> before
   returning.</p>
 
 
@@ -19455,16 +19455,6 @@
   it. Its value must be a valid <a href="#mq">media query</a>. <a
   href="#refsMQ">[MQ]</a></p>
 
-  <p>If a <code>source</code> element is inserted into a <span>media
-  element</span> that is already in a document and whose <code
-  title="dom-media-networkState">networkState</code> is in the <code
-  title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> state, the user
-  agent must <span>queue a task</span> that implicitly invokes the
-  <code title="dom-media-load">load()</code> method on the <span>media
-  element</span>, and ignores any resulting exceptions. The <span>task
-  source</span> for this task is the <span>media element</span>'s own
-  <span>media element new resource task source</span>.</p>
-
   <p>The DOM attributes <dfn
   title="dom-source-src"><code>src</code></dfn>, <dfn
   title="dom-source-type"><code>type</code></dfn>, and <dfn
@@ -19491,6 +19481,7 @@
   const unsigned short <span title="dom-media-NETWORK_IDLE">NETWORK_IDLE</span> = 1;
   const unsigned short <span title="dom-media-NETWORK_LOADING">NETWORK_LOADING</span> = 2;
   const unsigned short <span title="dom-media-NETWORK_LOADED">NETWORK_LOADED</span> = 3;
+  const unsigned short <span title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</span> = 4;
   readonly attribute unsigned short <span title="dom-media-networkState">networkState</span>;
   readonly attribute float <span title="dom-media-bufferingRate">bufferingRate</span>;
   readonly attribute boolean <span title="dom-media-bufferingThrottled">bufferingThrottled</span>;
@@ -19586,25 +19577,22 @@
   resource</dfn> is used to refer to the complete set of media data,
   e.g. the complete video file, or complete audio file.</p>
 
-  <p><span title="media element">Media elements</span> use two <span
-  title="task queue">task queues</span>, the <dfn>media element event
-  task source</dfn> for asynchronous events and callbacks, and the
-  <dfn>media element new resource task source</dfn> for handling
-  implicit loads. Unless otherwise specified, the <span>task
-  source</span> for all the tasks <span title="queue a
-  task">queued</span> in this section and its subsections is the
-  <span>media element event task source</span>.</p>
+  <p>Unless otherwise specified, the <span>task source</span> for all
+  the tasks <span title="queue a task">queued</span> in this section
+  and its subsections is the <dfn>media element event task
+  source</dfn>.</p>
 
 
   <h5>Error codes</h5>
 
   <p>All <span title="media element">media elements</span> have an
   associated error status, which records the last error the element
-  encountered since the <code title="dom-media-load">load()</code>
-  method was last invoked. The <dfn
-  title="dom-media-error"><code>error</code></dfn> attribute, on
-  getting, must return the <code>MediaError</code> object created for
-  this last error, or null if there has not been an error.</p>
+  encountered since its <span
+  title="concept-media-load-algorithm">load algorithm</span> was last
+  invoked. The <dfn title="dom-media-error"><code>error</code></dfn>
+  attribute, on getting, must return the <code>MediaError</code>
+  object created for this last error, or null if there has not been an
+  error.</p>
 
   <pre class="idl">interface <dfn>MediaError</dfn> {
   const unsigned short <span title="dom-MediaError-MEDIA_ERR_ABORTED">MEDIA_ERR_ABORTED</span> = 1;
@@ -19652,23 +19640,6 @@
   the address of the media resource (video, audio) to show. The
   attribute, if present, must contain a <span>valid URL</span>.</p>
 
-  <p>If the <code title="attr-media-src">src</code> attribute of a
-  <span>media element</span> that is already in a document and whose
-  <code title="dom-media-networkState">networkState</code> is in the
-  <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> state is
-  added, changed, or removed, the user agent must <span>queue a
-  task</span> that implicitly invokes the <code
-  title="dom-media-load">load()</code> method on the <span>media
-  element</span>, and ignores any resulting exceptions. The <span>task
-  source</span> for this task is the <span>media element</span>'s own
-  <span>media element new resource task source</span>.</p>
-
-  <p class="note">If a <code title="attr-media-src">src</code>
-  attribute is specified, the resource it specifies is the <span>media
-  resource</span> that will be used. Otherwise, the resource specified
-  by the first suitable <code>source</code> element child of the
-  <span>media element</span> is the one used.</p>
-
   <p>The <dfn title="dom-media-src"><code>src</code></dfn> DOM
   attribute on <span title="media element">media elements</span> must
   <span>reflect</span> the respective content attribute of the same
@@ -19677,109 +19648,16 @@
   <p>The <dfn
   title="dom-media-currentSrc"><code>currentSrc</code></dfn> DOM
   attribute is initially the empty string. Its value is changed by the
-  algorithm for the <code title="dom-media-load">load()</code> method
+  <span title="concept-media-load-algorithm">load algorithm</span>
   defined below.</p>
 
-  <p>To <dfn>generate the list of potential media resources</dfn> for
-  a <span>media element</span>, a user agent must use the following
-  steps. These steps return a list of <span title="absolute
-  URL">absolute URLs</span> giving a resource's address.</p>
+  <p class="note">There are two ways to specify a <span>media
+  resource</span>, the <code title="attr-media-src">src</code>
+  attribute, or <code>source</code> elements. The attribute overrides
+  the elements.</p>
 
-  <ol>
 
-   <li>
 
-    <p>If the <span>media element</span> has a <code
-    title="attr-media-src">src</code> attribute, then run these
-    substeps:</p>
-
-    <ol>
-
-     <li><p><span title="resolve a url">Resolve</span> the
-     <span>URL</span> given in that attribute, relative to the
-     <span>media element</span>.</p>
-
-     <li><p>If that is successful, then return a list consisting of
-     only one entry, the resulting <span>absolute URL</span> as the
-     resource's address.</p></li>
-
-     <li><p>Otherwise, return the empty list.</p></li>
-
-     <li><p>Abort the algorithm.</p></li>
-
-    </ol>
-
-    <p>Otherwise, the <code>source</code> elements will be used.</p>
-
-   </li>
-
-   <li><p>If the <span>media element</span> has no <code>source</code>
-   element children, then return the empty the list and abort these
-   steps.</p></li>
-
-   <li><p>Let <var title="">result</var> be an empty list.</p></li>
-
-   <li><p>Let <var title="">candidate</var> be the first
-   <code>source</code> element child in the <span>media
-   element</span>.</p></li>
-
-   <li><p><i>Loop</i>: this is the start of the loop that looks at the
-   <code>source</code> elements.</p></li>
-
-   <li>
-
-    <p>If all the following conditions are true:</p>
-
-    <ul>
-
-     <li>The <var title="">candidate</var> element has a <code
-     title="attr-source-src">src</code> attribute.</li>
-
-     <li><span title="resolve a url">Resolving</span> the
-     <span>URL</span> given by the <var title="">candidate</var>
-     element's <code title="attr-source-src">src</code> attribute
-     relative to <var title="">candidate</var> does not fail.</li>
-
-     <li>The <var title="">candidate</var> element either has no <code
-     title="attr-source-type">type</code> attribute, or its <code
-     title="attr-source-type">type</code> attribute's value, when
-     parsed as a MIME type (including any codecs described by the
-     <code title="">codec</code> parameter), does not represent
-     <span>a type that the user agent knows it cannot
-     render</span>.</li>
-
-     <li>The <var title="">candidate</var> element either has no <code
-     title="attr-source-media">media</code> attribute, or its <code
-     title="attr-source-media">media</code> attribute's value, when
-     processed according to the rules for <a href="#mq">media
-     queries</a>, matches the current environment. <a
-     href="#refsMQ">[MQ]</a></li>
-
-    </ul>
-
-    <p>...then append the <span>absolute URL</span> resulting from
-    <span title="resolve a url">resolving</span> the <span>URL</span>
-    given in that <var title="">candidate</var> element's <code
-    title="attr-source-src">src</code> attribute relative to <var
-    title="">candidate</var> to the <var title="">result</var>
-    list.</p>
-
-   </li>
-
-   <li><p>Let <var title="">candidate</var> be the next
-   <code>source</code> element child in the <span>media
-   element</span>, or null if there are no more such
-   children.</p></li>
-
-   <li><p>If <var title="">candidate</var> is not null, return to the
-   step labeled <i>loop</i>.</p></li>
-
-   <li><p>Return <var title="">result</var>.</p></li>
-
-  </ol>
-
-
-
   <h5>Media types</h5>
 
   <p>A <span>media resource</span> can be described in terms of its
@@ -19874,9 +19752,9 @@
 
    <dt><dfn title="dom-media-NETWORK_IDLE"><code>NETWORK_IDLE</code></dfn> (numeric value 1)</dt>
 
-   <dd>The element's <code title="dom-media-load">load()</code> method
-   algorithm is active, but it is not actually using the network at
-   this time.</dd>
+   <dd>The element's <span title="concept-media-load-algorithm">load
+   algorithm</span> is active and has selected a resource, but it is
+   not actually using the network at this time.</dd>
 
    <dt><dfn title="dom-media-NETWORK_LOADING"><code>NETWORK_LOADING</code></dfn> (numeric value 2)</dt>
 
@@ -19888,10 +19766,16 @@
    available to the user agent locally. Network connectivity could be
    lost without affecting the media playback.</dd>
 
+   <dt><dfn title="dom-media-NETWORK_NO_SOURCE"><code>NETWORK_NO_SOURCE</code></dfn> (numeric value 4)</dt>
+
+   <dd>The element's <span title="concept-media-load-algorithm">load
+   algorithm</span> is active, but it has failed to find a resource to
+   use.</dd>
+
   </dl>
 
-  <p>The algorithm for the <code title="dom-media-load">load()</code>
-  method defined below describes exactly when the <code
+  <p>The <span title="concept-media-load-algorithm">load
+  algorithm</span> defined below describes exactly when the <code
   title="dom-media-networkState">networkState</code> attribute changes
   value and what events fire to indicate changes in this state.</p>
 
@@ -19902,8 +19786,7 @@
 
   <h5>Loading the media resource</h5>
 
-  <p>All <span title="media element">media elements</span> have a
-  <dfn>begun flag</dfn>, which must begin in the false state, an
+  <p>All <span title="media element">media elements</span> have an
   <dfn>autoplaying flag</dfn>, which must begin in the true state, and
   a <dfn>delaying-the-load-event flag</dfn>, which must begin in the
   false state. While the <span>delaying-the-load-event flag</span> is
@@ -19917,32 +19800,31 @@
 
   <ol>
 
+   <li><p>If the <code title="dom-media-load">load()</code> method for
+   this element is already being invoked, then abort these
+   steps.</p></li>
+
+   <li><p>Abort any already-running instance of the <span
+   title="concept-media-load-algorithm">load algorithm</span> for this
+   element.</p></li>
+
    <li>
 
     <p>If there are any <span title="concept-task">tasks</span> from
-    the <span>media element</span>'s <span>media element new resource
-    task source</span> or its <span>media element event task
+    the <span>media element</span>'s <span>media element event task
     source</span> in one of the <span title="task queue">task
     queues</span>, then remove those tasks.</p>
 
-    <p class="note">Basically, pending events, callbacks, and loads
-    for the media element are discarded when the media element starts
-    loading a new resource.</p>
+    <p class="note">Basically, pending events and callbacks for the
+    media element are discarded when the media element starts loading
+    a new resource.</p>
 
    </li>
 
-   <li><p>Abort any already-running instance of this algorithm for
-   this element. If those method calls have not yet returned, they
-   must finish the step they are on, and then immediately return. This
-   is not blocking; this algorithm must not wait for the earlier
-   instances to abort before continuing.</p></li>
-
-   <li><p>Set the element's <span>delaying-the-load-event flag</span>
-   to true. This <span title="delay the load event">delays the load
-   event</span>.</p></li>
-
-   <li><p>If the element's <span>begun flag</span> is true, then set
-   the <span>begun flag</span> to false, set the <code
+   <li><p>If the <span>media element</span>'s <code
+   title="dom-media-networkState">networkState</code> is set to <code
+   title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code> or <code
+   title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code>, set the <code
    title="dom-media-error">error</code> attribute to a new
    <code>MediaError</code> object whose <code
    title="dom-MediaError-code">code</code> attribute is set to <code
@@ -19960,11 +19842,13 @@
    title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>
    attribute.</p></li>
 
-   <li><p>If the <span>media element</span>'s <code
-   title="dom-media-networkState">networkState</code> is not set to
-   <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, then
-   run these substeps:</p>
+   <li>
 
+    <p>If the <span>media element</span>'s <code
+    title="dom-media-networkState">networkState</code> is not set to
+    <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, then
+    run these substeps:</p>
+
     <ol>
 
      <li><p>If a fetching process is in progress for the <span>media
@@ -20008,439 +19892,621 @@
 
    </li>
 
-   <li><p><span>Generate the list of potential media resources</span>
-   and let the resulting list be <var
-   title="">candidates</var>.</p></li>
+   <li><p>Asynchronously invoke the <span>media element</span>'s <span
+   title="concept-media-load-algorithm">load algorithm</span>.</li>
 
+   <li>
+
+    <p class="note">Playback of any previously playing <span>media
+    resource</span> for this element stops.</p>
+
+   </li>
+
+  </ol>
+
+  <p>The <dfn title="concept-media-load-algorithm">load
+  algorithm</dfn> for a <span>media element</span> is as follows. This
+  algorithm is always invoked asynchronously, meaning that it runs in
+  the background with scripts and other <span
+  title="concept-task">tasks</span> running in parallel.</p>
+
+  <ol>
+
+   <li><p>While the <span>media element</span> has neither a <code
+   title="attr-media-src">src</code> attribute nor any
+   <code>source</code> element children, wait. (This steps might wait
+   forever.)</p></li>
+
+   <li><p>Set the element's <span>delaying-the-load-event flag</span>
+   to true. This <span title="delay the load event">delays the load
+   event</span>.</p></li>
+
    <li><p>Set the <code
    title="dom-media-networkState">networkState</code> to <code
    title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.</p></li>
 
-   <li><p>Set the <span>begun flag</span> to true and <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>
+   <li><p><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>
 
    <li>
 
-    <p>The method must return, but these steps must continue.</p>
+    <p>If the <span>media element</span> has a <code
+    title="attr-media-src">src</code> attribute, then run these
+    substeps:</p>
 
-    <p class="note">Playback of any previously playing <span>media
-    resource</span> for this element stops.</p>
+    <ol>
 
-   </li>
+     <li><p><span title="resolve a url">Resolve</span> the
+     <span>URL</span> given in that attribute, relative to the
+     <span>media element</span>.</p>
 
+     <li><p>If that is successful, then run the <span
+     title="concept-media-load-resource">resource-load
+     algorithm</span> with the resulting <span>absolute URL</span>. If
+     that algorithm returns without aborting <em>this</em> one, then
+     the load failed.</p></li>
 
-   <!-- SYNCHRONOUS / ASYNCHRONOUS BOUNDARY FOR EVENT DISPATCH -->
+     <li><p>Reaching this step indicates that either the URL failed to
+     resolve, or the media resource failed to load. Set the <code
+     title="dom-media-error">error</code> attribute to a new
+     <code>MediaError</code> object whose <code
+     title="dom-MediaError-code">code</code> attribute is set to <code
+     title="dom-MediaError-MEDIA_ERR_NONE_SUPPORTED">MEDIA_ERR_NONE_SUPPORTED</code>.</p></li>
 
+     <li><p>Set the element's <code
+     title="dom-media-networkState">networkState</code> attribute to
+     the <span
+     title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</span>
+     value.</p></li>
 
-   <li>
+     <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>
 
-    <p><i>Candidate loop</i>: For each item in <var
-    title="">candidates</var>, if any, and in the same order as they
-    were added to the list, run the following steps:</p>
+     <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>
 
+     <li><p>Abort these steps. Until the <code
+     title="dom-media-load">load()</code> method is invoked, the
+     element won't attempt to load another resource.</p></li>
+     <!-- it took its ball and went home, sulking. -->
+
+    </ol>
+
+    <p>Otherwise, the <code>source</code> elements will be used; run
+    these substeps:</p>
+
     <ol>
 
-     <li><p>Let the <var title="">current media resource</var> be the
-     resource given by the <span>absolute URL</span> for the current
-     item in <var title="">candidates</var>. This is now the element's
-     <span>media resource</span>.</p></li>
+     <li>
 
-     <li><p>Set the <code
-     title="dom-media-currentSrc">currentSrc</code> attribute to the
-     <span>absolute URL</span> of the <var title="">current media
-     resource</var>.</p></li>
+      <p>Let <var title="">pointer</var> be a position defined by two
+      adjacent nodes in the <span>media element</span>'s child list,
+      treating the start of the list (before the first child in the
+      list, if any) and end of the list (after the last child in the
+      list, if any) as nodes in their own right. One node is the node
+      before <var title="">pointer</var>, and the other node is the
+      node after <var title="">pointer</var>. Initially, let <var
+      title="">pointer</var> be the position between the start of the
+      list and the next node (either the first child node of the
+      <span>media element</span>, if there are any, or the end of the
+      list, if it is empty).</p>
 
+      <p>As elements are inserted and removed into the <span>media
+      element</span>, <var title="">pointer</var> must be updated as
+      follows:</p>
+
+      <dl>
+
+       <dt>If a new element is inserted between the two nodes that
+       define <var title="">pointer</var></dt>
+
+       <dd>Let <var title="">pointer</var> be the point between the
+       node before <var title="">pointer</var> and the new node. In
+       other words, insertions at <var title="">pointer</var> go after
+       <var title="">pointer</var>.</dd>
+
+       <dt>If the node before <var title="">pointer</var> is removed</dt>
+
+       <dd>Let <var title="">pointer</var> be the point between the
+       node after <var title="">pointer</var> and the node before the
+       node after <var title="">pointer</var>. In other words, <var
+       title="">pointer</var> doesn't move relative to the remaining
+       nodes.</dd>
+
+       <dt>If the node after <var title="">pointer</var> is removed</dt>
+
+       <dd>Let <var title="">pointer</var> be the point between the
+       node before <var title="">pointer</var> and the node after the
+       node before <var title="">pointer</var>. Just as with the
+       previous case, <var title="">pointer</var> doesn't move
+       relative to the remaining nodes.</dd>
+
+      </dl>
+
+      <p>Other changes don't affect <var title="">pointer</var>.</p>
+
+     </li>
+
      <li>
 
-      <p>Begin to <span>fetch</span> the <var title="">current media
-      resource</var>.</p>
+      <p><i>Search loop:</i> Run these substeps atomically (so that
+      the DOM cannot change while they are running):</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>
+      <ol>
 
-      <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>
+       <li><p>If the node after <var title="">pointer</var> is the end
+       of the list, then jump to the step below labeled
+       <i>waiting</i>.</p></li>
 
-      <p>User agents may allow users to selectively block or slow
-      <span>media data</span> downloads. When a <span>media
-      element</span>'s download has been blocked altogether, the user
-      agent must act as if it was stalled (as opposed to acting as if
-      the connection was closed). The rate of the download may also be
-      throttled automatically by the user agent, e.g. to balance the
-      download with other connections sharing the same bandwidth.</p>
+       <li><p>If the node after <var title="">pointer</var> is a
+       <code>source</code> element, let <var title="">candidate</var>
+       be that element; otherwise, let <var title="">candidate</var>
+       be null.</p></li>
 
-      <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
-      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-networkState">networkState</code> to <code
-      title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.</p>
+       <li><p>Advance <var title="">pointer</var> so that the node
+       before <var title="">pointer</var> is now the node that was
+       after <var title="">pointer</var>, and the node after <var
+       title="">pointer</var> is the node after the node that used to
+       be after <var title="">pointer</var>.</p></li>
 
-      <p>The user agent may use whatever means necessary to fetch the
-      resource (within the constraints put forward by this and other
-      specifications); for example, reconnecting to the server in the
-      face of network errors, using HTTP partial range requests, or
-      switching to a streaming protocol. The user agent must consider a
-      resource erroneous only if it has given up trying to fetch it.</p>
+       <li><p>If <var title="">candidate</var> is null, restart the
+       step labelled <i>search loop</i> from the first
+       substep.</p></li>
 
-      <p>The <span>networking task source</span> <span
-      title="concept-task">tasks</span> to process the data as it is
-      being fetched must, when appropriate, include the relevant
-      substeps from the following list:</p>
+      </ol>
 
-      <dl class="switch">
+     </li>
 
-       <dt>If the <span>media data</span> cannot be fetched at all, due
-       to network errors, causing the user agent to give up trying to
-       fetch the resource</dt>
+     <li>
 
-       <dt>If the <span>media data</span> can be fetched but is in an
-       unsupported format, or can otherwise not be rendered at
-       all</dt>
+      <p>If any of the following conditions are true, then jump back
+      to the step labelled <i>search loop</i>:</p>
 
-       <dd>
+      <ul>
 
-        <p>DNS errors, HTTP 4xx and 5xx errors (and equivalents in
-        other protocols), and other fatal network errors that occur
-        before the user agent has established whether the <var
-        title="">current media resource</var> is usable, as well as
-        the file using an unsupported container format, or using
-        unsupported codecs for all the data, must cause the user agent
-        to execute the following steps:</p>
+       <li>The <var title="">candidate</var> element does not have a
+       <code title="attr-source-src">src</code> attribute.</li>
 
-        <ol>
+       <li><span title="resolve a url">Resolving</span> the
+       <span>URL</span> given by the <var title="">candidate</var>
+       element's <code title="attr-source-src">src</code> attribute
+       relative to <var title="">candidate</var> fails.</li>
 
-         <li><p>The user agent should cancel the fetching
-         process.</p></li>
+       <li>The <var title="">candidate</var> element has a <code
+       title="attr-source-type">type</code> attribute whose value,
+       when parsed as a MIME type (including any codecs described by
+       the <code title="">codec</code> parameter), represents <span>a
+       type that the user agent knows it cannot render</span>.</li>
 
-         <li><p>If there are more items in the <var
-         title="">candidates</var> list, then move on to the next one,
-         jumping back to the top of the <i>candidate loop</i>;
-         otherwise, jump to the final step in the overall algorithm
-         (the <i>failure step</i>).</p>
+       <li>The <var title="">candidate</var> element has a <code
+       title="attr-source-media">media</code> attribute whose value,
+       when processed according to the rules for <a href="#mq">media
+       queries</a>, does not match the current environment. <a
+       href="#refsMQ">[MQ]</a></li>
 
-        </ol>
+      </ul>
 
-       </dd>
+     </li>
 
+     <li><p>Set the <code
+     title="dom-media-networkState">networkState</code> to <code
+     title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code> again,
+     in case it was set to <code
+     title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</code>
+     above.</p></li>
 
-       <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</dt>
+     <li><p>Run the <span
+     title="concept-media-load-resource">resource-load
+     algorithm</span> with the <span>absolute URL</span> that resulted
+     from <span title="resolve a url">resolving</span> the
+     <span>URL</span> given by the <var title="">candidate</var>
+     element's <code title="attr-source-src">src</code> attribute
+     relative to <var title="">candidate</var>. If that algorithm
+     returns without aborting <em>this</em> one, then the load
+     failed.</p></li>
 
-       <dd>
+     <li><p>Return to the step labeled <i>search loop</i>.</p></li>
 
-        <p>This indicates that the resource is usable. The user agent
-        must follow these substeps:</p>
+     <li><p><i>Waiting:</i> Set the <code
+     title="dom-media-error">error</code> attribute to a new
+     <code>MediaError</code> object whose <code
+     title="dom-MediaError-code">code</code> attribute is set to <code
+     title="dom-MediaError-MEDIA_ERR_NONE_SUPPORTED">MEDIA_ERR_NONE_SUPPORTED</code>.</p></li>
 
-        <ol>
+     <li><p>Set the element's <code
+     title="dom-media-networkState">networkState</code> attribute to
+     the <span
+     title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</span>
+     value</p></li>
 
-         <li><p>Set the <span>current playback position</span> to the
-         <var>earliest possible position</var>.</p></li>
+     <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>
 
-         <li><p>Set the <code
-         title="dom-media-readyState">readyState</code> attribute to
-         <code
-         title="dom-media-HAVE_METADATA">HAVE_METADATA</code>.</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>
 
-         <li><p>For <code>video</code> elements, set the <code
-         title="dom-video-videoWidth">videoWidth</code> and <code
-         title="dom-video-videoHeight">videoHeight</code>
-         attributes.</p></li>
+     <li><p>Wait until the node after <var title="">painter</var> is a
+     node other than the end of the list. (This step might wait
+     forever.)</p></li>
 
-         <li>
+     <li><p>Set the element's <span>delaying-the-load-event
+     flag</span> back to true. This <span title="delay the load
+     event">delays the load event</span> again, in case it hasn't gone
+     been fired yet.</p></li>
 
-          <p>Set the <code title="dom-media-duration">duration</code>
-          attribute to the duration of the resource.</p>
+    </ol>
 
-          <p class="note">The user agent <a
-          href="#durationChange">will</a> <span>queue a task</span> to
-          <span>fire a simple event</span> called <code
-          title="event-durationchange">durationchange</code> at the
-          element at this point.</p>
+   </li>
 
-         </li>
+  </ol>
 
-         <li id="fire-loadedmetadata"><p><span>Queue a task</span> to
-         <span>fire a simple event</span> called <code
-         title="event-loadedmetadata">loadedmetadata</code> at the
-         element.</li>
+  <p>The <dfn title="concept-media-load-resource">resource-load
+  algorithm</dfn> for a <span>media element</span> and a given
+  <span>absolute URL</span> is as follows:</p>
 
-         <li>
+  <ol>
 
-          <p>If either the <span>media resource</span> or the address
-          of the <var title="">current media resource</var> indicate a
-          particular start time, then <span
-          title="dom-media-seek">seek</span> to that time. Ignore any
-          resulting exceptions (if the position is out of range, it is
-          effectively ignored).</p>
+   <li><p>Let the <var title="">current media resource</var> be the
+   resource given by the <span>absolute URL</span> passed to this
+   algorithm. This is now the element's <span>media
+   resource</span>.</p></li>
 
-          <p class="example">For example, a fragment identifier could be
-          used to indicate a start position.</p>
+   <li><p>Set the <code
+   title="dom-media-currentSrc">currentSrc</code> attribute to the
+   <span>absolute URL</span> of the <var title="">current media
+   resource</var>.</p></li>
 
-         </li>
+   <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>
+    <p>Begin to <span>fetch</span> the <var title="">current media
+    resource</var>.</p>
 
-        </ol>
+    <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 class="note">The user agent is <em>required</em> to
-        determine the duration of the <span>media resource</span> and
-        go through this step before playing.</p> <!-- actually defined
-        in the 'duration' section -->
+    <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>
 
-       </dd>
+    <p>User agents may allow users to selectively block or slow
+    <span>media data</span> downloads. When a <span>media
+    element</span>'s download has been blocked altogether, the user
+    agent must act as if it was stalled (as opposed to acting as if
+    the connection was closed). The rate of the download may also be
+    throttled automatically by the user agent, e.g. to balance the
+    download with other connections sharing the same bandwidth.</p>
 
+    <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
+    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-networkState">networkState</code> to <code
+    title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.</p>
 
-       <dt>If the connection is interrupted, causing the user agent to
-       give up trying to fetch the resource</dt>
+    <p>The user agent may use whatever means necessary to fetch the
+    resource (within the constraints put forward by this and other
+    specifications); for example, reconnecting to the server in the
+    face of network errors, using HTTP partial range requests, or
+    switching to a streaming protocol. The user agent must consider a
+    resource erroneous only if it has given up trying to fetch it.</p>
 
-       <dd>
+    <p>The <span>networking task source</span> <span
+    title="concept-task">tasks</span> to process the data as it is
+    being fetched must, when appropriate, include the relevant
+    substeps from the following list:</p>
 
-        <p>Fatal network errors that occur after the user agent has
-        established whether the <var title="">current media
-        resource</var> is usable must cause the user agent to execute
-        the following steps:</p>
+    <dl class="switch">
 
-        <ol>
+     <dt>If the <span>media data</span> cannot be fetched at all, due
+     to network errors, causing the user agent to give up trying to
+     fetch the resource</dt>
 
-         <li>The user agent should cancel the fetching process.</li>
+     <dt>If the <span>media data</span> can be fetched but is in an
+     unsupported format, or can otherwise not be rendered at
+     all</dt>
 
-         <li>Set the <code title="dom-media-error">error</code>
-         attribute to a new <code>MediaError</code> object whose <code
-         title="dom-MediaError-code">code</code> attribute is set to
-         <code
-         title="dom-MediaError-MEDIA_ERR_NETWORK">MEDIA_ERR_NETWORK</code>.</li>
+     <dd>
 
-         <li>Set the <span>begun flag</span> to false and <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>.</li>
+      <p>DNS errors, HTTP 4xx and 5xx errors (and equivalents in
+      other protocols), and other fatal network errors that occur
+      before the user agent has established whether the <var
+      title="">current media resource</var> is usable, as well as
+      the file using an unsupported container format, or using
+      unsupported codecs for all the data, must cause the user agent
+      to execute the following steps:</p>
 
-         <li>Set the element's <code
-         title="dom-media-networkState">networkState</code> attribute
-         to the <span
-         title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</span> value
-         and <span>queue a task</span> to <span>fire a simple
-         event</span> called <code
-         title="event-emptied">emptied</code> at the element.</li>
+      <ol>
 
-         <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>
+       <li><p>The user agent should cancel the fetching
+       process.</p></li>
 
-         <li>Abort the overall <code
-         title="dom-media-load">load()</code> method algorithm.</li>
+       <li><p>Abort this subalgorithm, returning to the <span
+       title="concept-media-load-algorithm">load algorithm</span>.</p>
 
-        </ol>
+      </ol>
 
-       </dd>
+     </dd>
 
-       <dt id="fatal-decode-error">If the <span>media data</span> is
-       corrupted</dt>
 
-       <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</dt>
 
-        <p>Fatal errors in decoding the <span>media data</span> that
-        occur after the user agent has established whether the <var
-        title="">current media resource</var> is usable must cause the
-        user agent to execute the following steps:</p>
+     <dd>
 
-        <ol>
+      <p>This indicates that the resource is usable. The user agent
+      must follow these substeps:</p>
 
-         <li>The user agent should cancel the fetching process.</li>
+      <ol>
 
-         <li>Set the <code title="dom-media-error">error</code>
-         attribute to a new <code>MediaError</code> object whose <code
-         title="dom-MediaError-code">code</code> attribute is set to
-         <code
-         title="dom-MediaError-MEDIA_ERR_DECODE">MEDIA_ERR_DECODE</code>.</li>
+       <li><p>Set the <span>current playback position</span> to the
+       <var>earliest possible position</var>.</p></li>
 
-         <li>Set the <span>begun flag</span> to false and <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>.</li>
+       <li><p>Set the <code
+       title="dom-media-readyState">readyState</code> attribute to
+       <code
+       title="dom-media-HAVE_METADATA">HAVE_METADATA</code>.</p></li>
 
-         <li>Set the element's <code
-         title="dom-media-networkState">networkState</code> attribute
-         to the <span
-         title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</span> value
-         and <span>queue a task</span> to <span>fire a simple
-         event</span> called <code
-         title="event-emptied">emptied</code> at the element.</li>
+       <li><p>For <code>video</code> elements, set the <code
+       title="dom-video-videoWidth">videoWidth</code> and <code
+       title="dom-video-videoHeight">videoHeight</code>
+       attributes.</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>
+       <li>
 
-         <li>Abort the overall <code
-         title="dom-media-load">load()</code> method algorithm.</li>
+        <p>Set the <code title="dom-media-duration">duration</code>
+        attribute to the duration of the resource.</p>
 
-        </ol>
+        <p class="note">The user agent <a
+        href="#durationChange">will</a> <span>queue a task</span> to
+        <span>fire a simple event</span> called <code
+        title="event-durationchange">durationchange</code> at the
+        element at this point.</p>
 
-       </dd>
+       </li>
 
-       <dt>If the <span>media data</span> fetching process is aborted by
-       the user</dt>
+       <li id="fire-loadedmetadata"><p><span>Queue a task</span> to
+       <span>fire a simple event</span> called <code
+       title="event-loadedmetadata">loadedmetadata</code> at the
+       element.</li>
 
-       <dd>
+       <li>
 
-        <p>The fetching process is aborted by the user, e.g. because
-        the user navigated the browsing context to another page, the
-        user agent must execute the following steps. These steps are
-        not followed if the <code title="dom-media-load">load()</code>
-        method itself is reinvoked, as the steps above handle that
-        particular kind of abort.</p>
+        <p>If either the <span>media resource</span> or the address
+        of the <var title="">current media resource</var> indicate a
+        particular start time, then <span
+        title="dom-media-seek">seek</span> to that time. Ignore any
+        resulting exceptions (if the position is out of range, it is
+        effectively ignored).</p>
 
-        <ol>
+        <p class="example">For example, a fragment identifier could be
+        used to indicate a start position.</p>
 
-         <li>The user agent should cancel the fetching process.</li>
+       </li>
 
-         <li>Set the <code title="dom-media-error">error</code>
-         attribute to a new <code>MediaError</code> object whose <code
-         title="dom-MediaError-code">code</code> attribute is set to
-         <code
-         title="dom-MediaError-MEDIA_ERR_ABORT">MEDIA_ERR_ABORT</code>.</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>
 
-         <li>Set the <span>begun flag</span> to false and <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>.</li>
+      </ol>
 
-         <li>If the <span>media element</span>'s <code
-         title="dom-media-readyState">readyState</code> attribute has
-         a value equal to <code
-         title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, set the
-         element's <code
-         title="dom-media-networkState">networkState</code> attribute
-         to the <span
-         title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</span> value
-         and <span>queue a task</span> to <span>fire a simple
-         event</span> called <code
-         title="event-emptied">emptied</code> at the element. (If the
-         <code title="dom-media-readyState">readyState</code>
-         attribute has a value greater than <code
-         title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, then this
-         doesn't happen; the available data, if any, will be
-         playable.)</li>
+      <p class="note">The user agent is <em>required</em> to
+      determine the duration of the <span>media resource</span> and
+      go through this step before playing.</p> <!-- actually defined
+      in the 'duration' section -->
 
-         <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>
+     </dd>
 
-         <li>Abort the overall <code
-         title="dom-media-load">load()</code> method algorithm.</li>
 
-        </ol>
+     <dt>If the connection is interrupted, causing the user agent to
+     give up trying to fetch the resource</dt>
 
-       </dd>
+     <dd>
 
-       <dt id="non-fatal-media-error">If the <span>media data</span> can
-       be fetched but has non-fatal errors or uses, in part, codecs that
-       are unsupported, preventing the user agent from rendering the
-       content completely correctly but not preventing playback
-       altogether</dt>
+      <p>Fatal network errors that occur after the user agent has
+      established whether the <var title="">current media
+      resource</var> is usable must cause the user agent to execute
+      the following steps:</p>
 
-       <dd>
+      <ol>
 
-        <p>The server returning data that is partially usable but cannot
-        be optimally rendered must cause the user agent to execute the
-        following steps.</p>
+       <li><p>The user agent should cancel the fetching
+       process.</p></li>
 
-        <ol>
+       <li><p>Set the <code title="dom-media-error">error</code>
+       attribute to a new <code>MediaError</code> object whose <code
+       title="dom-MediaError-code">code</code> attribute is set to
+       <code
+       title="dom-MediaError-MEDIA_ERR_NETWORK">MEDIA_ERR_NETWORK</code>.</p></li>
 
-         <li class="XXX">Should we fire a 'warning' event? Set the
-         'error' flag to 'MEDIA_ERR_SUBOPTIMAL' or something?</li>
+       <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>
 
-        </ol>
+       <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>
+       value and <span>queue a task</span> to <span>fire a simple
+       event</span> called <code title="event-emptied">emptied</code>
+       at the element.</p></li>
 
-       </dd>
+       <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>
 
-      </dl>
+       <li><p>Abort the overall <span
+       title="concept-media-load-algorithm">load
+       algorithm</span>.</p></li>
 
-      <p>When the user agent has completely fetched of the entire
-      <span>media resource</span>, it must move on to the next
-      step. This might never happen, e.g. when streaming an infinite
-      resource such as Web radio.</p>
+      </ol>
 
-     </li>
+     </dd>
 
-     <li><p>If the fetching process completes without errors, then set
-     the <span>begun flag</span> to false, 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>
+     <dt id="fatal-decode-error">If the <span>media data</span> is
+     corrupted</dt>
 
-     <li>Then, abort the overall <code
-     title="dom-media-load">load()</code> method algorithm.</li>
+     <dd>
 
-    </ol>
+      <p>Fatal errors in decoding the <span>media data</span> that
+      occur after the user agent has established whether the <var
+      title="">current media resource</var> is usable must cause the
+      user agent to execute the following steps:</p>
 
-   </li>
+      <ol>
 
-   <li>
+       <li><p>The user agent should cancel the fetching
+       process.</p></li>
 
-    <p><i>Failure step</i>: No usable resource was found. Run the
-    following steps:</p>
+       <li><p>Set the <code title="dom-media-error">error</code>
+       attribute to a new <code>MediaError</code> object whose <code
+       title="dom-MediaError-code">code</code> attribute is set to
+       <code
+       title="dom-MediaError-MEDIA_ERR_DECODE">MEDIA_ERR_DECODE</code>.</p></li>
 
-    <ol>
+       <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>
 
-     <li>Set the <code title="dom-media-error">error</code> attribute
-     to a new <code>MediaError</code> object whose <code
-     title="dom-MediaError-code">code</code> attribute is set to <code
-     title="dom-MediaError-MEDIA_ERR_NONE_SUPPORTED">MEDIA_ERR_NONE_SUPPORTED</code>.</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>
+       value and <span>queue a task</span> to <span>fire a simple
+       event</span> called <code title="event-emptied">emptied</code>
+       at the element.</p></li>
 
-     <li>Set the <span>begun flag</span> to false and <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>.</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>
 
-     <li>Set the element's <code
-     title="dom-media-networkState">networkState</code> attribute to
-     the <span title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</span>
-     value and <span>queue a task</span> to <span>fire a simple
-     event</span> called <code title="event-emptied">emptied</code> at
-     the element.</li>
+       <li><p>Abort the overall <span
+       title="concept-media-load-algorithm">load
+       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>
+      </ol>
 
-    </ol>
+     </dd>
 
+     <dt>If the <span>media data</span> fetching process is aborted by
+     the user</dt>
+
+     <dd>
+
+      <p>The fetching process is aborted by the user, e.g. because the
+      user navigated the browsing context to another page, the user
+      agent must execute the following steps. These steps are not
+      followed if the <code title="dom-media-load">load()</code>
+      method itself is invoked while these steps are running, as the
+      steps above handle that particular kind of abort.</p>
+
+      <ol>
+
+       <li><p>The user agent should cancel the fetching
+       process.</p></li>
+
+       <li><p>Set the <code title="dom-media-error">error</code>
+       attribute to a new <code>MediaError</code> object whose <code
+       title="dom-MediaError-code">code</code> attribute is set to
+       <code
+       title="dom-MediaError-MEDIA_ERR_ABORT">MEDIA_ERR_ABORT</code>.</p></li>
+
+       <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>
+
+       <li><p>If the <span>media element</span>'s <code
+       title="dom-media-readyState">readyState</code> attribute has a
+       value equal to <code
+       title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>, set the
+       element's <code
+       title="dom-media-networkState">networkState</code> attribute to
+       the <span title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</span>
+       value and <span>queue a task</span> to <span>fire a simple
+       event</span> called <code title="event-emptied">emptied</code>
+       at the element. Otherwise, set set the element's <code
+       title="dom-media-networkState">networkState</code> attribute to
+       the <span title="dom-media-NETWORK_IDLE">NETWORK_IDLE</span>
+       value.</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>
+
+       <li><p>Abort the overall <span
+       title="concept-media-load-algorithm">load
+       algorithm</span>.</p></li>
+
+      </ol>
+
+     </dd>
+
+     <dt id="non-fatal-media-error">If the <span>media data</span> can
+     be fetched but has non-fatal errors or uses, in part, codecs that
+     are unsupported, preventing the user agent from rendering the
+     content completely correctly but not preventing playback
+     altogether</dt>
+
+     <dd>
+
+      <p>The server returning data that is partially usable but cannot
+      be optimally rendered must cause the user agent to execute the
+      following steps.</p>
+
+      <ol>
+
+       <li class="XXX">Should we fire a 'warning' event? Set the
+       'error' flag to 'MEDIA_ERR_SUBOPTIMAL' or something?</li>
+
+      </ol>
+
+     </dd>
+
+    </dl>
+
+    <p>When the user agent has completely fetched of the entire
+    <span>media resource</span>, it 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, then 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>
+
+   <li><p>Then, abort the overall <span
+   title="concept-media-load-algorithm">load
+   algorithm</span>.</p></li>
+
   </ol>
 
   <p>If a <span>media element</span> whose <code
   title="dom-media-networkState">networkState</code> has the value
   <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> is <span
   title="insert an element into a document">inserted into a
-  document</span>, the user agent must <span>queue a task</span> that
-  implicitly invokes the <code title="dom-media-load">load()</code>
-  method on the <span>media element</span>, and ignores any resulting
-  exceptions. The <span>task source</span> for this task is the
-  <span>media element</span>'s own <span>media element new resource
-  task source</span>.</p>
+  document</span>, the user agent must asynchronously invoke the
+  <span>media element</span>'s <span
+  title="concept-media-load-algorithm">load algorithm</span>.</p>
 
   <p>The <dfn
   title="dom-media-bufferingRate"><code>bufferingRate</code></dfn>
@@ -20983,10 +21049,9 @@
    title="dom-media-networkState">networkState</code> attribute has
    the value <code
    title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, then the user
-   agent must invoke the <code title="dom-media-load">load()</code>
-   method and wait for it to return. If that raises an exception, that
-   exception must be reraised by the <code
-   title="dom-media-play">play()</code> method.</p></li>
+   agent must invoke the <span>media element</span>'s <span
+   title="concept-media-load-algorithm">load
+   algorithm</span>.</p></li>
 
    <li>
 
@@ -21011,7 +21076,8 @@
     be set to false.</p>
 
     <p>If this changed the value of <code
-    title="dom-media-paused">paused</code>, the user agent must run the following substeps:</p>
+    title="dom-media-paused">paused</code>, the user agent must run
+    the following substeps:</p>
 
     <ol>
 
@@ -21020,18 +21086,19 @@
 
      <li><p>If the <span>media element</span>'s <code
      title="dom-media-readyState">readyState</code> attribute has the
-     value <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code>
-     or <code
+     value <code title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code>,
+     <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code>, or
+     <code
      title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>,
      <span>queue a task</span> to <span>fire a simple event</span>
      called <code title="event-waiting">waiting</code> at the
      element.</p></li>
 
      <li><p>Otherwise, the <span>media element</span>'s <code
-     title="dom-media-readyState">readyState</code> attribute has the value
-     <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>
-     or <code
-     title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>;
+     title="dom-media-readyState">readyState</code> attribute has the
+     value <code
+     title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or
+     <code title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>;
      <span>queue a task</span> to <span>fire a simple event</span>
      called <code title="event-playing">playing</code> at the
      element.</p></li>
@@ -21058,10 +21125,9 @@
    title="dom-media-networkState">networkState</code> attribute has
    the value <code
    title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>, then the user
-   agent must invoke the <code title="dom-media-load">load()</code>
-   method and wait for it to return. If that raises an exception, that
-   exception must be reraised by the <code
-   title="dom-media-play">pause()</code> method.</p></li>
+   agent must invoke the <span>media element</span>'s <span
+   title="concept-media-load-algorithm">load
+   algorithm</span>.</p></li>
 
    <li><p>If the <span>media element</span>'s <code
    title="dom-media-paused">paused</code> attribute is false, it must
@@ -21070,8 +21136,6 @@
    <li><p>The <span>media element</span>'s <span>autoplaying
    flag</span> must be set to false.</p></li>
 
-   <li><p>The method must then return.</p></li>
-
    <li><p>If the second step above changed the value of <code
    title="dom-media-paused">paused</code>, then the user agent must
    <span>queue a task</span> to <span>fire a simple event</span>
@@ -21488,7 +21552,7 @@
     <tr>
      <td><dfn title="event-loadstart"><code>loadstart</code></dfn>
      <td><code>ProgressEvent</code> <a href="#refsPROGRESS">[PROGRESS]</a>
-     <td>The user agent begins fetching the <span>media data</span>, synchronously during the <code title="dom-media-load">load()</code> method call.
+     <td>The user agent begins looking for <span>media data</span>, as part of the <span title="concept-media-load-algorithm">load algorithm</span>.
      <td><code title="dom-media-networkState">networkState</code> equals <code title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>
     <tr>
      <td><dfn title="event-progress"><code>progress</code></dfn>
@@ -21508,7 +21572,7 @@
     <tr>
      <td><dfn title="event-abort"><code>abort</code></dfn>
      <td><code>ProgressEvent</code> <a href="#refsPROGRESS">[PROGRESS]</a>
-     <td>The user agent stops fetching the <span>media data</span> before it is completely downloaded. This can be fired synchronously during the <code title="dom-media-load">load()</code> method call.
+     <td>The user agent stops fetching the <span>media data</span> before it is completely downloaded.
      <td><code title="dom-media-error">error</code> is an object with the code <code title="dom-MediaError-MEDIA_ERR_ABORTED">MEDIA_ERR_ABORTED</code>.
          <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>
@@ -21520,7 +21584,7 @@
     <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 reinvoked, in which case it is fired synchronously during the <code title="dom-media-load">load()</code> method call).
+     <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">load algorithm</span> was already running, in which case it is fired synchronously during the <code title="dom-media-load">load()</code> method call).
      <td><code title="dom-media-networkState">networkState</code> is <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code>; all the DOM attributes are in their initial states.
     <tr>
      <td><dfn title="event-stalled"><code>stalled</code></dfn>

|