[html5] r2080 - [] (0) More poking around getting the media element section to use the new event [...]
whatwg at whatwg.org
whatwg at whatwg.org
Mon Aug 18 17:57:49 PDT 2008
Author: ianh
Date: 2008-08-18 17:57:47 -0700 (Mon, 18 Aug 2008)
New Revision: 2080
Modified:
index
source
Log:
[] (0) More poking around getting the media element section to use the new event loop stuff.
Modified: index
===================================================================
--- index 2008-08-18 21:27:22 UTC (rev 2079)
+++ index 2008-08-19 00:57:47 UTC (rev 2080)
@@ -28,7 +28,7 @@
<h1 id=html-5>HTML 5</h1>
- <h2 class="no-num no-toc" id=draft>Draft Recommendation — 18 August
+ <h2 class="no-num no-toc" id=draft>Draft Recommendation — 19 August
2008</h2>
<p>You can take part in this work. <a
@@ -13046,7 +13046,7 @@
<dd><code title=attr-hyperlink-rel><a href="#rel3">rel</a></code>
- <dd><code title=attr-hyperlink-media><a href="#media12">media</a></code>
+ <dd><code title=attr-hyperlink-media><a href="#media14">media</a></code>
<dd><code title=attr-hyperlink-hreflang><a
href="#hreflang3">hreflang</a></code>
@@ -13085,7 +13085,7 @@
href="#target3">target</a></code>, <code title=attr-hyperlink-ping><a
href="#ping">ping</a></code>, <code title=attr-hyperlink-rel><a
href="#rel3">rel</a></code>, <code title=attr-hyperlink-media><a
- href="#media12">media</a></code>, <code title=attr-hyperlink-hreflang><a
+ href="#media14">media</a></code>, <code title=attr-hyperlink-hreflang><a
href="#hreflang3">hreflang</a></code>, and <code
title=attr-hyperlink-type><a href="#type20">type</a></code> attributes
must be omitted if the <code title=attr-hyperlink-href><a
@@ -13114,7 +13114,7 @@
title=attr-hyperlink-ping><a href="#ping">ping</a></code> attributes
decide how the link is followed. The <code title=attr-hyperlink-rel><a
href="#rel3">rel</a></code>, <code title=attr-hyperlink-media><a
- href="#media12">media</a></code>, <code title=attr-hyperlink-hreflang><a
+ href="#media14">media</a></code>, <code title=attr-hyperlink-hreflang><a
href="#hreflang3">hreflang</a></code>, and <code
title=attr-hyperlink-type><a href="#type20">type</a></code> attributes may
be used to indicate to the user the likely nature of the target resource
@@ -18689,8 +18689,8 @@
<code title=dom-media-load><a href="#load">load()</a></code> method on the
<a href="#media7">media element</a>, and ignores any resulting exceptions.
The <a href="#task-source">task source</a> for this task is the <a
- href="#media7">media element</a>'s own <a href="#new-resource">new
- resource task source</a>.
+ href="#media7">media element</a>'s own <a href="#media12">media element
+ new resource task source</a>.
<p>The DOM attributes <dfn id=src6
title=dom-source-src><code>src</code></dfn>, <dfn id=type9
@@ -18821,6 +18821,15 @@
resource</dfn> is used to refer to the complete set of media data, e.g.
the complete video file, or complete audio file.
+ <p><a href="#media7" title="media element">Media elements</a> use two <a
+ href="#task-queues" title="task queue">task queues</a>, the <dfn
+ id=media11>media element event task source</dfn> for asynchronous events
+ and callbacks, and the <dfn id=media12>media element new resource task
+ source</dfn> for handling implicit loads. Unless otherwise specified, all
+ the tasks <a href="#queue" title="queue a task">queued</a> in this section
+ and its subsections use the <a href="#media11">media element event task
+ source</a>.
+
<h5 id=error><span class=secno>4.7.10.1. </span>Error codes</h5>
<p>All <a href="#media7" title="media element">media elements</a> have an
@@ -18883,8 +18892,8 @@
href="#load">load()</a></code> method on the <a href="#media7">media
element</a>, and ignores any resulting exceptions. The <a
href="#task-source">task source</a> for this task is the <a
- href="#media7">media element</a>'s own <a href="#new-resource">new
- resource task source</a>.
+ href="#media7">media element</a>'s own <a href="#media12">media element
+ new resource task source</a>.
<p class=note>If a <code title=attr-media-src><a
href="#src7">src</a></code> attribute is specified, the resource it
@@ -19072,10 +19081,15 @@
<ol>
<li>
<p>If there are any <a href="#tasks" title=concept-task>tasks</a> from
- the <a href="#media7">media element</a>'s own <dfn id=new-resource>new
- resource task source</dfn> in one of the <a href="#task-queues"
- title="task queue">task queues</a>, then remove those tasks.
+ the <a href="#media7">media element</a>'s <a href="#media12">media
+ element new resource task source</a> or its <a href="#media11">media
+ element event task source</a> in one of the <a href="#task-queues"
+ title="task queue">task queues</a>, then remove those tasks.</p>
+ <p class=note>Basically, pending events, callbacks, and loads for the
+ media element are discarded when the media element starts loading a new
+ resource.</p>
+
<li>
<p>Any already-running instance of this algorithm for this element must
be aborted. If those method calls have not yet returned, they must
@@ -19458,8 +19472,8 @@
href="#load">load()</a></code> method on the <a href="#media7">media
element</a>, and ignores any resulting exceptions. The <a
href="#task-source">task source</a> for this task is the <a
- href="#media7">media element</a>'s own <a href="#new-resource">new
- resource task source</a>.
+ href="#media7">media element</a>'s own <a href="#media12">media element
+ new resource task source</a>.
<p>The <dfn id=bufferingrate
title=dom-media-bufferingRate><code>bufferingRate</code></dfn> attribute
@@ -19523,12 +19537,11 @@
<p>When the length of the <a href="#media10">media resource</a> changes
(e.g. from being unknown to known, or from indeterminate to known, or from
- a previously established length to a new length) the user agent must, once
- any running scripts have finished, <a href="#firing2">fire a simple
+ a previously established length to a new length) the user agent must <a
+ href="#queue">queue a task</a> to <a href="#firing2">fire a simple
event</a> called <code title=event-durationchange><a
href="#durationchange">durationchange</a></code> at the <a
- href="#media7">media element</a>.</p>
- <!-- xxx queue -->
+ href="#media7">media element</a>.
<p><a href="#media7" title="media element">Media elements</a> have a <dfn
id=current0>current playback position</dfn>, which must initially be zero.
@@ -19967,20 +19980,19 @@
href="#stopped">stopped due to errors</a>, or playback having <a
href="#paused0">paused for user interaction</a>, or the <a href="#seek"
title=dom-media-seek>seeking algorithm</a> being invoked, the user agent
- must <a href="#firing2">fire a simple event</a> called <code
- title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at the
- element, and then must <a href="#firing2">fire a simple event</a> called
- <code title=event-waiting><a href="#waiting">waiting</a></code> at the
- element.</p>
- <!-- xxx queue -->
+ must <a href="#queue">queue a task</a> to <a href="#firing2">fire a simple
+ event</a> called <code title=event-timeupdate><a
+ href="#timeupdate">timeupdate</a></code> at the element, and <a
+ href="#queue">queue a task</a> to <a href="#firing2">fire a simple
+ event</a> called <code title=event-waiting><a
+ href="#waiting">waiting</a></code> at the element.
<p>When a <a href="#media7">media element</a> that is <a
href="#actively">actively playing</a> stops playing because it has <a
href="#paused0">paused for user interaction</a>, the user agent must <a
- href="#firing2">fire a simple event</a> called <code
- title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at the
- element.</p>
- <!-- xxx queue -->
+ href="#queue">queue a task</a> to <a href="#firing2">fire a simple
+ event</a> called <code title=event-timeupdate><a
+ href="#timeupdate">timeupdate</a></code> at the element.
<p>When <code title=dom-media-currentLoop><a
href="#currentloop">currentLoop</a></code> is less than <span><code
@@ -19988,12 +20000,12 @@
href="#playcount0">playCount</a></code>-1</span> and the <a
href="#current0">current playback position</a> reaches the <var><a
href="#effective1">effective loop end</a></var>, then the user agent must
- <a href="#seek" title=dom-media-seek>seek</a> to the <var><a
- href="#effective0">effective loop start</a></var>, increase <code
- title=dom-media-currentLoop><a href="#currentloop">currentLoop</a></code>
- by 1, and <a href="#firing2">fire a simple event</a> called <code
- title=event-timeupdate><a href="#timeupdate">timeupdate</a></code>.</p>
- <!-- xxx queue -->
+ increase <code title=dom-media-currentLoop><a
+ href="#currentloop">currentLoop</a></code> by 1, <a href="#queue">queue a
+ task</a> to <a href="#firing2">fire a simple event</a> called <code
+ title=event-timeupdate><a href="#timeupdate">timeupdate</a></code>, and <a
+ href="#seek" title=dom-media-seek>seek</a> to the <var><a
+ href="#effective0">effective loop start</a></var>.
<p>When <code title=dom-media-currentLoop><a
href="#currentloop">currentLoop</a></code> is equal to the <span><code
@@ -20012,16 +20024,15 @@
href="#ended0">ended</a></code> attribute becomes true.
<li>
- <p>The user agent must <a href="#firing2">fire a simple event</a> called
- <code title=event-timeupdate><a href="#timeupdate">timeupdate</a></code>
- at the element.
- </li>
- <!-- xxx queue -->
+ <p>The user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at
+ the element.
<li>
- <p>The user agent must <a href="#firing2">fire a simple event</a> called
- <code title=event-ended><a href="#ended1">ended</a></code> at the
- element.
+ <p>The user agent must <a href="#queue">queue a task</a> to <a
+ href="#firing2">fire a simple event</a> called <code
+ title=event-ended><a href="#ended1">ended</a></code> at the element.
</ol>
<p>The <dfn id=defaultplaybackrate
@@ -20050,13 +20061,14 @@
title=dom-media-playbackRate><a
href="#playbackrate">playbackRate</a></code> attributes change value
(either by being set by script or by being changed directly by the user
- agent, e.g. in response to user control) the user agent must, once any
- running scripts have finished, <a href="#firing2">fire a simple event</a>
- called <code title=event-ratechange><a
+ agent, e.g. in response to user control) the user agent must <a
+ href="#queue">queue a task</a> to <a href="#firing2">fire a simple
+ event</a> called <code title=event-ratechange><a
href="#ratechange">ratechange</a></code> at the <a href="#media7">media
- element</a>.</p>
- <!-- xxx queue -->
+ element</a>.
+ <hr>
+
<p>When the <dfn id=play title=dom-media-play><code>play()</code></dfn>
method on a <a href="#media7">media element</a> is invoked, the user agent
must run the following steps.
@@ -23746,7 +23758,7 @@
<dd><code title=attr-hyperlink-rel><a href="#rel3">rel</a></code>
- <dd><code title=attr-hyperlink-media><a href="#media12">media</a></code>
+ <dd><code title=attr-hyperlink-media><a href="#media14">media</a></code>
<dd><code title=attr-hyperlink-hreflang><a
href="#hreflang3">hreflang</a></code>
@@ -23766,7 +23778,7 @@
attribute DOMString <a href="#ping1" title=dom-area-ping>ping</a>;
attribute DOMString <a href="#rel2" title=dom-area-rel>rel</a>;
readonly attribute DOMTokenList <a href="#rellist1" title=dom-area-relList>relList</a>;
- attribute DOMString <a href="#media11" title=dom-area-media>media</a>;
+ attribute DOMString <a href="#media13" title=dom-area-media>media</a>;
attribute DOMString <a href="#hreflang2" title=dom-area-hreflang>hreflang</a>;
attribute DOMString <a href="#type10" title=dom-area-type>type</a>;
};</pre>
@@ -23925,7 +23937,7 @@
<code title=attr-hyperlink-ping><a href="#ping">ping</a></code> attributes
decide how the link is followed. The <code title=attr-hyperlink-rel><a
href="#rel3">rel</a></code>, <code title=attr-hyperlink-media><a
- href="#media12">media</a></code>, <code title=attr-hyperlink-hreflang><a
+ href="#media14">media</a></code>, <code title=attr-hyperlink-hreflang><a
href="#hreflang3">hreflang</a></code>, and <code
title=attr-hyperlink-type><a href="#type20">type</a></code> attributes may
be used to indicate to the user the likely nature of the target resource
@@ -23935,7 +23947,7 @@
href="#target3">target</a></code>, <code title=attr-hyperlink-ping><a
href="#ping">ping</a></code>, <code title=attr-hyperlink-rel><a
href="#rel3">rel</a></code>, <code title=attr-hyperlink-media><a
- href="#media12">media</a></code>, <code title=attr-hyperlink-hreflang><a
+ href="#media14">media</a></code>, <code title=attr-hyperlink-hreflang><a
href="#hreflang3">hreflang</a></code>, and <code
title=attr-hyperlink-type><a href="#type20">type</a></code> attributes
must be omitted if the <code title=attr-hyperlink-href><a
@@ -23972,7 +23984,7 @@
title=dom-area-href><code>href</code></dfn>, <dfn id=target2
title=dom-area-target><code>target</code></dfn>, <dfn id=ping1
title=dom-area-ping><code>ping</code></dfn>, <dfn id=rel2
- title=dom-area-rel><code>rel</code></dfn>, <dfn id=media11
+ title=dom-area-rel><code>rel</code></dfn>, <dfn id=media13
title=dom-area-media><code>media</code></dfn>, <dfn id=hreflang2
title=dom-area-hreflang><code>hreflang</code></dfn>, and <dfn id=type10
title=dom-area-type><code>type</code></dfn>, each must <a
@@ -38432,11 +38444,11 @@
with the destination resource other than there being a hyperlink between
the two.
- <p>The <dfn id=media12 title=attr-hyperlink-media><code>media</code></dfn>
+ <p>The <dfn id=media14 title=attr-hyperlink-media><code>media</code></dfn>
attribute describes for which media the target document was designed. It
is purely advisory. The value must be a valid <a href="#mq">media
query</a>. <a href="#refsMQ">[MQ]</a> The default, if the <code
- title=attr-hyperlink-media><a href="#media12">media</a></code> attribute
+ title=attr-hyperlink-media><a href="#media14">media</a></code> attribute
is omitted, is <code>all</code>.
<p>The <dfn id=hreflang3
@@ -38974,14 +38986,14 @@
representation of the current document.
<p>The nature of the referenced document is given by the <code
- title=attr-hyperlink-media><a href="#media12">media</a></code>, <code
+ title=attr-hyperlink-media><a href="#media14">media</a></code>, <code
title=attr-hyperlink-hreflang><a href="#hreflang3">hreflang</a></code>,
and <code title=attr-hyperlink-type><a href="#type20">type</a></code>
attributes.
<p>If the <code title=rel-alternate><a
href="#alternate">alternate</a></code> keyword is used with the <code
- title=attr-hyperlink-media><a href="#media12">media</a></code> attribute,
+ title=attr-hyperlink-media><a href="#media14">media</a></code> attribute,
it indicates that the referenced document is intended for use with the
media specified.
@@ -38999,7 +39011,7 @@
document in the specified format.
<p>The <code title=attr-hyperlink-media><a
- href="#media12">media</a></code>, <code title=attr-hyperlink-hreflang><a
+ href="#media14">media</a></code>, <code title=attr-hyperlink-hreflang><a
href="#hreflang3">hreflang</a></code>, and <code
title=attr-hyperlink-type><a href="#type20">type</a></code> attributes can
be combined when specified with the <code title=rel-alternate><a
Modified: source
===================================================================
--- source 2008-08-18 21:27:22 UTC (rev 2079)
+++ source 2008-08-19 00:57:47 UTC (rev 2080)
@@ -16202,7 +16202,7 @@
title="dom-media-load">load()</code> method on the <span>media
element</span>, and ignores any resulting exceptions. The <span>task
source</span> for this task is the <span>media element</span>'s own
- <span>new resource task source</span>.</p>
+ <span>media element new resource task source</span>.</p>
<p>The DOM attributes <dfn
title="dom-source-src"><code>src</code></dfn>, <dfn
@@ -16336,8 +16336,17 @@
resource</dfn> is used to refer to the complete set of media data,
e.g. the complete video file, or complete audio file.</p>
+ <p><span title="media element">Media elements</span> use two <span
+ title="task queue">task queues</span>, the <dfn>media element event
+ task source</dfn> for asynchronous events and callbacks, and the
+ <dfn>media element new resource task source</dfn> for handling
+ implicit loads. Unless otherwise specified, all the tasks <span
+ title="queue a task">queued</span> in this section and its
+ subsections use the <span>media element event task
+ source</span>.</p>
+
<h5>Error codes</h5>
<p>All <span title="media element">media elements</span> have an
@@ -16395,8 +16404,8 @@
implicitly invokes the <code title="dom-media-load">load()</code>
method on the <span>media element</span>, and ignores any resulting
exceptions. The <span>task source</span> for this task is the
- <span>media element</span>'s own <span>new resource task
- source</span>.</p>
+ <span>media element</span>'s own <span>media element new resource
+ task source</span>.</p>
<p class="note">If a <code title="attr-media-src">src</code>
attribute is specified, the resource it specifies is the <span>media
@@ -16578,11 +16587,20 @@
<ol>
- <li><p>If there are any <span title="concept-task">tasks</span>
- from the <span>media element</span>'s own <dfn>new resource task
- source</dfn> in one of the <span title="task queue">task
- queues</span>, then remove those tasks.</p></li>
+ <li>
+ <p>If there are any <span title="concept-task">tasks</span> from
+ the <span>media element</span>'s <span>media element new resource
+ task source</span> or its <span>media element event 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, callbacks, and loads
+ for the media element are discarded when the media element starts
+ loading a new resource.</p>
+
+ </li>
+
<li><p>Any already-running instance of this algorithm for this
element must be aborted. If those method calls have not yet
returned, they must finish the step they are on, and then
@@ -16969,8 +16987,8 @@
implicitly invokes the <code title="dom-media-load">load()</code>
method on the <span>media element</span>, and ignores any resulting
exceptions. The <span>task source</span> for this task is the
- <span>media element</span>'s own <span>new resource task
- source</span>.</p>
+ <span>media element</span>'s own <span>media element new resource
+ task source</span>.</p>
<p>The <dfn
title="dom-media-bufferingRate"><code>bufferingRate</code></dfn>
@@ -17034,10 +17052,10 @@
<p>When the length of the <span>media resource</span> changes
(e.g. from being unknown to known, or from indeterminate to known,
or from a previously established length to a new length) the user
- agent must, once any running scripts have finished, <span>fire a
- simple event</span> called <code
+ agent must <span>queue a task</span> to <span>fire a simple
+ event</span> called <code
title="event-durationchange">durationchange</code> at the
- <span>media element</span>.</p><!-- xxx queue -->
+ <span>media element</span>.</p>
<p><span title="media element">Media elements</span> have a
<dfn>current playback position</dfn>, which must initially be
@@ -17441,28 +17459,28 @@
having <span>ended playback</span>, or playback having <span>stopped
due to errors</span>, or playback having <span>paused for user
interaction</span>, or the <span title="dom-media-seek">seeking
- algorithm</span> being invoked, the user agent must <span>fire a
- simple event</span> called <code
- title="event-timeupdate">timeupdate</code> at the element, and then
- must <span>fire a simple event</span> called <code
- title="event-waiting">waiting</code> at the element.</p><!-- xxx queue -->
+ algorithm</span> being invoked, the user agent must <span>queue a
+ task</span> to <span>fire a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code> at the element, and
+ <span>queue a task</span> to <span>fire a simple event</span> called
+ <code title="event-waiting">waiting</code> at the element.</p>
<p>When a <span>media element</span> that is <span>actively
playing</span> stops playing because it has <span>paused for user
- interaction</span>, the user agent must <span>fire a simple
- event</span> called <code title="event-timeupdate">timeupdate</code>
- at the element.</p><!-- xxx queue -->
+ interaction</span>, the user agent must <span>queue a task</span> to
+ <span>fire a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code> at the element.</p>
<p>When <code title="dom-media-currentLoop">currentLoop</code> is
less than <span><code
title="dom-media-playCount">playCount</code>-1</span> and the
<span>current playback position</span> reaches the <var>effective
- loop end</var>, then the user agent must <span
+ loop end</var>, then the user agent must increase <code
+ title="dom-media-currentLoop">currentLoop</code> by 1, <span>queue a
+ task</span> to <span>fire a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code>, and <span
title="dom-media-seek">seek</span> to the <var>effective loop
- start</var>, increase <code
- title="dom-media-currentLoop">currentLoop</code> by 1, and
- <span>fire a simple event</span> called <code
- title="event-timeupdate">timeupdate</code>.</p><!-- xxx queue -->
+ start</var>.</p>
<p>When <code title="dom-media-currentLoop">currentLoop</code> is
equal to the <span><code
@@ -17477,12 +17495,13 @@
<li><p class="note">The <code title="dom-media-ended">ended</code>
attribute becomes true.</p></li>
- <li><p>The user agent must <span>fire a simple event</span> called
- <code title="event-timeupdate">timeupdate</code> at the
- element.</p></li><!-- xxx queue -->
+ <li><p>The user agent must <span>queue a task</span> to <span>fire
+ a simple event</span> called <code
+ title="event-timeupdate">timeupdate</code> at the element.</p></li>
- <li><p>The user agent must <span>fire a simple event</span> called
- <code title="event-ended">ended</code> at the element.</p></li>
+ <li><p>The user agent must <span>queue a task</span> to <span>fire
+ a simple event</span> called <code title="event-ended">ended</code>
+ at the element.</p></li>
</ol>
@@ -17514,14 +17533,14 @@
<code title="dom-media-playbackRate">playbackRate</code> attributes
change value (either by being set by script or by being changed
directly by the user agent, e.g. in response to user control) the
- user agent must, once any running scripts have finished, <span>fire
+ user agent must <span>queue a task</span> to <span>fire
a simple event</span> called <code
title="event-ratechange">ratechange</code> at the <span>media
- element</span>.</p><!-- xxx queue -->
+ element</span>.</p>
+ <hr>
-
<p>When the <dfn title="dom-media-play"><code>play()</code></dfn>
method on a <span>media element</span> is invoked, the user agent
must run the following steps.</p>
More information about the Commit-Watchers
mailing list