html5/spec spec.html,1.898,1.899 video.html,1.746,1.747

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv2755

Modified Files:
	spec.html video.html 
Log Message:
Make seeking async since some implementations can't tell if something is seekable synchronously. Also, make it not throw ever, and make it sanely re-entrant. (whatwg r4868)

[updated by splitter]


Index: video.html
===================================================================
RCS file: /sources/public/html5/spec/video.html,v
retrieving revision 1.746
retrieving revision 1.747
diff -u -d -r1.746 -r1.747
--- video.html	9 Mar 2010 00:36:41 -0000	1.746
+++ video.html	25 Mar 2010 09:36:37 -0000	1.747
@@ -2796,12 +2796,35 @@
 
   <p>When the user agent is required to <dfn id="dom-media-seek" title="dom-media-seek">seek</dfn> to a particular <var title="">new
   playback position</var> in the <a href="#media-resource">media resource</a>, it means
-  that the user agent must run the following steps:</p>
+  that the user agent must run the following steps. This algorithm
+  interacts closely with the <a href="webappapis.html#event-loop">event loop</a> mechanism; in
+  particular, it has a <a href="webappapis.html#synchronous-section">synchronous
+  section</a> (which is triggered as part of the <a href="webappapis.html#event-loop">event
+  loop</a> algorithm). Steps in that section are marked with
+  &#8987;.</p>
 
-  <ol><li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, then the user
-   agent must raise an <code><a href="infrastructure.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception (if
-   the seek was in response to a DOM method call or setting of an IDL
-   attribute), and abort these steps.</p></li>
+  <ol><li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, then raise an
+   <code><a href="infrastructure.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception (if the seek was in
+   response to a DOM method call or setting of an IDL attribute), and
+   abort these steps.</p></li>
+
+   <li><p>If the element's <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute is true,
+   then another instance of this algorithm is already running. Abort
+   that other instance of the algorithm without waiting for the step
+   that it is running to complete.</p></li>
+
+   <li><p>Set the <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL
+   attribute to true.</p></li>
+
+   <li id="seekUpdate"><p><a href="webappapis.html#queue-a-task">Queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a
+   simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
+   element.</p></li>
+
+   <li><p>If the seek was in response to a DOM method call or setting
+   of an IDL attribute, then continue the script. The remainder of
+   these steps must be run asynchronously. With the exception of the
+   steps marked with &#8987;, they could be aborted at any time by
+   another instance of this algorithm being invoked.</p></li>
 
    <li><p>If the <var title="">new playback position</var> is later
    than the end of the <a href="#media-resource">media resource</a>, then let it be the
@@ -2812,49 +2835,49 @@
    position instead.</p></li>
 
    <li><p>If the (possibly now changed) <var title="">new playback
-   position</var> is not in one of the ranges given in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute, then the user
-   agent must raise an <code><a href="infrastructure.html#index_size_err">INDEX_SIZE_ERR</a></code> exception (if the
-   seek was in response to a DOM method call or setting of an IDL
-   attribute), and abort these steps.</p></li>
-
-   <li><p>The <a href="#current-playback-position">current playback position</a> must be set to
-   the given <var title="">new playback position</var>.</p></li>
-
-   <li><p>The <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL
-   attribute must be set to true.</p></li>
+   position</var> is not in one of the ranges given in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute, then let it
+   be the position in one of the ranges given in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute that is the
+   nearest to the <var title="">new playback position</var>. If two
+   positions both satisfy that constraint (i.e. the <var title="">new
+   playback position</var> is exactly in the middle of a range in the
+   <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute) then
+   use the position that is closest to the <a href="#current-playback-position">current playback
+   position</a>. If there are no ranges given in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute then set the
+   <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute to
+   false and abort these steps.</p></li>
 
-   <li id="seekUpdate"><p>The user agent must <a href="webappapis.html#queue-a-task">queue a
-   task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the element.</p></li>
+   <li><p>Set the <a href="#current-playback-position">current playback position</a> to the given
+   <var title="">new playback position</var>.</p></li>
 
    <li><p>If the <a href="#media-element">media element</a> was <a href="#potentially-playing">potentially
    playing</a> immediately before it started seeking, but seeking
    caused its <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code>
-   attribute to change to a value lower than <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>, the
-   user agent must <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple
-   event</a> named <code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code> at
-   the element.</p></li>
+   attribute to change to a value lower than <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>, then
+   <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple event</a> named
+   <code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code> at the
+   element.</p></li>
 
    <li><p>If, when it reaches this step, the user agent has still not
    established whether or not the <a href="#media-data">media data</a> for the <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 href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple event</a>
-   named <code title="event-media-seeking"><a href="#event-media-seeking">seeking</a></code> at the
-   element.</p></li>
+   decoded enough data to play back that position, then <a href="webappapis.html#queue-a-task">queue a
+   task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple event</a> named <code title="event-media-seeking"><a href="#event-media-seeking">seeking</a></code> at the element.</p></li>
 
-   <li><p>If the seek was in response to a DOM method call or setting
-   of an IDL attribute, then continue the script. The remainder of
-   these steps must be run asynchronously.</p></li>
+   <li><p>Wait until it has established whether or not the <a href="#media-data">media
+   data</a> for the <var title="">new playback position</var> is
+   available, and, if it is, until it has decoded enough data to play
+   back that position.</p></li>
 
-   <li><p>The user agent must wait until it has established whether or
-   not the <a href="#media-data">media data</a> for the <var title="">new playback
-   position</var> is available, and, if it is, until it has decoded
-   enough data to play back that position.</p></li>
+   <li><p><a href="webappapis.html#await-a-stable-state">Await a stable state</a>. The <a href="webappapis.html#synchronous-section">synchronous
+   section</a> consists of all the remaining steps of this
+   algorithm. (Steps in the <a href="webappapis.html#synchronous-section">synchronous section</a> are
+   marked with &#8987;.)</p></li>
 
-   <li><p>The <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL
-   attribute must be set to false.</p></li>
+   <li><p>&#8987; Set the <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute to
+   false.</p></li>
 
-   <li><p>The user agent must <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire
-   a simple event</a> named <code title="event-media-seeked"><a href="#event-media-seeked">seeked</a></code> at the element.</p></li>
+   <li><p>&#8987; <a href="webappapis.html#queue-a-task">Queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple
+   event</a> named <code title="event-media-seeked"><a href="#event-media-seeked">seeked</a></code>
+   at the element.</p></li>
 
   </ol><p>The <dfn id="dom-media-seekable" title="dom-media-seekable"><code>seekable</code></dfn>
   attribute must return a new static <a href="#normalized-timeranges-object">normalized

Index: spec.html
===================================================================
RCS file: /sources/public/html5/spec/spec.html,v
retrieving revision 1.898
retrieving revision 1.899
diff -u -d -r1.898 -r1.899
--- spec.html	24 Mar 2010 09:06:40 -0000	1.898
+++ spec.html	25 Mar 2010 09:36:37 -0000	1.899
@@ -307,7 +307,7 @@
    </dl><p>This specification is available in the following formats: 
     <a href="Overview.html">single page HTML</a>,
     <a href="spec.html">multipage HTML</a>.
-This is revision 1.3896.
+This is revision 1.3897.
    </p> 
    <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
    &#169; 2010 <a href="http://www.w3.org/"><abbr title="World Wide

Received on Thursday, 25 March 2010 09:36:40 UTC