Skip to content

Commit

Permalink
[giow] (3) Simplify task ordering in media elements to aid implementa…
Browse files Browse the repository at this point in the history
…tions.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24710
Affected topics: Video and Audio

git-svn-id: http://svn.whatwg.org/webapps@8514 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 27, 2014
1 parent d5659f3 commit 8e686e6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 38 deletions.
28 changes: 14 additions & 14 deletions complete.html
Expand Up @@ -25839,10 +25839,13 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the
element</a>'s <a href=#media-element-event-task-source>media element event task source</a> in one of the <a href=#task-queue title="task
queue">task queues</a>, then remove those tasks.</p>

<p>If there are any <a href=#concept-task title=concept-task>tasks</a> that were <a href=#queue-a-task title="queue a
task">queued</a> by the <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
algorithm</a> (including the algorithms that it itself invokes) for this same <a href=#media-element>media
element</a> from the <a href=#dom-manipulation-task-source>DOM manipulation task source</a> in one of the <a href=#task-queue title="task queue">task queues</a>, then remove those tasks.</p>
<!--
<p>If there are any <span title="concept-task">tasks</span> that were <span title="queue a
task">queued</span> by the <span title="concept-media-load-algorithm">resource selection
algorithm</span> (including the algorithms that it itself invokes) for this same <span>media
element</span> from the <span>DOM manipulation 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 and callbacks for the media element are discarded when
the media element starts loading a new resource.</p>
Expand Down Expand Up @@ -26001,8 +26004,7 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the

<p><i title="">Failed with attribute</i>: Reaching this step indicates that the media resource
failed to load or that the given <a href=#url>URL</a> could not be <a href=#resolve-a-url title="resolve a
url">resolved</a>. <a href=#queue-a-task>Queue a task</a> to run the following steps, using the
<a href=#dom-manipulation-task-source>DOM manipulation task source</a>:</p>
url">resolved</a>. <a href=#queue-a-task>Queue a task</a> to run the following steps:</p>

<ol><li><p>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
Expand All @@ -26018,8 +26020,7 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the
<li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-media-error><a href=#event-media-error>error</a></code> at
the <a href=#media-element>media element</a>.</li>

<!--CLEANUP-->
<li><p><a href=#queue-a-task>Queue a task</a> to set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load event">delaying the load event</a>.</li>
<li><p>Set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load event">delaying the load event</a>.</li>

</ol></li>

Expand Down Expand Up @@ -26092,8 +26093,8 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the
<var title="">absolute URL</var>. If that algorithm returns without aborting <em>this</em> one,
then the load failed.</li>

<li><p><i title="">Failed with elements</i>: <a href=#queue-a-task>Queue a task</a>, using the <a href=#dom-manipulation-task-source>DOM
manipulation task source</a>, to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <var title="">candidate</var> element.</li>
<!--CLEANUP-->
<li><p><i title="">Failed with elements</i>: <a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <var title="">candidate</var> element.</li>

<li><p>Asynchronously <a href=#await-a-stable-state>await a stable state</a>. The <a href=#synchronous-section>synchronous section</a>
consists of all the remaining steps of this algorithm until the algorithm says the
Expand Down Expand Up @@ -26164,8 +26165,7 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the

<ol><li><p>Set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code>.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the element, using the <a href=#dom-manipulation-task-source>DOM manipulation
task source</a>.</li>
<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the element.</li>

<!--CLEANUP-->
<li><p><a href=#queue-a-task>Queue a task</a> to set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load event">delaying the load event</a>.</li>
Expand Down Expand Up @@ -26211,12 +26211,12 @@ <h5 id=loading-the-media-resource><span class=secno>4.7.10.5 </span>Loading the
download may also be throttled automatically by the user agent, e.g. to balance the download
with other connections sharing the same bandwidth.</p>

<!--CLEANUP-->
<p id=resourceSuspend>User agents may decide to not download more content at any time, e.g.
after buffering five minutes of a one hour media resource, while waiting for the user to decide
whether to play the resource or not, while waiting for user input in an interactive resource, or
when the user navigates away from the page. When a <a href=#media-element>media element</a>'s download has
been suspended, the user agent must <a href=#queue-a-task>queue a task</a>, using the <a href=#dom-manipulation-task-source>DOM manipulation
task source</a>, to set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> and <a href=#fire-a-simple-event>fire a simple event</a> named
been suspended, the user agent must <a href=#queue-a-task>queue a task</a>, to set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> and <a href=#fire-a-simple-event>fire a simple event</a> named
<code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the element. If and when downloading of the
resource resumes, the user agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code>. Between the queuing of these tasks,
the load is suspended (so <code title=event-media-progress><a href=#event-media-progress>progress</a></code> events don't fire,
Expand Down
28 changes: 14 additions & 14 deletions index
Expand Up @@ -25839,10 +25839,13 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement
element</a>'s <a href=#media-element-event-task-source>media element event task source</a> in one of the <a href=#task-queue title="task
queue">task queues</a>, then remove those tasks.</p>

<p>If there are any <a href=#concept-task title=concept-task>tasks</a> that were <a href=#queue-a-task title="queue a
task">queued</a> by the <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
algorithm</a> (including the algorithms that it itself invokes) for this same <a href=#media-element>media
element</a> from the <a href=#dom-manipulation-task-source>DOM manipulation task source</a> in one of the <a href=#task-queue title="task queue">task queues</a>, then remove those tasks.</p>
<!--
<p>If there are any <span title="concept-task">tasks</span> that were <span title="queue a
task">queued</span> by the <span title="concept-media-load-algorithm">resource selection
algorithm</span> (including the algorithms that it itself invokes) for this same <span>media
element</span> from the <span>DOM manipulation 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 and callbacks for the media element are discarded when
the media element starts loading a new resource.</p>
Expand Down Expand Up @@ -26001,8 +26004,7 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement

<p><i title="">Failed with attribute</i>: Reaching this step indicates that the media resource
failed to load or that the given <a href=#url>URL</a> could not be <a href=#resolve-a-url title="resolve a
url">resolved</a>. <a href=#queue-a-task>Queue a task</a> to run the following steps, using the
<a href=#dom-manipulation-task-source>DOM manipulation task source</a>:</p>
url">resolved</a>. <a href=#queue-a-task>Queue a task</a> to run the following steps:</p>

<ol><li><p>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
Expand All @@ -26018,8 +26020,7 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement
<li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-media-error><a href=#event-media-error>error</a></code> at
the <a href=#media-element>media element</a>.</li>

<!--CLEANUP-->
<li><p><a href=#queue-a-task>Queue a task</a> to set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load event">delaying the load event</a>.</li>
<li><p>Set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load event">delaying the load event</a>.</li>

</ol></li>

Expand Down Expand Up @@ -26092,8 +26093,8 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement
<var title="">absolute URL</var>. If that algorithm returns without aborting <em>this</em> one,
then the load failed.</li>

<li><p><i title="">Failed with elements</i>: <a href=#queue-a-task>Queue a task</a>, using the <a href=#dom-manipulation-task-source>DOM
manipulation task source</a>, to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <var title="">candidate</var> element.</li>
<!--CLEANUP-->
<li><p><i title="">Failed with elements</i>: <a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <var title="">candidate</var> element.</li>

<li><p>Asynchronously <a href=#await-a-stable-state>await a stable state</a>. The <a href=#synchronous-section>synchronous section</a>
consists of all the remaining steps of this algorithm until the algorithm says the
Expand Down Expand Up @@ -26164,8 +26165,7 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement

<ol><li><p>Set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code>.</li>

<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the element, using the <a href=#dom-manipulation-task-source>DOM manipulation
task source</a>.</li>
<li><p><a href=#queue-a-task>Queue a task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the element.</li>

<!--CLEANUP-->
<li><p><a href=#queue-a-task>Queue a task</a> to set the element's <a href=#delaying-the-load-event-flag>delaying-the-load-event flag</a> to false. This stops <a href=#delay-the-load-event title="delay the load event">delaying the load event</a>.</li>
Expand Down Expand Up @@ -26211,12 +26211,12 @@ interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement
download may also be throttled automatically by the user agent, e.g. to balance the download
with other connections sharing the same bandwidth.</p>

<!--CLEANUP-->
<p id=resourceSuspend>User agents may decide to not download more content at any time, e.g.
after buffering five minutes of a one hour media resource, while waiting for the user to decide
whether to play the resource or not, while waiting for user input in an interactive resource, or
when the user navigates away from the page. When a <a href=#media-element>media element</a>'s download has
been suspended, the user agent must <a href=#queue-a-task>queue a task</a>, using the <a href=#dom-manipulation-task-source>DOM manipulation
task source</a>, to set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> and <a href=#fire-a-simple-event>fire a simple event</a> named
been suspended, the user agent must <a href=#queue-a-task>queue a task</a>, to set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> and <a href=#fire-a-simple-event>fire a simple event</a> named
<code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the element. If and when downloading of the
resource resumes, the user agent must <a href=#queue-a-task>queue a task</a> to set the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> to <code title=dom-media-NETWORK_LOADING><a href=#dom-media-network_loading>NETWORK_LOADING</a></code>. Between the queuing of these tasks,
the load is suspended (so <code title=event-media-progress><a href=#event-media-progress>progress</a></code> events don't fire,
Expand Down
19 changes: 9 additions & 10 deletions source
Expand Up @@ -27358,11 +27358,13 @@ interface <dfn>HTMLMediaElement</dfn> : <span>HTMLElement</span> {
element</span>'s <span>media element event task source</span> in one of the <span data-x="task
queue">task queues</span>, then remove those tasks.</p>

<!--
<p>If there are any <span data-x="concept-task">tasks</span> that were <span data-x="queue a
task">queued</span> by the <span data-x="concept-media-load-algorithm">resource selection
algorithm</span> (including the algorithms that it itself invokes) for this same <span>media
element</span> from the <span>DOM manipulation task source</span> in one of the <span
data-x="task queue">task queues</span>, then remove those tasks.</p>
-->

<p class="note">Basically, pending events and callbacks for the media element are discarded when
the media element starts loading a new resource.</p>
Expand Down Expand Up @@ -27551,8 +27553,7 @@ interface <dfn>HTMLMediaElement</dfn> : <span>HTMLElement</span> {

<p><i data-x="">Failed with attribute</i>: Reaching this step indicates that the media resource
failed to load or that the given <span>URL</span> could not be <span data-x="resolve a
url">resolved</span>. <span>Queue a task</span> to run the following steps, using the
<span>DOM manipulation task source</span>:</p>
url">resolved</span>. <span>Queue a task</span> to run the following steps:</p>

<ol>

Expand All @@ -27571,8 +27572,7 @@ interface <dfn>HTMLMediaElement</dfn> : <span>HTMLElement</span> {
<li><p><span>Fire a simple event</span> named <code data-x="event-media-error">error</code> at
the <span>media element</span>.</p></li>

<!--CLEANUP-->
<li><p><span>Queue a task</span> to set the element's <span>delaying-the-load-event flag</span> to false. This stops <span
<li><p>Set the element's <span>delaying-the-load-event flag</span> to false. This stops <span
data-x="delay the load event">delaying the load event</span>.</p></li>

</ol>
Expand Down Expand Up @@ -27668,8 +27668,8 @@ interface <dfn>HTMLMediaElement</dfn> : <span>HTMLElement</span> {
<var data-x="">absolute URL</var>. If that algorithm returns without aborting <em>this</em> one,
then the load failed.</p></li>

<li><p><i data-x="">Failed with elements</i>: <span>Queue a task</span>, using the <span>DOM
manipulation task source</span>, to <span>fire a simple event</span> named <code
<!--CLEANUP-->
<li><p><i data-x="">Failed with elements</i>: <span>Queue a task</span> to <span>fire a simple event</span> named <code
data-x="event-error">error</code> at the <var data-x="">candidate</var> element.</p></li>

<li><p>Asynchronously <span>await a stable state</span>. The <span>synchronous section</span>
Expand Down Expand Up @@ -27757,8 +27757,7 @@ interface <dfn>HTMLMediaElement</dfn> : <span>HTMLElement</span> {
data-x="dom-media-NETWORK_IDLE">NETWORK_IDLE</code>.</p></li>

<li><p><span>Queue a task</span> to <span>fire a simple event</span> named <code
data-x="event-media-suspend">suspend</code> at the element, using the <span>DOM manipulation
task source</span>.</p></li>
data-x="event-media-suspend">suspend</code> at the element.</p></li>

<!--CLEANUP-->
<li><p><span>Queue a task</span> to set the element's <span>delaying-the-load-event flag</span> to false. This stops <span
Expand Down Expand Up @@ -27811,12 +27810,12 @@ interface <dfn>HTMLMediaElement</dfn> : <span>HTMLElement</span> {
download may also be throttled automatically by the user agent, e.g. to balance the download
with other connections sharing the same bandwidth.</p>

<!--CLEANUP-->
<p id="resourceSuspend">User agents may decide to not download more content at any time, e.g.
after buffering five minutes of a one hour media resource, while waiting for the user to decide
whether to play the resource or not, while waiting for user input in an interactive resource, or
when the user navigates away from the page. When a <span>media element</span>'s download has
been suspended, the user agent must <span>queue a task</span>, using the <span>DOM manipulation
task source</span>, to set the <code data-x="dom-media-networkState">networkState</code> to <code
been suspended, the user agent must <span>queue a task</span>, to set the <code data-x="dom-media-networkState">networkState</code> to <code
data-x="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> and <span>fire a simple event</span> named
<code data-x="event-media-suspend">suspend</code> at the element. If and when downloading of the
resource resumes, the user agent must <span>queue a task</span> to set the <code
Expand Down

0 comments on commit 8e686e6

Please sign in to comment.