Skip to content

Commit

Permalink
[gow] (2) Clean up event dispatch issues in the media element section…
Browse files Browse the repository at this point in the history
…. (there were some asychronous event dispatches without event loops)

git-svn-id: http://svn.whatwg.org/webapps@2335 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 15, 2008
1 parent 7109cbe commit 1b1dae3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 41 deletions.
44 changes: 24 additions & 20 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -16912,9 +16912,9 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<li><p>If the element's <a href=#begun-flag>begun flag</a> is true, then the
<a href=#begun-flag>begun flag</a> must be set to false, the <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute must be set to a new
<code><a href=#mediaerror>MediaError</a></code> object whose <code title=dom-MediaError-code><a href=#dom-mediaerror-code>code</a></code> attribute is set to <code title=dom-MediaError-MEDIA_ERR_ABORTED><a href=#dom-mediaerror-media_err_aborted>MEDIA_ERR_ABORTED</a></code>,
and the user agent must synchronously <a href=#fire-a-progress-event>fire a progress
event</a> called <code title=event-abort><a href=#event-abort>abort</a></code> at the
<a href=#media-element>media element</a>.</li>
and the user agent must <a href=#fire-a-progress-event>fire a progress event</a> called
<code title=event-abort><a href=#event-abort>abort</a></code> at the <a href=#media-element>media
element</a>.</li>

<li><p>The <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute
must be set to null and the <a href=#autoplaying-flag>autoplaying flag</a> must be
Expand Down Expand Up @@ -16954,14 +16954,14 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
<li>The <code title=dom-media-currentLoop><a href=#dom-media-currentloop>currentLoop</a></code> DOM
attribute must be set to 0.</li>

<!--<li>The user agent must synchronously <span>fire a simple
event</span> at the <span>media element</span> for each event
name in <var title="">events</var>, in the same order that they
were added to that list.</li>-->
<!--<li>The user agent must <span>fire a simple event</span> at
the <span>media element</span> for each event name in <var
title="">events</var>, in the same order that they were added to
that list.</li>-->

<li>The user agent must synchronously <a href=#fire-a-simple-event>fire a simple
event</a> called <code title=event-emptied><a href=#event-emptied>emptied</a></code> at
the <a href=#media-element>media element</a>.</li>
<li>The user agent must <a href=#fire-a-simple-event>fire a simple event</a> called
<code title=event-emptied><a href=#event-emptied>emptied</a></code> at the <a href=#media-element>media
element</a>.</li>

</ol></li>

Expand All @@ -16977,13 +16977,16 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
returning the new value.</li>

<li><p>The user agent must then set the <a href=#begun-flag>begun flag</a> to
true and synchronously <a href=#fire-a-progress-event>fire a progress event</a> called
<code title=event-loadstart><a href=#event-loadstart>loadstart</a></code> at the <a href=#media-element>media
true and <a href=#fire-a-progress-event>fire a progress event</a> called <code title=event-loadstart><a href=#event-loadstart>loadstart</a></code> at the <a href=#media-element>media
element</a>.</li>

<li><p>The method must return, but these steps must
continue.</li>


<!-- SYNCHRONOUS / ASYNCHRONOUS BOUNDARY FOR EVENT DISPATCH -->


<li><p class=note>Playback of any previously playing <a href=#media-resource>media
resource</a> for this element stops.</li>

Expand Down Expand Up @@ -17512,24 +17515,25 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael

<!-- going up to future -->
<dt>If the prevous ready state was <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code> or
less, and the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code> or
more</dt>
less, and the new ready state is <code title=dom-media-HAVE_FUTURE_DATA><a href=#dom-media-have_future_data>HAVE_FUTURE_DATA</a></code></dt>

<dd><p>The user agent must <a href=#fire-a-simple-event>fire a simple event</a> called
<code title=event-canplay><a href=#event-canplay>canplay</a></code>.</dd>
<dd><p>The user agent must <a href=#queue-a-task>queue a task</a> to
<a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-canplay><a href=#event-canplay>canplay</a></code>.</dd>

<!-- going up to enough -->
<dt>If the new ready state is <code title=dom-media-HAVE_ENOUGH_DATA><a href=#dom-media-have_enough_data>HAVE_ENOUGH_DATA</a></code></dt>

<dd>

<p>The user agent must <a href=#fire-a-simple-event>fire a simple event</a> called
<code title=event-canplaythrough><a href=#event-canplaythrough>canplaythrough</a></code> event.</p>
<!-- XXX make sure it fires after canplay when fixing queueing here -->
<p>The user agent must <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
simple event</a> called <code title=event-canplay><a href=#event-canplay>canplay</a></code>, and then <a href=#queue-a-task>queue a
task</a> to <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-canplaythrough><a href=#event-canplaythrough>canplaythrough</a></code>.</p>

<p>If the <a href=#autoplaying-flag>autoplaying flag</a> is true, and the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute is true, and the
<a href=#media-element>media element</a> has an <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code> attribute specified,
then the user agent may also set the <code title=dom-media-paused><a href=#dom-media-paused>paused</a></code> attribute to false and
<a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-play><a href=#event-play>play</a></code>.</p>
<a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a>
called <code title=event-play><a href=#event-play>play</a></code>.</p>

<p class=note>User agents are not required to autoplay, and it
is suggested that user agents honor user preferences on the
Expand Down
49 changes: 28 additions & 21 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -18073,9 +18073,9 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<code>MediaError</code> object whose <code
title="dom-MediaError-code">code</code> attribute is set to <code
title="dom-MediaError-MEDIA_ERR_ABORTED">MEDIA_ERR_ABORTED</code>,
and the user agent must synchronously <span>fire a progress
event</span> called <code title="event-abort">abort</code> at the
<span>media element</span>.</p></li>
and the user agent must <span>fire a progress event</span> called
<code title="event-abort">abort</code> at the <span>media
element</span>.</p></li>

<li><p>The <code title="dom-media-error">error</code> attribute
must be set to null and the <span>autoplaying flag</span> must be
Expand Down Expand Up @@ -18123,14 +18123,14 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<li>The <code title="dom-media-currentLoop">currentLoop</code> DOM
attribute must be set to 0.</li>

<!--<li>The user agent must synchronously <span>fire a simple
event</span> at the <span>media element</span> for each event
name in <var title="">events</var>, in the same order that they
were added to that list.</li>-->
<!--<li>The user agent must <span>fire a simple event</span> at
the <span>media element</span> for each event name in <var
title="">events</var>, in the same order that they were added to
that list.</li>-->

<li>The user agent must synchronously <span>fire a simple
event</span> called <code title="event-emptied">emptied</code> at
the <span>media element</span>.</li>
<li>The user agent must <span>fire a simple event</span> called
<code title="event-emptied">emptied</code> at the <span>media
element</span>.</li>

</ol>

Expand All @@ -18150,13 +18150,17 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
returning the new value.</p></li>

<li><p>The user agent must then set the <span>begun flag</span> to
true and synchronously <span>fire a progress event</span> called
<code title="event-loadstart">loadstart</code> at the <span>media
true and <span>fire a progress event</span> called <code
title="event-loadstart">loadstart</code> at the <span>media
element</span>.</p></li>

<li><p>The method must return, but these steps must
continue.</p></li>


<!-- SYNCHRONOUS / ASYNCHRONOUS BOUNDARY FOR EVENT DISPATCH -->


<li><p class="note">Playback of any previously playing <span>media
resource</span> for this element stops.</p></li>

Expand Down Expand Up @@ -18835,29 +18839,32 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
<dt>If the prevous ready state was <code
title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code> or
less, and the new ready state is <code
title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code> or
more</dt>
title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code></dt>

<dd><p>The user agent must <span>fire a simple event</span> called
<code title="event-canplay">canplay</code>.</p></dd>
<dd><p>The user agent must <span>queue a task</span> to
<span>fire a simple event</span> called <code
title="event-canplay">canplay</code>.</p></dd>

<!-- going up to enough -->
<dt>If the new ready state is <code
title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code></dt>

<dd>

<p>The user agent must <span>fire a simple event</span> called
<code title="event-canplaythrough">canplaythrough</code> event.</p>
<!-- XXX make sure it fires after canplay when fixing queueing here -->
<p>The user agent must <span>queue a task</span> to <span>fire a
simple event</span> called <code
title="event-canplay">canplay</code>, and then <span>queue a
task</span> to <span>fire a simple event</span> called <code
title="event-canplaythrough">canplaythrough</code>.</p>

<p>If the <span>autoplaying flag</span> is true, and the <code
title="dom-media-paused">paused</code> attribute is true, and the
<span>media element</span> has an <code
title="attr-media-autoplay">autoplay</code> attribute specified,
then the user agent may also set the <code
title="dom-media-paused">paused</code> attribute to false and
<span>fire a simple event</span> called <code
title="event-play">play</code>.</p>
<span>queue a task</span> to <span>fire a simple event</span>
called <code title="event-play">play</code>.</p>

<p class="note">User agents are not required to autoplay, and it
is suggested that user agents honor user preferences on the
Expand Down

0 comments on commit 1b1dae3

Please sign in to comment.