[html5] r6545 - [giow] (1) Make networkState changes have better-defined order relative to 'susp [...]
whatwg at whatwg.org
whatwg at whatwg.org
Thu Sep 8 14:57:24 PDT 2011
Author: ianh
Date: 2011-09-08 14:57:20 -0700 (Thu, 08 Sep 2011)
New Revision: 6545
Modified:
complete.html
index
source
Log:
[giow] (1) Make networkState changes have better-defined order relative to 'suspend' and 'progress' events.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12608
Modified: complete.html
===================================================================
--- complete.html 2011-09-08 20:47:10 UTC (rev 6544)
+++ complete.html 2011-09-08 21:57:20 UTC (rev 6545)
@@ -27359,6 +27359,8 @@
event</a> named <code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the
element.</li>
+ <li><p>Wait for the task to be run.</li>
+
<li><p>Wait for an implementation-defined event (e.g. the user
requesting that the media element begin playback).</li>
@@ -27384,9 +27386,10 @@
<code><a href=#the-canvas-element>canvas</a></code> gets tainted when the video is drawn on
it.</p>
- <p>Every 350ms (±200ms) or for every byte received, whichever
- is <em>least</em> frequent, <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-progress><a href=#event-media-progress>progress</a></code> at the element.</p>
+ <p>While the load is not suspended (see below), every 350ms
+ (±200ms) or for every byte received, whichever is
+ <em>least</em> frequent, <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-progress><a href=#event-media-progress>progress</a></code> at the element.</p>
<p>The <dfn id=stall-timeout>stall timeout</dfn> is a user-agent defined length of
time, which should be about three seconds. When a <a href=#media-element>media
@@ -27403,16 +27406,18 @@
throttled automatically by the user agent, e.g. to balance the
download with other connections sharing the same bandwidth.</p>
- <p>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, or while waiting for user input in an interactive
- resource. When a <a href=#media-element>media element</a>'s download has been
- suspended, the user agent must 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=#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. If and
- when downloading of the resource resumes, the user agent must 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>.</p>
+ <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, or while waiting for user
+ input in an interactive resource. 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> 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, as
+ described above).</p>
<p class=note>The <code title=attr-media-preload><a href=#attr-media-preload>preload</a></code> attribute provides a
hint regarding how much buffering the author thinks is advisable,
@@ -27605,8 +27610,10 @@
<p class=note>A user agent that is attempting to reduce
network usage while still fetching the metadata for each
<a href=#media-resource>media resource</a> would also stop buffering at this
- point, causing the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
- to switch to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value.</p>
+ point, following <a href=#resourceSuspend>the rules
+ described previously</a>, which involve the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
+ switching to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value and a
+ <code title=event-suspend>suspend</code> event firing.</p>
</li>
@@ -27627,10 +27634,21 @@
named <code title=event-media-progress><a href=#event-media-progress>progress</a></code> at the
<a href=#media-element>media element</a>.</p>
- <p>Then, <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 <a href=#media-element>media
+ <p>Then, <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 <a href=#media-element>media
element</a>.</p>
+ <p>If the user agent ever discards any <a href=#media-data>media data</a>
+ and then needs to resume the network activity to obtain it
+ again, then it must wait <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>.</p>
+
+ <p class=note>If the user agent can keep the <a href=#media-resource>media
+ resource</a> loaded, then the algorithm will continue to its
+ final step below, which aborts the algorithm.</p><!-- see FINAL
+ STEP below -->
+
</dd>
@@ -27810,6 +27828,7 @@
</li>
+ <!-- this step is mentioned above, search for "FINAL STEP" -->
<li><p>If the user agent ever reaches this step (which can only
happen if the entire resource gets loaded and kept available):
abort the overall <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
Modified: index
===================================================================
--- index 2011-09-08 20:47:10 UTC (rev 6544)
+++ index 2011-09-08 21:57:20 UTC (rev 6545)
@@ -27226,6 +27226,8 @@
event</a> named <code title=event-media-suspend><a href=#event-media-suspend>suspend</a></code> at the
element.</li>
+ <li><p>Wait for the task to be run.</li>
+
<li><p>Wait for an implementation-defined event (e.g. the user
requesting that the media element begin playback).</li>
@@ -27251,9 +27253,10 @@
<code><a href=#the-canvas-element>canvas</a></code> gets tainted when the video is drawn on
it.</p>
- <p>Every 350ms (±200ms) or for every byte received, whichever
- is <em>least</em> frequent, <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-progress><a href=#event-media-progress>progress</a></code> at the element.</p>
+ <p>While the load is not suspended (see below), every 350ms
+ (±200ms) or for every byte received, whichever is
+ <em>least</em> frequent, <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-progress><a href=#event-media-progress>progress</a></code> at the element.</p>
<p>The <dfn id=stall-timeout>stall timeout</dfn> is a user-agent defined length of
time, which should be about three seconds. When a <a href=#media-element>media
@@ -27270,16 +27273,18 @@
throttled automatically by the user agent, e.g. to balance the
download with other connections sharing the same bandwidth.</p>
- <p>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, or while waiting for user input in an interactive
- resource. When a <a href=#media-element>media element</a>'s download has been
- suspended, the user agent must 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=#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. If and
- when downloading of the resource resumes, the user agent must 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>.</p>
+ <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, or while waiting for user
+ input in an interactive resource. 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> 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, as
+ described above).</p>
<p class=note>The <code title=attr-media-preload><a href=#attr-media-preload>preload</a></code> attribute provides a
hint regarding how much buffering the author thinks is advisable,
@@ -27472,8 +27477,10 @@
<p class=note>A user agent that is attempting to reduce
network usage while still fetching the metadata for each
<a href=#media-resource>media resource</a> would also stop buffering at this
- point, causing the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
- to switch to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value.</p>
+ point, following <a href=#resourceSuspend>the rules
+ described previously</a>, which involve the <code title=dom-media-networkState><a href=#dom-media-networkstate>networkState</a></code> attribute
+ switching to the <code title=dom-media-NETWORK_IDLE><a href=#dom-media-network_idle>NETWORK_IDLE</a></code> value and a
+ <code title=event-suspend>suspend</code> event firing.</p>
</li>
@@ -27494,10 +27501,21 @@
named <code title=event-media-progress><a href=#event-media-progress>progress</a></code> at the
<a href=#media-element>media element</a>.</p>
- <p>Then, <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 <a href=#media-element>media
+ <p>Then, <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 <a href=#media-element>media
element</a>.</p>
+ <p>If the user agent ever discards any <a href=#media-data>media data</a>
+ and then needs to resume the network activity to obtain it
+ again, then it must wait <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>.</p>
+
+ <p class=note>If the user agent can keep the <a href=#media-resource>media
+ resource</a> loaded, then the algorithm will continue to its
+ final step below, which aborts the algorithm.</p><!-- see FINAL
+ STEP below -->
+
</dd>
@@ -27677,6 +27695,7 @@
</li>
+ <!-- this step is mentioned above, search for "FINAL STEP" -->
<li><p>If the user agent ever reaches this step (which can only
happen if the entire resource gets loaded and kept available):
abort the overall <a href=#concept-media-load-algorithm title=concept-media-load-algorithm>resource selection
@@ -36954,7 +36973,7 @@
attribute's allowed keywords correspond to alignment points in the
font:</p>
- <p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like आ are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like Á, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square." height=300 src=http://images.whatwg.org/baselines.png width=738></p>
+ <p><img alt="The top of the em square is roughly at the top of the glyphs in a font, the hanging baseline is where some glyphs like आ are anchored, the middle is half-way between the top of the em square and the bottom of the em square, the alphabetic baseline is where characters like Á, ÿ, f, and Ω are anchored, the ideographic baseline is where glyphs like 私 and 達 are anchored, and the bottom of the em square is roughly at the bottom of the glyphs in a font. The top and bottom of the bounding box can be far from these baselines, due to glyphs extending far outside the em square." height=300 src=http://images.whatwg.org/baselines.png width=738></p>
<p>The keywords map to these alignment points as follows:</p>
Modified: source
===================================================================
--- source 2011-09-08 20:47:10 UTC (rev 6544)
+++ source 2011-09-08 21:57:20 UTC (rev 6545)
@@ -29566,6 +29566,8 @@
title="event-media-suspend">suspend</code> at the
element.</p></li>
+ <li><p>Wait for the task to be run.</p></li>
+
<li><p>Wait for an implementation-defined event (e.g. the user
requesting that the media element begin playback).</p></li>
@@ -29596,9 +29598,10 @@
<code>canvas</code> gets tainted when the video is drawn on
it.</p>
- <p>Every 350ms (±200ms) or for every byte received, whichever
- is <em>least</em> frequent, <span>queue a task</span> to
- <span>fire a simple event</span> named <code
+ <p>While the load is not suspended (see below), every 350ms
+ (±200ms) or for every byte received, whichever is
+ <em>least</em> frequent, <span>queue a task</span> to <span>fire a
+ simple event</span> named <code
title="event-media-progress">progress</code> at the element.</p>
<p>The <dfn>stall timeout</dfn> is a user-agent defined length of
@@ -29617,20 +29620,24 @@
throttled automatically by the user agent, e.g. to balance the
download with other connections sharing the same bandwidth.</p>
- <p>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, or while waiting for user input in an interactive
- resource. When a <span>media element</span>'s download has been
- suspended, the user agent must set the <code
+ <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, or while waiting for user
+ input in an interactive resource. When a <span>media
+ element</span>'s download has been suspended, the user agent must
+ <span>queue a task</span> to set the <code
title="dom-media-networkState">networkState</code> to <code
- title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> and <span>queue
- a task</span> to <span>fire a simple event</span> named <code
+ title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> and <span>fire
+ a simple event</span> named <code
title="event-media-suspend">suspend</code> at the element. If and
- when downloading of the resource resumes, the user agent must set
- the <code title="dom-media-networkState">networkState</code> to
- <code
- title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.</p>
+ when downloading of the resource resumes, the user agent must
+ <span>queue a task</span> to set the <code
+ title="dom-media-networkState">networkState</code> to <code
+ title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>. Between
+ the queuing of these tasks, the load is suspended (so <code
+ title="event-media-progress">progress</code> events don't fire, as
+ described above).</p>
<p class="note">The <code
title="attr-media-preload">preload</code> attribute provides a
@@ -29854,10 +29861,12 @@
<p class="note">A user agent that is attempting to reduce
network usage while still fetching the metadata for each
<span>media resource</span> would also stop buffering at this
- point, causing the <code
+ point, following <a href="#resourceSuspend">the rules
+ described previously</a>, which involve the <code
title="dom-media-networkState">networkState</code> attribute
- to switch to the <code
- title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> value.</p>
+ switching to the <code
+ title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> value and a
+ <code title="event-suspend">suspend</code> event firing.</p>
</li>
@@ -29881,11 +29890,25 @@
named <code title="event-media-progress">progress</code> at the
<span>media element</span>.</p>
- <p>Then, <span>queue a task</span> to <span>fire a simple
- event</span> named <code
+ <p>Then, <span>queue a task</span> to set the <code
+ title="dom-media-networkState">networkState</code> to <code
+ title="dom-media-NETWORK_IDLE">NETWORK_IDLE</code> and
+ <span>fire a simple event</span> named <code
title="event-media-suspend">suspend</code> at the <span>media
element</span>.</p>
+ <p>If the user agent ever discards any <span>media data</span>
+ and then needs to resume the network activity to obtain it
+ again, then it must wait <span>queue a task</span> to set the
+ <code title="dom-media-networkState">networkState</code> to
+ <code
+ title="dom-media-NETWORK_LOADING">NETWORK_LOADING</code>.</p>
+
+ <p class="note">If the user agent can keep the <span>media
+ resource</span> loaded, then the algorithm will continue to its
+ final step below, which aborts the algorithm.</p><!-- see FINAL
+ STEP below -->
+
</dd>
@@ -30104,6 +30127,7 @@
</li>
+ <!-- this step is mentioned above, search for "FINAL STEP" -->
<li><p>If the user agent ever reaches this step (which can only
happen if the entire resource gets loaded and kept available):
abort the overall <span
More information about the Commit-Watchers
mailing list