HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2082Further work on the event loop front.2008-08-19 06:52
@@ -16707,43 +16707,48 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
    <li><p>The user agent must then begin to <span>fetch</span> the
    <span>chosen media resource</span>. The rate of the download may be
    throttled, however, in response to user preferences (including
    throttling it to zero until the user indicates that the download
    can start), or to balance the download with other connections
    sharing the same bandwidth.</p></li>
 
    <li>
 
     <p>While the fetching process is progressing, the user agent must
-    <span>fire a progress event</span> called <code
-    title="event-progress">progress</code> at the element every 350ms
-    (&#xB1;200ms) or for every byte received, whichever is
+    <span>queue a task</span> to <span>fire a progress event</span>
+    called <code title="event-progress">progress</code> at the element
+    every 350ms (&#xB1;200ms) or for every byte received, whichever is
     <em>least</em> frequent.</p>
 
     <p>If at any point the user agent has received no data for more
-    than about three seconds, the user agent must <span>fire a
-    progress event</span> called <code
+    than about three seconds, the user agent must <span>queue a
+    task</span> to <span>fire a progress event</span> called <code
     title="event-stalled">stalled</code> at the element.</p>
 
     <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, the user agent must
     act as if it was stalled (as opposed to acting as if the
     connection was closed).</p>
 
     <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>
 
+    <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>
+
     <dl class="switch">
 
      <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>
 
      <dd>
 
       <p>DNS errors and HTTP 4xx and 5xx errors (and equivalents in
       other protocols) must cause the user agent to execute the
@@ -16754,30 +16759,32 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
 
        <li>The user agent should cancel the fetching process.</li>
 
        <li>The <code title="dom-media-error">error</code> attribute
        must be set 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>
 
        <li>The <span>begun flag</span> must be set to false and the
-       user agent must <span>fire a progress event</span> called <code
+       user agent must <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>The element's <code
        title="dom-media-networkState">networkState</code> attribute
        must be switched to the <span
        title="dom-media-EMPTY">EMPTY</span> value and the user agent
-       must <span>fire a simple event</span> called <code
-       title="event-emptied">emptied</code> at the element.</li>
+       must <span>queue a task</span> to <span>fire a simple
+       event</span> called <code title="event-emptied">emptied</code>
+       at the element.</li>
 
        <li>These steps must be aborted.</li>
 
       </ol>
 
      </dd>
 
      <dt id="fatal-decode-error">If the <span>media data</span> can be
      fetched but is in an unsupported format, or can otherwise not be
      rendered at all</dt>
@@ -16797,30 +16804,32 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
 
        <li>The user agent should cancel the fetching process.</li>
 
        <li>The <code title="dom-media-error">error</code> attribute
        must be set 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>The <span>begun flag</span> must be set to false and the
-       user agent must <span>fire a progress event</span> called <code
+       user agent must <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>The element's <code
        title="dom-media-networkState">networkState</code> attribute
        must be switched to the <span
        title="dom-media-EMPTY">EMPTY</span> value and the user agent
-       must <span>fire a simple event</span> called <code
-       title="event-emptied">emptied</code> at the element.</li>
+       must <span>queue a task</span> to <span>fire a simple
+       event</span> called <code title="event-emptied">emptied</code>
+       at the element.</li>
 
        <li>These steps must be aborted.</li>
 
       </ol>
 
      </dd>
 
      <dt>If the <span>media data</span> fetching process is aborted by
      the user</dt>
 
@@ -16837,35 +16846,37 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
 
        <li>The user agent should cancel the fetching process.</li>
 
        <li>The <code title="dom-media-error">error</code> attribute
        must be set 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>The <span>begun flag</span> must be set to false and the
-       user agent must <span>fire a progress event</span> called <code
+       user agent must <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>
 
        <li>If the <span>media element</span>'s <code
        title="dom-media-networkState">networkState</code> attribute
        has the value <code title="dom-media-LOADING">LOADING</code>,
        the element's <code
        title="dom-media-networkState">networkState</code> attribute
        must be switched to the <span
        title="dom-media-EMPTY">EMPTY</span> value and the user agent
-       must <span>fire a simple event</span> called <code
-       title="event-emptied">emptied</code> at the element. (If the
-       <code title="dom-media-networkState">networkState</code>
-       attribute has a value greater than <code
+       must <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-networkState">networkState</code> attribute
+       has a value greater than <code
        title="dom-media-LOADING">LOADING</code>, then this doesn't
        happen; the available data, if any, will be playable.)</li>
 
        <li>These steps must be aborted.</li>
 
       </ol>
 
      </dd>
 
      <dt id="non-fatal-media-error">If the <span>media data</span> can
@@ -16907,28 +16918,29 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
        must be set to <code
        title="dom-media-LOADED_METADATA">LOADED_METADATA</code>.</p></li>
 
        <li><p class="note">A number of attributes, including <code
        title="dom-media-duration">duration</code>, <code
        title="dom-media-buffered">buffered</code>, and <code
        title="dom-media-played">played</code>, become
        available.</p></li>
 
        <li><p class="note">The user agent <a
-       href="#durationUpdate">will</a> <span>fire a simple
-       event</span> called <code
+       href="#durationUpdate">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.</li>
 
-       <li><p>The user agent must <span>fire a simple event</span>
-       called <code title="event-loadedmetadata">loadedmetadata</code>
-       at the element.</li>
+       <li><p>The user agent must <span>queue a task</span> to
+       <span>fire a simple event</span> called <code
+       title="event-loadedmetadata">loadedmetadata</code> at the
+       element.</li>
 
       </ol>
 
      </dd>
 
      <dt id="handling-first-frame-available">Once enough of the
      <span>media data</span> has been fetched to enable the user agent
      to display the frame at the <span>effective start</span> of the
      <span>media resource</span></dt>
 
@@ -16944,47 +16956,48 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
        title="dom-media-LOADED_FIRST_FRAME">LOADED_FIRST_FRAME</code>.</p></li>
 
        <li><p>The <code
        title="dom-media-readyState">readyState</code> attribute must
        change to <code
        title="dom-media-CAN_SHOW_CURRENT_FRAME">CAN_SHOW_CURRENT_FRAME</code>.</p></li>
 
        <li><p>The <span>loaded-first-frame flag</span> must be set to
        true.</p></li>
 
-       <li><p>The user agent must <span>fire a simple event</span>
-       called <code
-       title="event-loadedfirstframe">loadedfirstframe</code> at
-       the element.</li>
+       <li><p>The user agent must <span>queue a task</span> to
+       <span>fire a simple event</span> called <code
+       title="event-loadedfirstframe">loadedfirstframe</code> at the
+       element.</li>
 
-       <li><p>The user agent must <span>fire a simple event</span>
-       called <code
+       <li><p>The user agent must <span>queue a task</span> to
+       <span>fire a simple event</span> called <code
        title="event-canshowcurrentframe">canshowcurrentframe</code> at
        the element.</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.</p>
 
    </li>
 
    <li><p>If the fetching process completes without errors, the
    <span>begun flag</span> must be set to false, the <code
    title="dom-media-networkState">networkState</code> attribute must
    be set to <code title="dom-media-LOADED">LOADED</code>, and the
-   user agent must <span>fire a progress event</span> called <code
-   title="event-load">load</code> at the element.</p></li>
+   user agent must <span>queue a task</span> to <span>fire a progress
+   event</span> called <code title="event-load">load</code> at the
+   element.</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-EMPTY">EMPTY</code> is inserted into a
   document, 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
@@ -17470,23 +17483,21 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   playing</span> stops playing because it has <span>paused for user
   interaction</span>, the user agent must <span>queue a task</span> to
   <span>fire a simple event</span> called <code
   title="event-timeupdate">timeupdate</code> at the element.</p>
 
   <p>When <code title="dom-media-currentLoop">currentLoop</code> is
   less than <span><code
   title="dom-media-playCount">playCount</code>-1</span> and the
   <span>current playback position</span> reaches the <var>effective
   loop end</var>, then the user agent must increase <code
-  title="dom-media-currentLoop">currentLoop</code> by 1, <span>queue a
-  task</span> to <span>fire a simple event</span> called <code
-  title="event-timeupdate">timeupdate</code>, and <span
+  title="dom-media-currentLoop">currentLoop</code> by 1 and <span
   title="dom-media-seek">seek</span> to the <var>effective loop
   start</var>.</p>
 
   <p>When <code title="dom-media-currentLoop">currentLoop</code> is
   equal to the <span><code
   title="dom-media-playCount">playCount</code>-1</span> and the
   <span>current playback position</span> reaches the <var>effective
   end</var>, then the user agent must follow these steps:</p>
 
   <ol>
@@ -17557,59 +17568,57 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
 
    <li>
 
     <p>If the <span title="ended playback">playback has ended</span>,
     then the user agent must set <code
     title="dom-media-currentLoop">currentLoop</code> to zero and <span
     title="dom-media-seek">seek</span> to the <var>effective
     start</var>.</p>
 
     <p class="note">If this involved a seek, the user agent <a
-    href="#seekUpdate">will</a> <span>fire a simple event</span>
-    called <code title="event-timeupdate">timeupdate</code> at the
-    <span>media element</span>.</p>
+    href="#seekUpdate">will</a> <span>queue a task</span> to
+    <span>fire a simple event</span> called <code
+    title="event-timeupdate">timeupdate</code> at the <span>media
+    element</span>.</p>
 
    </li>
 
    <li>
 
     <p>The <code title="dom-media-playbackRate">playbackRate</code>
     attribute must be set to the value of the <code
     title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>
     attribute.</p>
 
     <p class="note">If this caused the <code
     title="dom-media-playbackRate">playbackRate</code> attribute to
     change value, the user agent <a href="#rateUpdate">will</a>
-    <span>fire a simple event</span> called <code
-    title="event-ratechange">ratechange</code> at the <span>media
-    element</span>.</p>
+    <span>queue a task</span> to <span>fire a simple event</span>
+    called <code title="event-ratechange">ratechange</code> at the
+    <span>media element</span>.</p>
 
    </li>
 
    <li><p>If the <span>media element</span>'s <code
    title="dom-media-paused">paused</code> attribute is true, it must
    be set to false.</p></li>
 
    <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 fourth step above changed the value of <code
-   title="dom-media-paused">paused</code>, the user agent must, after
-   any running scripts have finished executing, and after any other
-   events triggered by this algorithm (specifically <code
-   title="event-timeupdate">timeupdate</code> and <code
-   title="event-ratechange">ratechange</code>) have fired, <span>fire
-   a simple event</span> called <code title="event-pause">play</code>
-   at the element.</p></li><!-- xxx queue -->
+   title="dom-media-paused">paused</code>, the user agent must
+   <span>queue a task</span> to <span>fire a simple event</span>
+   called <code title="event-pause">play</code> at the
+   element.</p></li>
 
   </ol>
 
 
   <p>When the <dfn title="dom-media-pause"><code>pause()</code></dfn>
   method is invoked, the user agent must run the following steps:</p>
 
   <ol>
 
    <li><p>If the <span>media element</span>'s <code

|