hixie: Make networkState changes have better-defined order relative to 'suspend' and 'progress' events. (whatwg r6545)

hixie: Make networkState changes have better-defined order relative to
'suspend' and 'progress' events. (whatwg r6545)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5243&r2=1.5244&f=h
http://html5.org/tools/web-apps-tracker?from=6544&to=6545

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.5243
retrieving revision 1.5244
diff -u -d -r1.5243 -r1.5244
--- Overview.html 8 Sep 2011 20:48:53 -0000 1.5243
+++ Overview.html 8 Sep 2011 21:59:02 -0000 1.5244
@@ -22643,6 +22643,8 @@
      event</a> named <code title="event-media-suspend"><a href="#event-media-suspend">suspend</a></code> at the
      element.</li>
 
+     <li><p>Wait for the task to be run.</li>
+
      <li><p>Wait for an implementation-defined event (e.g. the user
      requesting that the media element begin playback).</li>
 
@@ -22668,9 +22670,10 @@
     <code><a href="#the-canvas-element">canvas</a></code> gets tainted when the video is drawn on
     it.</p>
 
-    <p>Every 350ms (&plusmn;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-simple-event">fire a simple event</a> named <code title="event-media-progress"><a href="#event-media-progress">progress</a></code> at the element.</p>
+    <p>While the load is not suspended (see below), every 350ms
+    (&plusmn;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-simple-event">fire a
+    simple event</a> named <code title="event-media-progress"><a href="#event-media-progress">progress</a></code> at the element.</p>
 
     <p>The <dfn id="stall-timeout">stall timeout</dfn> is a user-agent defined length of
     time, which should be about three seconds. When a <a href="#media-element">media
@@ -22687,16 +22690,18 @@
     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 <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-simple-event">fire a simple event</a> named <code title="event-media-suspend"><a href="#event-media-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>
+    <p id="resourceSuspend">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
+    <a href="#queue-a-task">queue a task</a> to 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="#fire-a-simple-event">fire
+    a simple event</a> named <code title="event-media-suspend"><a href="#event-media-suspend">suspend</a></code> at the element. If and
+    when downloading of the resource resumes, the user agent must
+    <a href="#queue-a-task">queue a task</a> to 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>. Between
+    the queuing of these tasks, the load is suspended (so <code title="event-media-progress"><a href="#event-media-progress">progress</a></code> events don't fire, as
+    described above).</p>
 
     <p class="note">The <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code> attribute provides a
     hint regarding how much buffering the author thinks is advisable,
@@ -22878,8 +22883,10 @@
         <p class="note">A user agent that is attempting to reduce
         network usage while still fetching the metadata for each
         <a href="#media-resource">media resource</a> would also stop buffering at this
-        point, causing the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute
-        to switch to the <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code> value.</p>
+        point, following <a href="#resourceSuspend">the rules
+        described previously</a>, which involve the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute
+        switching to the <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code> value and a
+        <code title="event-suspend">suspend</code> event firing.</p>
 
        </li>
 
@@ -22898,10 +22905,19 @@
       named <code title="event-media-progress"><a href="#event-media-progress">progress</a></code> at the
       <a href="#media-element">media element</a>.</p>
 
-      <p>Then, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
-      event</a> named <code title="event-media-suspend"><a href="#event-media-suspend">suspend</a></code> at the <a href="#media-element">media
+      <p>Then, <a href="#queue-a-task">queue a task</a> to 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="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-suspend"><a href="#event-media-suspend">suspend</a></code> at the <a href="#media-element">media
       element</a>.</p>
 
+      <p>If the user agent ever discards any <a href="#media-data">media data</a>
+      and then needs to resume the network activity to obtain it
+      again, then it must wait <a href="#queue-a-task">queue a task</a> to 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 class="note">If the user agent can keep the <a href="#media-resource">media
+      resource</a> loaded, then the algorithm will continue to its
+      final step below, which aborts the algorithm.</p>
      </dd>
 
 
@@ -23081,6 +23097,7 @@
 
    </li>
 
+   
    <li><p>If the user agent ever reaches this step (which can only
    happen if the entire resource gets loaded and kept available):
    abort the overall <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection

Received on Thursday, 8 September 2011 21:59:12 UTC