Permalink
Browse files

[] (0) Further work on the event loop front.

git-svn-id: http://svn.whatwg.org/webapps@2082 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent 80eca15 commit d880f94128e5db92411a3b064080f69f3cb09b8e @Hixie Hixie committed Aug 19, 2008
Showing with 117 additions and 100 deletions.
  1. +63 −55 index
  2. +54 −45 source
View
118 index
@@ -19217,15 +19217,17 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
<li>
<p>While the fetching process is progressing, the user agent must <a
- href="#firing6">fire a progress event</a> called <code
- title=event-progress><a href="#progress0">progress</a></code> at the
- element every 350ms (&#xB1;200ms) or for every byte received, whichever
- is <em>least</em> frequent.</p>
+ href="#queue">queue a task</a> to <a href="#firing6">fire a progress
+ event</a> called <code title=event-progress><a
+ href="#progress0">progress</a></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 <a href="#firing6">fire a
- progress event</a> called <code title=event-stalled><a
- href="#stalled">stalled</a></code> at the element.</p>
+ about three seconds, the user agent must <a href="#queue">queue a
+ task</a> to <a href="#firing6">fire a progress event</a> called <code
+ title=event-stalled><a href="#stalled">stalled</a></code> at the
+ element.</p>
<p>User agents may allow users to selectively block or slow <a
href="#media9">media data</a> downloads. When a <a href="#media7">media
@@ -19239,6 +19241,11 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
The user agent must consider a resource erroneous only if it has given
up trying to fetch it.</p>
+ <p>The <a href="#networking">networking task source</a> <a href="#tasks"
+ title=concept-task>tasks</a> 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 <a href="#media9">media data</a> cannot be fetched at all,
due to network errors, causing the user agent to give up trying to
@@ -19261,16 +19268,18 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
href="#mediaerrnetwork">MEDIA_ERR_NETWORK</a></code>.
<li>The <a href="#begun">begun flag</a> must be set to false and the
- user agent must <a href="#firing6">fire a progress event</a> called
- <code title=event-error><a href="#error1">error</a></code> at the <a
+ user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing6">fire a progress event</a> called <code
+ title=event-error><a href="#error1">error</a></code> at the <a
href="#media7">media element</a>.
<li>The element's <code title=dom-media-networkState><a
href="#networkstate">networkState</a></code> attribute must be
switched to the <a href="#empty" title=dom-media-EMPTY>EMPTY</a>
- value and the user agent must <a href="#firing2">fire a simple
- event</a> called <code title=event-emptied><a
- href="#emptied">emptied</a></code> at the element.
+ value and the user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-emptied><a href="#emptied">emptied</a></code> at the
+ element.
<li>These steps must be aborted.
</ol>
@@ -19300,16 +19309,18 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
href="#mediaerrdecode">MEDIA_ERR_DECODE</a></code>.
<li>The <a href="#begun">begun flag</a> must be set to false and the
- user agent must <a href="#firing6">fire a progress event</a> called
- <code title=event-error><a href="#error1">error</a></code> at the <a
+ user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing6">fire a progress event</a> called <code
+ title=event-error><a href="#error1">error</a></code> at the <a
href="#media7">media element</a>.
<li>The element's <code title=dom-media-networkState><a
href="#networkstate">networkState</a></code> attribute must be
switched to the <a href="#empty" title=dom-media-EMPTY>EMPTY</a>
- value and the user agent must <a href="#firing2">fire a simple
- event</a> called <code title=event-emptied><a
- href="#emptied">emptied</a></code> at the element.
+ value and the user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-emptied><a href="#emptied">emptied</a></code> at the
+ element.
<li>These steps must be aborted.
</ol>
@@ -19335,8 +19346,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
title=dom-MediaError-MEDIA_ERR_ABORT>MEDIA_ERR_ABORT</code>.
<li>The <a href="#begun">begun flag</a> must be set to false and the
- user agent must <a href="#firing6">fire a progress event</a> called
- <code title=event-abort><a href="#abort">abort</a></code> at the <a
+ user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing6">fire a progress event</a> called <code
+ title=event-abort><a href="#abort">abort</a></code> at the <a
href="#media7">media element</a>.
<li>If the <a href="#media7">media element</a>'s <code
@@ -19346,10 +19358,10 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
the element's <code title=dom-media-networkState><a
href="#networkstate">networkState</a></code> attribute must be
switched to the <a href="#empty" title=dom-media-EMPTY>EMPTY</a>
- value and the user agent must <a href="#firing2">fire a simple
- event</a> called <code title=event-emptied><a
- href="#emptied">emptied</a></code> at the element. (If the <code
- title=dom-media-networkState><a
+ value and the user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-emptied><a href="#emptied">emptied</a></code> at the
+ element. (If the <code title=dom-media-networkState><a
href="#networkstate">networkState</a></code> attribute has a value
greater than <code title=dom-media-LOADING><a
href="#loading0">LOADING</a></code>, then this doesn't happen; the
@@ -19401,14 +19413,15 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
<li>
<p class=note>The user agent <a href="#durationUpdate">will</a> <a
- href="#firing2">fire a simple event</a> called <code
- title=event-durationchange><a
+ href="#queue">queue a task</a> to <a href="#firing2">fire a simple
+ event</a> called <code title=event-durationchange><a
href="#durationchange">durationchange</a></code> at the element at
this point.
<li>
- <p>The user agent must <a href="#firing2">fire a simple event</a>
- called <code title=event-loadedmetadata><a
+ <p>The user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-loadedmetadata><a
href="#loadedmetadata0">loadedmetadata</a></code> at the element.
</ol>
@@ -19438,14 +19451,16 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
be set to true.
<li>
- <p>The user agent must <a href="#firing2">fire a simple event</a>
- called <code title=event-loadedfirstframe><a
+ <p>The user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-loadedfirstframe><a
href="#loadedfirstframe0">loadedfirstframe</a></code> at the
element.
<li>
- <p>The user agent must <a href="#firing2">fire a simple event</a>
- called <code title=event-canshowcurrentframe><a
+ <p>The user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-canshowcurrentframe><a
href="#canshowcurrentframe0">canshowcurrentframe</a></code> at the
element.
</ol>
@@ -19460,8 +19475,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
title=dom-media-networkState><a
href="#networkstate">networkState</a></code> attribute must be set to
<code title=dom-media-LOADED><a href="#loaded">LOADED</a></code>, and
- the user agent must <a href="#firing6">fire a progress event</a> called
- <code title=event-load><a href="#load0">load</a></code> at the element.
+ the user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing6">fire a progress event</a> called <code
+ title=event-load><a href="#load0">load</a></code> at the element.
</ol>
<p>If a <a href="#media7">media element</a> whose <code
@@ -20003,11 +20019,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
href="#current0">current playback position</a> reaches the <var><a
href="#effective1">effective loop end</a></var>, then the user agent must
increase <code title=dom-media-currentLoop><a
- href="#currentloop">currentLoop</a></code> by 1, <a href="#queue">queue a
- task</a> to <a href="#firing2">fire a simple event</a> called <code
- title=event-timeupdate><a href="#timeupdate">timeupdate</a></code>, and <a
- href="#seek" title=dom-media-seek>seek</a> to the <var><a
- href="#effective0">effective loop start</a></var>.
+ href="#currentloop">currentLoop</a></code> by 1 and <a href="#seek"
+ title=dom-media-seek>seek</a> to the <var><a href="#effective0">effective
+ loop start</a></var>.
<p>When <code title=dom-media-currentLoop><a
href="#currentloop">currentLoop</a></code> is equal to the <span><code
@@ -20094,10 +20108,10 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
start</a></var>.</p>
<p class=note>If this involved a seek, the user agent <a
- href="#seekUpdate">will</a> <a href="#firing2">fire a simple event</a>
- called <code title=event-timeupdate><a
- href="#timeupdate">timeupdate</a></code> at the <a href="#media7">media
- element</a>.</p>
+ href="#seekUpdate">will</a> <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at
+ the <a href="#media7">media element</a>.</p>
<li>
<p>The <code title=dom-media-playbackRate><a
@@ -20107,10 +20121,10 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
<p class=note>If this caused the <code title=dom-media-playbackRate><a
href="#playbackrate">playbackRate</a></code> attribute to change value,
- the user agent <a href="#rateUpdate">will</a> <a href="#firing2">fire a
- simple event</a> called <code title=event-ratechange><a
- href="#ratechange">ratechange</a></code> at the <a href="#media7">media
- element</a>.</p>
+ the user agent <a href="#rateUpdate">will</a> <a href="#queue">queue a
+ task</a> to <a href="#firing2">fire a simple event</a> called <code
+ title=event-ratechange><a href="#ratechange">ratechange</a></code> at
+ the <a href="#media7">media element</a>.</p>
<li>
<p>If the <a href="#media7">media element</a>'s <code
@@ -20127,15 +20141,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
<li>
<p>If the fourth step above changed the value of <code
title=dom-media-paused><a href="#paused">paused</a></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><a href="#timeupdate">timeupdate</a></code> and
- <code title=event-ratechange><a
- href="#ratechange">ratechange</a></code>) have fired, <a
- href="#firing2">fire a simple event</a> called <code
- title=event-pause><a href="#pause1">play</a></code> at the element.
- </li>
- <!-- xxx queue -->
+ agent must <a href="#queue">queue a task</a> to <a href="#firing2">fire
+ a simple event</a> called <code title=event-pause><a
+ href="#pause1">play</a></code> at the element.
</ol>
<p>When the <dfn id=pause0 title=dom-media-pause><code>pause()</code></dfn>
View
99 source
@@ -16714,14 +16714,14 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<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
@@ -16737,6 +16737,11 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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
@@ -16761,16 +16766,18 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>
@@ -16804,16 +16811,18 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>
@@ -16844,7 +16853,8 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>
@@ -16855,10 +16865,11 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>
@@ -16914,14 +16925,15 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>
@@ -16951,13 +16963,13 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<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>
@@ -16976,8 +16988,9 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<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>
@@ -17477,9 +17490,7 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>
@@ -17564,9 +17575,10 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
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>
@@ -17580,9 +17592,9 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<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>
@@ -17596,13 +17608,10 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<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>

0 comments on commit d880f94

Please sign in to comment.