hixie: Make video.currentTime return a stable value rather than the current value. This lets us make setting this attribute always seem to work, so authors don't find the attribute hasn't changed after they set it. (whatwg r6531)

hixie: Make video.currentTime return a stable value rather than the
current value. This lets us make setting this attribute always seem to
work, so authors don't find the attribute hasn't changed after they set
it. (whatwg r6531)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5229&r2=1.5230&f=h
http://html5.org/tools/web-apps-tracker?from=6530&to=6531

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.5229
retrieving revision 1.5230
diff -u -d -r1.5229 -r1.5230
--- Overview.html 26 Aug 2011 20:11:46 -0000 1.5229
+++ Overview.html 29 Aug 2011 07:33:42 -0000 1.5230
@@ -321,7 +321,7 @@
 
    <h1>HTML5</h1>
    <h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>
-   <h2 class="no-num no-toc" id="editor-s-draft-26-august-2011">Editor's Draft 26 August 2011</h2>
+   <h2 class="no-num no-toc" id="editor-s-draft-29-august-2011">Editor's Draft 29 August 2011</h2>
    <dl><dt>Latest Published Version:</dt>
     <dd><a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a></dd>
     <dt>Latest Editor's Draft:</dt>
@@ -467,7 +467,7 @@
   Group</a> is the W3C working group responsible for this
   specification's progress along the W3C Recommendation
   track.
-  This specification is the 26 August 2011 Editor's Draft.
+  This specification is the 29 August 2011 Editor's Draft.
   </p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>Work on this specification is also done at the <a href="http://www.whatwg.org/">WHATWG</a>. The W3C HTML working group
   actively pursues convergence with the WHATWG, as required by the <a href="http://www.w3.org/2007/03/HTML-WG-charter">W3C HTML working
   group charter</a>.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
@@ -22563,7 +22563,9 @@
 
       <p>Set the <a href="#current-playback-position">current playback position</a> to 0.</p>
 
-      <p>If this changed the <a href="#current-playback-position">current playback position</a>,
+      <p>Set the <a href="#official-playback-position">official playback position</a> to 0.</p>
+
+      <p>If this changed the <a href="#official-playback-position">official playback position</a>,
       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-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
       <a href="#media-element">media element</a>.</p>
@@ -23030,8 +23032,9 @@
 
        </li>
 
-       <li><p>Set the <a href="#current-playback-position">current playback position</a> to the
-       <a href="#earliest-possible-position">earliest possible position</a>.</li>
+       <li><p>Set the <a href="#current-playback-position">current playback position</a> and the
+       <a href="#official-playback-position">official playback position</a> to the <a href="#earliest-possible-position">earliest
+       possible position</a>.</li>
 
        <li>
 
@@ -23072,9 +23075,7 @@
         <p>If either the <a href="#media-resource">media resource</a> or the address of
         the <var title="">current media resource</var> indicate a
         particular start time, then set the <a href="#initial-playback-position">initial playback
-        position</a> to that time, <a href="#dom-media-seek" title="dom-media-seek">seek</a> to that time, and let <var title="">jumped</var> be true. Ignore any resulting exceptions
-        (if the position is out of range, it is effectively
-        ignored).</p>
+        position</a> to that time, <a href="#dom-media-seek" title="dom-media-seek">seek</a> to that time, and let <var title="">jumped</var> be true.</p>
 
         <p class="example">For example, with media formats that
         support the <cite>Media Fragments URI</cite> fragment
@@ -23106,8 +23107,8 @@
        <a href="#current-media-controller">current media controller</a>'s timeline; otherwise,
        <a href="#dom-media-seek" title="dom-media-seek">seek</a> the <a href="#media-element">media
        element</a> to the <a href="#media-controller-position">media controller position</a>,
-       relative to the <a href="#media-element">media element</a>'s timeline,
-       discarding any resulting exceptions.</li>  
+       relative to the <a href="#media-element">media element</a>'s timeline.</li>
+        
        <li>
 
         <p>Once the <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute
@@ -23409,7 +23410,7 @@
 
    <dd>
 
-    <p>Returns the <a href="#current-playback-position">current playback position</a>, in seconds.</p>
+    <p>Returns the <a href="#official-playback-position">official playback position</a>, in seconds.</p>
 
     <p>Can be set, to seek to the given time.<p>
 
@@ -23519,15 +23520,23 @@
   <a href="#current-playback-position">current playback position</a> is a time on the <a href="#media-timeline">media
   timeline</a>.</p>
 
+  <p><a href="#media-element" title="media element">Media elements</a> also have an
+  <dfn id="official-playback-position">official playback position</dfn>, which must initially be set
+  to zero seconds. The <a href="#official-playback-position">official playback position</a> is an
+  approximation of the <a href="#current-playback-position">current playback position</a>
+  that is kept stable while scripts are running.</p>
+
   <p>The <dfn id="dom-media-currenttime" title="dom-media-currentTime"><code>currentTime</code></dfn>
-  attribute must, on getting, return the <a href="#current-playback-position">current playback
-  position</a>, expressed in seconds. On setting,
-  if the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
-  controller</a>, then it must throw an
-  <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception; otherwise,
-  the user agent
-  must <a href="#dom-media-seek" title="dom-media-seek">seek</a> to the new value
-  (which might raise an exception).</p>
+  attribute must, on getting, return the <a href="#official-playback-position">official playback
+  position</a>, expressed in seconds. On setting, if the
+  <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
+  controller</a>, then the user agent must throw an
+  <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception; otherwise, 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 it must
+  raise an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception; otherwise, the it
+  must set the <a href="#official-playback-position">official playback position</a> to the new
+  value and then <a href="#dom-media-seek" title="dom-media-seek">seek</a> to the new
+  value.</p>
 
   <p><a href="#media-element" title="media element">Media elements</a> have an
   <dfn id="initial-playback-position">initial playback position</dfn>, which must initially (i.e. in
@@ -24062,7 +24071,8 @@
    true.</li>
 
    <li><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> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the element.</li>
+   a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
+   element.</li>
 
    <li><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> named <code title="event-media-ended"><a href="#event-media-ended">ended</a></code>
@@ -24076,7 +24086,8 @@
   <ol><li><p>Stop playback.</li>
 
    <li><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> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the element.</li>
+   a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
+   element.</li>
 
   </ol><hr><p>The <dfn id="dom-media-defaultplaybackrate" title="dom-media-defaultPlaybackRate"><code>defaultPlaybackRate</code></dfn>
   attribute gives the desired speed at which the <a href="#media-resource">media
@@ -24144,8 +24155,8 @@
 
     <p class="note">This <a href="#seekUpdate">will cause</a> the user
     agent to <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-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the <a href="#media-element">media
-    element</a>.</p> 
+    event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
+    <a href="#media-element">media element</a>.</p> 
    </li>
 
    <li><p>If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current
@@ -24217,6 +24228,9 @@
      event</a> named <code title="event-media-pause"><a href="#event-media-pause">pause</a></code>
      at the element.</li>
 
+     <li><p>Set the <a href="#official-playback-position">official playback position</a> to the
+     <a href="#current-playback-position">current playback position</a>.</li>
+
     </ol></li>
 
    <li><p>If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
@@ -24262,6 +24276,11 @@
   playback rate) the client doesn't actually have to drop or
   interpolate any frames.</p>
 
+  <p>Any time the user agent <a href="#provide-a-stable-state" title="provide a stable
+  state">provides a stable state</a>, the <a href="#official-playback-position">official playback
+  position</a> must be set to the <a href="#current-playback-position">current playback
+  position</a>.</p>
+
   <p>When the <a href="#direction-of-playback">direction of playback</a> is backwards, any
   corresponding audio must be muted. When the <a href="#effective-playback-rate">effective playback
   rate</a> is so low or so high that the user agent cannot play
@@ -24525,10 +24544,8 @@
   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 raise an
-   <code><a href="#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.</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>, abort these
+   steps.</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
@@ -24581,6 +24598,11 @@
     element.</p> 
     
 
+    <p class="note">The <code title="dom-media-currentTime"><a href="#dom-media-currenttime">currentTime</a></code> attribute does
+    not get updated asynchronously, as it returns the <a href="#official-playback-position">official
+    playback position</a>, not the <a href="#current-playback-position">current playback
+    position</a>.</p>
+
    </li>
 
    <li><p>Wait until the user agent has established whether or not the
@@ -25499,7 +25521,7 @@
   speed with its new media controller</dfn>, it must <a href="#dom-media-seek" title="dom-media-seek">seek</a> that <a href="#media-element">media element</a>
   to the <code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-position">media controller
   position</a> relative to the <a href="#media-element">media element</a>'s
-  timeline, discarding any resulting exceptions.</p>
+  timeline.</p>
 
   <p>When the user agent is to <dfn id="seek-the-media-controller">seek the media controller</dfn> to
   a particular <var title="">new playback position</var>, it must
@@ -25516,8 +25538,7 @@
 
    <li><p><a href="#dom-media-seek" title="dom-media-seek">Seek</a> each <a href="#slaved-media-elements" title="slaved media elements">slaved media element</a> to the
    <var title="">new playback position</var> relative to the
-   <a href="#media-element">media element</a> timeline, discarding any resulting
-   exceptions.</li> 
+   <a href="#media-element">media element</a> timeline.</li> 
   </ol><p>A <code><a href="#mediacontroller">MediaController</a></code> is a <dfn id="blocked-media-controller">blocked media
   controller</dfn> if the <code><a href="#mediacontroller">MediaController</a></code> is a
   <a href="#paused-media-controller">paused media controller</a>, or if any of its <a href="#slaved-media-elements">slaved

Received on Monday, 29 August 2011 07:36:07 UTC