Skip to content

Commit

Permalink
[gw] (2) Tidy up how 'abort' and 'emptied' events fire when you call …
Browse files Browse the repository at this point in the history
…load() while it's already loading.

git-svn-id: http://svn.whatwg.org/webapps@3756 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 4, 2009
1 parent d58a3aa commit b63ba06
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 40 deletions.
39 changes: 23 additions & 16 deletions index
Expand Up @@ -21325,20 +21325,9 @@ interface <dfn>CueRangeCallback</dfn> {

</li>

<li><p>If the <a href=#media-element>media element</a>'s <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> is set to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code> or <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code>, set the <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute 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>,
<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>,
in the context of the <a href=#fetch title=fetch>fetching process</a>
that is in progress for the element, and <a href=#fire-a-progress-event>fire a progress
event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code> at
the <a href=#media-element>media element</a>, in the context of the same <a href=#fetch title=fetch>fetching process</a>.</li>

<li><p>Set the <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute
to null and the <a href=#autoplaying-flag>autoplaying flag</a> to true.</li>
<li><p>If the <a href=#media-element>media element</a>'s <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> is set to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code> or <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code>, let <var title="">aborted</var> be true; otherwise, let <var title="">aborted</var> be false.</li>

<li><p>Set the <code title=dom-media-playbackRate><a href=#dom-media-playbackrate>playbackRate</a></code> attribute to the
value of the <code title=dom-media-defaultPlaybackRate><a href=#dom-media-defaultplaybackrate>defaultPlaybackRate</a></code>
attribute.</li>
<li><p>Let <var title="">emptied</var> be false.</li>

<li>

Expand All @@ -21364,11 +21353,29 @@ interface <dfn>CueRangeCallback</dfn> {

<li>Set the <a href=#current-playback-position>current playback position</a> to 0.</li>

<li><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>Let <var title="">emptied</var> be true.</li>

</ol></li>

<li><p>Set the <code title=dom-media-playbackRate><a href=#dom-media-playbackrate>playbackRate</a></code> attribute to the
value of the <code title=dom-media-defaultPlaybackRate><a href=#dom-media-defaultplaybackrate>defaultPlaybackRate</a></code>
attribute.</li>

<li>If <var title="">aborted</var> is true, set the <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute 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>,
<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>,
in the context of the <a href=#fetch title=fetch>fetching process</a>
that is in progress for the element, and <a href=#fire-a-progress-event>fire a progress
event</a> called <code title=event-loadend><a href=#event-loadend>loadend</a></code> at
the <a href=#media-element>media element</a>, in the context of the same <a href=#fetch title=fetch>fetching process</a>.</li>

<li><p>Set the <code title=dom-media-error><a href=#dom-media-error>error</a></code> attribute
to null and the <a href=#autoplaying-flag>autoplaying flag</a> to true.</li>

<li><p>If <var title="">emptied</var> is true, <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><p>Invoke the <a href=#media-element>media element</a>'s <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
algorithm</a>.</li>

Expand Down Expand Up @@ -23303,7 +23310,7 @@ interface <dfn>CueRangeCallback</dfn> {
<td><code>ProgressEvent</code> <a href=#refsPROGRESS>[PROGRESS]</a>
<td>The user agent stops fetching the <a href=#media-data>media data</a> before it is completely downloaded, but not due to an error.
<td><code title=dom-media-error><a href=#dom-media-error>error</a></code> is an object with the code <code title=dom-MediaError-MEDIA_ERR_ABORTED><a href=#dom-mediaerror-media_err_aborted>MEDIA_ERR_ABORTED</a></code>.
<code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> equals either <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code> or <code title=dom-media-NETWORK_LOADED><a href=#dom-media-network_loaded>NETWORK_LOADED</a></code>, depending on when the download was aborted.
<code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> equals either <code title=dom-media-NETWORK_EMPTY><a href=#dom-media-network_empty>NETWORK_EMPTY</a></code> or <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code>, depending on when the download was aborted.
<tr><td><dfn id=event-error title=event-error><code>error</code></dfn>
<td><code>ProgressEvent</code> <a href=#refsPROGRESS>[PROGRESS]</a>
<td>An error occurs while fetching the <a href=#media-data>media data</a>.
Expand Down
56 changes: 32 additions & 24 deletions source
Expand Up @@ -23014,27 +23014,11 @@ interface <dfn>CueRangeCallback</dfn> {
<li><p>If the <span>media element</span>'s <code
title="dom-media-networkState">networkState</code> is set to <code
title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code> or <code
title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code>, set the <code
title="dom-media-error">error</code> attribute 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_ABORTED">MEDIA_ERR_ABORTED</code>,
<span>fire a progress event</span> called <code
title="event-abort">abort</code> at the <span>media element</span>,
in the context of the <span title="fetch">fetching process</span>
that is in progress for the element, and <span>fire a progress
event</span> called <code title="event-loadend">loadend</code> at
the <span>media element</span>, in the context of the same <span
title="fetch">fetching process</span>.</p></li>
title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code>, let <var
title="">aborted</var> be true; otherwise, let <var
title="">aborted</var> be false.</p></li>

<li><p>Set the <code title="dom-media-error">error</code> attribute
to null and the <span>autoplaying flag</span> to true.</p></li>

<li><p>Set the <code
title="dom-media-playbackRate">playbackRate</code> attribute to the
value of the <code
title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>
attribute.</p></li>
<li><p>Let <var title="">emptied</var> be false.</p></li>

<li>

Expand Down Expand Up @@ -23065,14 +23049,38 @@ interface <dfn>CueRangeCallback</dfn> {

<li>Set the <span>current playback position</span> to 0.</li>

<li><span>Fire a simple event</span> called <code
title="event-emptied">emptied</code> at the <span>media
element</span>.</li>
<li>Let <var title="">emptied</var> be true.</li>

</ol>

</li>

<li><p>Set the <code
title="dom-media-playbackRate">playbackRate</code> attribute to the
value of the <code
title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>
attribute.</p></li>

<li>If <var title="">aborted</var> is true, set the <code
title="dom-media-error">error</code> attribute 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_ABORTED">MEDIA_ERR_ABORTED</code>,
<span>fire a progress event</span> called <code
title="event-abort">abort</code> at the <span>media element</span>,
in the context of the <span title="fetch">fetching process</span>
that is in progress for the element, and <span>fire a progress
event</span> called <code title="event-loadend">loadend</code> at
the <span>media element</span>, in the context of the same <span
title="fetch">fetching process</span>.</p></li>

<li><p>Set the <code title="dom-media-error">error</code> attribute
to null and the <span>autoplaying flag</span> to true.</p></li>

<li><p>If <var title="">emptied</var> is true, <span>fire a simple
event</span> called <code title="event-emptied">emptied</code> at
the <span>media element</span>.</p></li>

<li><p>Invoke the <span>media element</span>'s <span
title="concept-media-load-algorithm">resource selection
algorithm</span>.</li>
Expand Down Expand Up @@ -25370,7 +25378,7 @@ interface <dfn>CueRangeCallback</dfn> {
<td><code>ProgressEvent</code> <a href="#refsPROGRESS">[PROGRESS]</a>
<td>The user agent stops fetching the <span>media data</span> before it is completely downloaded, but not due to an error.
<td><code title="dom-media-error">error</code> is an object with the code <code title="dom-MediaError-MEDIA_ERR_ABORTED">MEDIA_ERR_ABORTED</code>.
<code title="dom-media-networkState">networkState</code> equals either <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> or <code title="dom-media-NETWORK_LOADED">NETWORK_LOADED</code>, depending on when the download was aborted.
<code title="dom-media-networkState">networkState</code> equals either <code title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</code> or <code title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code>, depending on when the download was aborted.
<tr>
<td><dfn title="event-error"><code>error</code></dfn>
<td><code>ProgressEvent</code> <a href="#refsPROGRESS">[PROGRESS]</a>
Expand Down

0 comments on commit b63ba06

Please sign in to comment.