HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2080More poking around getting the media element section to use the new event loop stuff.2008-08-19 00:57
@@ -16195,21 +16195,21 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   are honoured.</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-EMPTY">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>new resource task source</span>.</p>
+  <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
   title="dom-source-media"><code>media</code></dfn> must
   <span>reflect</span> the respective content attributes of the same
   name.</p>
 
   <p>The DOM attribute <dfn
   title="dom-source-pixelRatio"><code>pixelRatio</code></dfn> must
@@ -16329,20 +16329,29 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   -->
 
   <p><span title="media element">Media elements</span> are used to
   present audio data, or video and audio data, to the user. This is
   referred to as <dfn>media data</dfn> in this section, since this
   section applies equally to <span title="media element">media
   elements</span> for audio or for video. The term <dfn>media
   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, all the tasks <span
+  title="queue a task">queued</span> in this section and its
+  subsections use the <span>media element event task
+  source</span>.</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
@@ -16388,22 +16397,22 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   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-EMPTY">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>new resource task
-  source</span>.</p>
+  <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 content attribute of the same name.</p>
@@ -16571,24 +16580,33 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   true state.</p>
 
   <p>When the <dfn title="dom-media-load"><code>load()</code></dfn>
   method on a <span>media element</span> is invoked, the user agent
   must run the following steps. Note that this algorithm might get
   aborted, e.g. if the <code title="dom-media-load">load()</code>
   method itself is invoked again.</p>
 
   <ol>
 
-   <li><p>If there are any <span title="concept-task">tasks</span>
-   from the <span>media element</span>'s own <dfn>new resource task
-   source</dfn> in one of the <span title="task queue">task
-   queues</span>, then remove those tasks.</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
+    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>
+
+   </li>
 
    <li><p>Any already-running instance of this algorithm for this
    element must be aborted. 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>If the element's <span>begun flag</span> is true, then the
    <span>begun flag</span> must be set to false, the <code
    title="dom-media-error">error</code> attribute must be set to a new
@@ -16962,22 +16980,22 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
 
   </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
-  <span>media element</span>'s own <span>new resource task
-  source</span>.</p>
+  <span>media element</span>'s own <span>media element new resource
+  task source</span>.</p>
 
   <p>The <dfn
   title="dom-media-bufferingRate"><code>bufferingRate</code></dfn>
   attribute must return the average number of bits received per second
   for the current download over the past few seconds. If there is no
   download in progress, the attribute must return 0.</p>
 
   <p>The <dfn
   title="dom-media-bufferingThrottled"><code>bufferingThrottled</code></dfn>
   attribute must return true if the user agent is intentionally
@@ -17027,24 +17045,24 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   in seconds. If no <span>media data</span> is available, then the
   attributes must return 0. If <span>media data</span> is available
   but the length is not known, the attribute must return the
   Not-a-Number (NaN) value. If the <span>media resource</span> is
   known to be unbounded (e.g. a streaming radio), then the attribute
   must return the positive Infinity value.</p>
 
   <p>When the length of the <span>media resource</span> changes
   (e.g. from being unknown to known, or from indeterminate to known,
   or from a previously established length to a new length) the user
-  agent must, once any running scripts have finished, <span>fire a
-  simple event</span> called <code
+  agent must <span>queue a task</span> to <span>fire a simple
+  event</span> called <code
   title="event-durationchange">durationchange</code> at the
-  <span>media element</span>.</p><!-- xxx queue -->
+  <span>media element</span>.</p>
 
   <p><span title="media element">Media elements</span> have a
   <dfn>current playback position</dfn>, which must initially be
   zero. The current position is a time.</p>
 
   <p>The <dfn
   title="dom-media-currentTime"><code>currentTime</code></dfn>
   attribute must, on getting, return the <span>current playback
   position</span>, expressed in seconds. On setting, the user agent
   must <span title="dom-media-seek">seek</span> to the new value
@@ -17434,62 +17452,63 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   fashion (so that the relevant events fire).</p>
 
   <p id="fire-waiting-when-waiting">When a <span>media element</span>
   that is <span>actively playing</span> stops playing because its
   <code title="dom-media-readyState">readyState</code> attribute
   changes to a value lower than <code
   title="dom-media-CAN_PLAY">CAN_PLAY</code>, without the element
   having <span>ended playback</span>, or playback having <span>stopped
   due to errors</span>, or playback having <span>paused for user
   interaction</span>, or the <span title="dom-media-seek">seeking
-  algorithm</span> being invoked, the user agent must <span>fire a
-  simple event</span> called <code
-  title="event-timeupdate">timeupdate</code> at the element, and then
-  must <span>fire a simple event</span> called <code
-  title="event-waiting">waiting</code> at the element.</p><!-- xxx queue -->
+  algorithm</span> being invoked, 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, and
+  <span>queue a task</span> to <span>fire a simple event</span> called
+  <code title="event-waiting">waiting</code> at the element.</p>
 
   <p>When a <span>media element</span> that is <span>actively
   playing</span> stops playing because it has <span>paused for user
-  interaction</span>, the user agent must <span>fire a simple
-  event</span> called <code title="event-timeupdate">timeupdate</code>
-  at the element.</p><!-- xxx queue -->
+  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 <span
+  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-seek">seek</span> to the <var>effective loop
-  start</var>, increase <code
-  title="dom-media-currentLoop">currentLoop</code> by 1, and
-  <span>fire a simple event</span> called <code
-  title="event-timeupdate">timeupdate</code>.</p><!-- xxx queue -->
+  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>
 
    <li><p>The user agent must stop playback.</p></li>
 
    <li><p class="note">The <code title="dom-media-ended">ended</code>
    attribute becomes true.</p></li>
 
-   <li><p>The user agent must <span>fire a simple event</span> called
-   <code title="event-timeupdate">timeupdate</code> at the
-   element.</p></li><!-- xxx queue -->
+   <li><p>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></li>
 
-   <li><p>The user agent must <span>fire a simple event</span> called
-   <code title="event-ended">ended</code> at the element.</p></li>
+   <li><p>The user agent must <span>queue a task</span> to <span>fire
+   a simple event</span> called <code title="event-ended">ended</code>
+   at the element.</p></li>
 
   </ol>
 
   <p>The <dfn
   title="dom-media-defaultPlaybackRate"><code>defaultPlaybackRate</code></dfn>
   attribute gives the desired speed at which the <span>media
   resource</span> is to play, as a multiple of its intrinsic
   speed. The attribute is mutable, but on setting, if the new value is
   0.0, a <code>NOT_SUPPORTED_ERR</code> exception must be raised
   instead of the value being changed. It must initially have the value
@@ -17507,27 +17526,27 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
   <code>NOT_SUPPORTED_ERR</code> exception must be raised instead of
   the value being changed. Otherwise, the playback must change speed
   (if the element is <span>actively playing</span>). It must initially
   have the value 1.0.</p>
 
   <p>When the <code
   title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code> or
   <code title="dom-media-playbackRate">playbackRate</code> attributes
   change value (either by being set by script or by being changed
   directly by the user agent, e.g. in response to user control) the
-  user agent must, once any running scripts have finished, <span>fire
+  user agent must <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><!-- xxx queue -->
-
+  element</span>.</p>
 
 
+  <hr>
 
   <p>When the <dfn title="dom-media-play"><code>play()</code></dfn>
   method on a <span>media element</span> is invoked, the user agent
   must run the following steps.</p>
 
   <ol>
 
    <li><p>If the <span>media element</span>'s <code
    title="dom-media-networkState">networkState</code> attribute has
    the value <span title="dom-media-EMPTY">EMPTY</span>, then the user

|