Skip to content

Commit

Permalink
[] (0) Further work on the event loop front. (This should complete th…
Browse files Browse the repository at this point in the history
…e bulk of the changes required for the media elements section.)

git-svn-id: http://svn.whatwg.org/webapps@2083 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 19, 2008
1 parent d880f94 commit 193f1fc
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 99 deletions.
110 changes: 51 additions & 59 deletions index
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20174,15 +20174,13 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae


<li> <li>
<p>If the second step above changed the value of <code <p>If the second step above changed the value of <code
title=dom-media-paused><a href="#paused">paused</a></code>, then, after title=dom-media-paused><a href="#paused">paused</a></code>, then the
any running scripts have finished executing, the user agent must first user agent must <a href="#queue">queue a task</a> to <a
<a href="#firing2">fire a simple event</a> called <code href="#firing2">fire a simple event</a> called <code
title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at
the element, and then <a href="#firing2">fire a simple event</a> called the element, and <a href="#queue">queue a task</a> to <a
<code title=event-pause><a href="#pause1">pause</a></code> at the href="#firing2">fire a simple event</a> called <code
element. title=event-pause><a href="#pause1">pause</a></code> at the element.
</li>
<!-- xxx queue -->
</ol> </ol>


<p>When a <a href="#media7">media element</a> is <span>removed from a <p>When a <a href="#media7">media element</a> is <span>removed from a
Expand Down Expand Up @@ -20279,18 +20277,11 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
<p>The <code title=dom-media-seeking><a <p>The <code title=dom-media-seeking><a
href="#seeking0">seeking</a></code> DOM attribute must be set to true. href="#seeking0">seeking</a></code> DOM attribute must be set to true.


<li>
<p>If the seek was in response to a DOM method call or setting of a DOM
attribute, then continue the script. The remainder of these steps must
be run asynchronously.

<li id=seekUpdate> <li id=seekUpdate>
<p>Once any running scripts have finished executing, the user agent must <p>The user agent must <a href="#queue">queue a task</a> to <a
<a href="#firing2">fire a simple event</a> called <code href="#queue">queue a task</a> to <a href="#firing2">fire a simple
title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at event</a> called <code title=event-timeupdate><a
the element. href="#timeupdate">timeupdate</a></code> at the element.
</li>
<!-- xxx queue -->


<li> <li>
<p>If the <a href="#media7">media element</a> was <a <p>If the <a href="#media7">media element</a> was <a
Expand All @@ -20299,18 +20290,23 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
href="#readystate0">readyState</a></code> attribute to change to a value href="#readystate0">readyState</a></code> attribute to change to a value
lower than <code title=dom-media-CAN_PLAY><a lower than <code title=dom-media-CAN_PLAY><a
href="#canplay">CAN_PLAY</a></code>, the user agent must <a href="#canplay">CAN_PLAY</a></code>, the user agent must <a
href="#firing2">fire a simple event</a> called <code href="#queue">queue a task</a> to <a href="#firing2">fire a simple
title=event-waiting><a href="#waiting">waiting</a></code> at the event</a> called <code title=event-waiting><a
element. href="#waiting">waiting</a></code> at the element.


<li> <li>
<p>If, when it reaches this step, the user agent has still not <p>If, when it reaches this step, the user agent has still not
established whether or not the <a href="#media9">media data</a> for the established whether or not the <a href="#media9">media data</a> for the
<var title="">new playback position</var> is available, and, if it is, <var title="">new playback position</var> is available, and, if it is,
decoded enough data to play back that position, the user agent must <a decoded enough data to play back that position, the user agent must <a
href="#firing2">fire a simple event</a> called <code href="#queue">queue a task</a> to <a href="#firing2">fire a simple
title=event-seeking><a href="#seeking1">seeking</a></code> at the event</a> called <code title=event-seeking><a
element. href="#seeking1">seeking</a></code> at the element.

<li>
<p>If the seek was in response to a DOM method call or setting of a DOM
attribute, then continue the script. The remainder of these steps must
be run asynchronously.


<li> <li>
<p>The user agent must wait until it has established whether or not the <p>The user agent must wait until it has established whether or not the
Expand All @@ -20323,11 +20319,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
href="#seeking0">seeking</a></code> DOM attribute must be set to false. href="#seeking0">seeking</a></code> DOM attribute must be set to false.


<li> <li>
<p>Once any running scripts have finished executing, the user agent must <p>The user agent must <a href="#queue">queue a task</a> to <a
<a href="#firing2">fire a simple event</a> called <code href="#firing2">fire a simple event</a> called <code
title=event-seeked><a href="#seeked">seeked</a></code> at the element. title=event-seeked><a href="#seeked">seeked</a></code> at the element.
</li>
<!-- xxx queue -->
</ol> </ol>


<p>The <dfn id=seekable <p>The <dfn id=seekable
Expand Down Expand Up @@ -20457,13 +20451,11 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
<li> <li>
<p>If the time was reached through the usual monotonic increase of the <p>If the time was reached through the usual monotonic increase of the
current playback position during normal playback, the user agent must current playback position during normal playback, the user agent must
then <a href="#firing2">fire a simple event</a> called <code then <a href="#queue">queue a task</a> to <a href="#firing2">fire a
title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at simple event</a> called <code title=event-timeupdate><a
the element. (In the other cases, such as explicit seeks, relevant href="#timeupdate">timeupdate</a></code> at the element. (In the other
events get fired as part of the overall process of changing the current cases, such as explicit seeks, relevant events get fired as part of the
playback position.) overall process of changing the current playback position.)
</li>
<!-- xxx queue -->


<li> <li>
<p>If the time was reached through the usual monotonic increase of the <p>If the time was reached through the usual monotonic increase of the
Expand All @@ -20472,27 +20464,28 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href="#htmlmediae
title="">other ranges</var> that have both their "active" boolean and title="">other ranges</var> that have both their "active" boolean and
their "pause" boolean set to "true", then immediately act as if the their "pause" boolean set to "true", then immediately act as if the
element's <code title=dom-media-pause><a element's <code title=dom-media-pause><a
href="#pause0">pause()</a></code> method had been invoked. (In the other href="#pause0">pause()</a></code> method had been invoked.
cases, such as explicit seeks, playback is not paused by exiting a cue <!-- pause() can in theory call load(), but never
range, even if that cue range has its "pause" boolean set to "true".) can it do so as part of this invokation, since we wouldn't be in
this algorithm if the media element was empty. So, no need to couch
all this in a task. -->
(In the other cases, such as explicit seeks, playback is not paused by
exiting a cue range, even if that cue range has its "pause" boolean set
to "true".)


<li> <li>
<p>Invoke all the non-null "exit" callbacks for all of the <a <p>For each non-null "exit" callback of the <a href="#cue-ranges0"
href="#cue-ranges0" title="cue range">cue ranges</a> in <var title="cue range">cue ranges</a> in <var title="">other ranges</var>
title="">other ranges</var> that have their "active" boolean set to that have their "active" boolean set to "true" (active), in list order,
"true" (active), in list order, passing their identifier as the <a href="#queue">queue a task</a> that invokes the callback, passing the
callback's only argument. cue range's identifier as the callback's only argument.
</li>
<!-- XXX queue -->


<li> <li>
<p>Invoke all the non-null "enter" callbacks for all of the <a <p>For each non-null "enter" callback of the <a href="#cue-ranges0"
href="#cue-ranges0" title="cue range">cue ranges</a> in <var title="cue range">cue ranges</a> in <var title="">current ranges</var>
title="">current ranges</var> that have their "active" boolean set to that have their "active" boolean set to "false" (inactive), in list
"false" (inactive), in list order, passing their identifier as the order, <a href="#queue">queue a task</a> that invokes the callback,
callback's only argument. passing the cue range's identifier as the callback's only argument.
</li>
<!-- XXX queue -->


<li> <li>
<p>Set the "active" boolean of all the <a href="#cue-ranges0" title="cue <p>Set the "active" boolean of all the <a href="#cue-ranges0" title="cue
Expand Down Expand Up @@ -20581,12 +20574,11 @@ interface <dfn id=cuerangecallback>CueRangeCallback</dfn> {


<p>Whenever either the <code title=dom-media-muted><a <p>Whenever either the <code title=dom-media-muted><a
href="#muted">muted</a></code> or <code title=dom-media-volume><a href="#muted">muted</a></code> or <code title=dom-media-volume><a
href="#volume">volume</a></code> attributes are changed, after any running href="#volume">volume</a></code> attributes are changed, the user agent
scripts have finished executing, the user agent must <a must <a href="#queue">queue a task</a> to <a href="#firing2">fire a simple
href="#firing2">fire a simple event</a> called <code event</a> called <code title=event-volumechange><a
title=event-volumechange><a href="#volumechange">volumechange</a></code> href="#volumechange">volumechange</a></code> at the <a
at the <a href="#media7">media element</a>.</p> href="#media7">media element</a>.
<!-- queue xxx -->


<h5 id=time-ranges><span class=secno>4.7.10.11. </span>Time ranges</h5> <h5 id=time-ranges><span class=secno>4.7.10.11. </span>Time ranges</h5>


Expand Down
88 changes: 48 additions & 40 deletions source
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17639,12 +17639,12 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<li><p>The method must then return.</p></li> <li><p>The method must then return.</p></li>


<li><p>If the second step above changed the value of <code <li><p>If the second step above changed the value of <code
title="dom-media-paused">paused</code>, then, after any running title="dom-media-paused">paused</code>, then the user agent must
scripts have finished executing, the user agent must first <span>queue a task</span> to <span>fire a simple event</span>
<span>fire a simple event</span> called <code called <code title="event-timeupdate">timeupdate</code> at the
title="event-timeupdate">timeupdate</code> at the element, and then element, and <span>queue a task</span> to <span>fire a simple
<span>fire a simple event</span> called <code event</span> called <code title="event-pause">pause</code> at the
title="event-pause">pause</code> at the element.</p></li><!-- xxx queue --> element.</p></li>


</ol> </ol>


Expand Down Expand Up @@ -17737,29 +17737,31 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<li><p>The <code title="dom-media-seeking">seeking</code> DOM <li><p>The <code title="dom-media-seeking">seeking</code> DOM
attribute must be set to true.</p></li> attribute must be set to true.</p></li>


<li><p>If the seek was in response to a DOM method call or setting <li id="seekUpdate"><p>The user agent must <span>queue a
of a DOM attribute, then continue the script. The remainder of task</span> to <span>queue a task</span> to <span>fire a simple
these steps must be run asynchronously.</p></li> event</span> called <code

title="event-timeupdate">timeupdate</code> at the element.</p></li>
<li id="seekUpdate"><p>Once any running scripts have finished
executing, 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>If the <span>media element</span> was <span>actively <li><p>If the <span>media element</span> was <span>actively
playing</span> immediately before it started seeking, but seeking playing</span> immediately before it started seeking, but seeking
caused its <code title="dom-media-readyState">readyState</code> caused its <code title="dom-media-readyState">readyState</code>
attribute to change to a value lower than <code attribute to change to a value lower than <code
title="dom-media-CAN_PLAY">CAN_PLAY</code>, the user agent must title="dom-media-CAN_PLAY">CAN_PLAY</code>, the user agent must
<span>fire a simple event</span> called <code <span>queue a task</span> to <span>fire a simple event</span>
title="event-waiting">waiting</code> at the element.</p></li> called <code title="event-waiting">waiting</code> at the
element.</p></li>


<li><p>If, when it reaches this step, the user agent has still not <li><p>If, when it reaches this step, the user agent has still not
established whether or not the <span>media data</span> for the <var established whether or not the <span>media data</span> for the <var
title="">new playback position</var> is available, and, if it is, title="">new playback position</var> is available, and, if it is,
decoded enough data to play back that position, the user agent must decoded enough data to play back that position, the user agent must
<span>fire a simple event</span> called <code <span>queue a task</span> to <span>fire a simple event</span>
title="event-seeking">seeking</code> at the element.</p></li> called <code title="event-seeking">seeking</code> at the
element.</p></li>

<li><p>If the seek was in response to a DOM method call or setting
of a DOM attribute, then continue the script. The remainder of
these steps must be run asynchronously.</p></li>


<li><p>The user agent must wait until it has established whether or <li><p>The user agent must wait until it has established whether or
not the <span>media data</span> for the <var title="">new playback not the <span>media data</span> for the <var title="">new playback
Expand All @@ -17769,9 +17771,9 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<li><p>The <code title="dom-media-seeking">seeking</code> DOM <li><p>The <code title="dom-media-seeking">seeking</code> DOM
attribute must be set to false.</p></li> attribute must be set to false.</p></li>


<li><p>Once any running scripts have finished executing, the user <li><p>The user agent must <span>queue a task</span> to <span>fire
agent must <span>fire a simple event</span> called <code a simple event</span> called <code
title="event-seeked">seeked</code> at the element.</p></li><!-- xxx queue --> title="event-seeked">seeked</code> at the element.</p></li>


</ol> </ol>


Expand Down Expand Up @@ -17892,34 +17894,40 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
steps.</p></li> steps.</p></li>


<li><p>If the time was reached through the usual monotonic increase <li><p>If the time was reached through the usual monotonic increase
of the current playback position during normal playback, the of the current playback position during normal playback, the user
user agent must then <span>fire a simple event</span> called <code agent must then <span>queue a task</span> to <span>fire a simple
event</span> called <code
title="event-timeupdate">timeupdate</code> at the element. (In the title="event-timeupdate">timeupdate</code> at the element. (In the
other cases, such as explicit seeks, relevant events get fired as other cases, such as explicit seeks, relevant events get fired as
part of the overall process of changing the current playback part of the overall process of changing the current playback
position.)</p></li><!-- xxx queue --> position.)</p></li>


<li><p>If the time was reached through the usual monotonic increase <li><p>If the time was reached through the usual monotonic increase
of the current playback position during normal playback, and there of the current playback position during normal playback, and there
are <span title="cue range">cue ranges</span> in <var are <span title="cue range">cue ranges</span> in <var
title="">other ranges</var> that have both their "active" boolean title="">other ranges</var> that have both their "active" boolean
and their "pause" boolean set to "true", then immediately act as if and their "pause" boolean set to "true", then immediately act as if
the element's <code title="dom-media-pause">pause()</code> method the element's <code title="dom-media-pause">pause()</code> method
had been invoked. (In the other cases, such as explicit seeks, had been invoked. <!-- pause() can in theory call load(), but never
playback is not paused by exiting a cue range, even if that cue can it do so as part of this invokation, since we wouldn't be in
range has its "pause" boolean set to "true".)</p></li> this algorithm if the media element was empty. So, no need to couch

all this in a task. --> (In the other cases, such as explicit
<li><p>Invoke all the non-null "exit" callbacks for all of the seeks, playback is not paused by exiting a cue range, even if that
<span title="cue range">cue ranges</span> in <var title="">other cue range has its "pause" boolean set to "true".)</p></li>

<li><p>For each non-null "exit" callback of the <span
title="cue range">cue ranges</span> in <var title="">other
ranges</var> that have their "active" boolean set to "true" ranges</var> that have their "active" boolean set to "true"
(active), in list order, passing their identifier as the callback's (active), in list order, <span>queue a task</span> that invokes the
only argument.</p></li> <!-- XXX queue --> callback, passing the cue range's identifier as the callback's only
argument.</p></li>


<li><p>Invoke all the non-null "enter" callbacks for all of the <li><p>For each non-null "enter" callback of the <span title="cue
<span title="cue range">cue ranges</span> in <var title="">current range">cue ranges</span> in <var title="">current ranges</var> that
ranges</var> that have their "active" boolean set to "false" have their "active" boolean set to "false" (inactive), in list
(inactive), in list order, passing their identifier as the order, <span>queue a task</span> that invokes the callback, passing
callback's only argument.</p></li> <!-- XXX queue --> the cue range's identifier as the callback's only
argument.</p></li>


<li><p>Set the "active" boolean of all the <span title="cue <li><p>Set the "active" boolean of all the <span title="cue
range">cue ranges</span> in the <var title="">current ranges</var> range">cue ranges</span> in the <var title="">current ranges</var>
Expand Down Expand Up @@ -18013,10 +18021,10 @@ interface <dfn>CueRangeCallback</dfn> {


<p>Whenever either the <code title="dom-media-muted">muted</code> or <p>Whenever either the <code title="dom-media-muted">muted</code> or
<code title="dom-media-volume">volume</code> attributes are changed, <code title="dom-media-volume">volume</code> attributes are changed,
after any running scripts have finished executing, the user agent the user agent must <span>queue a task</span> to <span>fire a simple
must <span>fire a simple event</span> called <code event</span> called <code
title="event-volumechange">volumechange</code> at the <span>media title="event-volumechange">volumechange</code> at the <span>media
element</span>.</p><!-- queue xxx --> element</span>.</p>






Expand Down

0 comments on commit 193f1fc

Please sign in to comment.