- From: poot <cvsmail@w3.org>
- Date: Mon, 18 Aug 2008 13:27:59 +0900 (JST)
- To: public-html-diffs@w3.org
Tasks for the media element new resource task source. (whatwg r2076) about:blank http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#aboutblank tasks http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#tasks browsing context name http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#browsing3 3.3.3 Global attributes http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#global task queues http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#task-queues src http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#src6 src http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#src7 frameElement http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#frameelement duration http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#duration pause() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#pause0 seek http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#seek 5.4.2 Event loops http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#event pixelratio http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#pixelratio networking task source http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#networking adjusted aspect ratio http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#adjusted1 datagrid http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#datagrid0 muted http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#muted Once any running scripts have finished executing, the user agent must fire a simple event called timeupdate at the element. http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#seekUpdate removeCueRanges(className) http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#removecueranges relList http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#rellist0 Window http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#window href http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#href3 effective script origin http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#effective3 HTMLElement http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#htmlelement close() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#close3 alt http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#alt3 Setting http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#setting 3.4.2 Transparent content models http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#transparent play() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#play When a media element that is actively playing stops playing because its readyState attribute changes to a value lower than CAN_PLAY, without the element having ended playback, or playback having stopped due to errors, or playback having paused for user interaction, or the seeking algorithm being invoked, the user agent must fire a simple event called timeupdate at the element, and then must fire a simple event called waiting at the element. http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#fire-waiting-when-waiting complete http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#complete coords http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#coords0 swapCache() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#swapcache 5.4.5.1. Event handler attributes http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#event-handler-attributes ping http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#ping0 playbackRate http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#playbackrate with script http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#with-script 5.10.1.6. Threads http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#threads seekable http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#seekable Setting http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#setting0 current playback position http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#current0 rectangle state http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#rectangle0 Interactive content http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#interactive1 close http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#close1 unit of related similar-origin browsing contexts http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#unit-of0 4.7.10.11. Time ranges http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#time-ranges Once enough of the media data has been fetched to enable the user agent to display the frame at the effective start of the media resource http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#handling-first-frame-available 5.4.3 Security exceptions http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#security4 queue a task http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#queue bufferingRate http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#bufferingrate hyperlink suffix http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#hyperlink2 unit of related browsing contexts http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#unit-of task source http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#task-source 5.1.6 Browsing context names http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#browsing Event handler DOM attributes http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#event6 type http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#type9 event handler attributes http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#event4 Event handler content attributes http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#event5 event loops http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#event3 5.4 Scripting http://people.w3.org/mike/diffs/html5/spec/Overview.1.1249.html#scripting http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1248&r2=1.1249&f=h http://html5.org/tools/web-apps-tracker?from=2075&to=2076 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.1248 retrieving revision 1.1249 diff -u -d -r1.1248 -r1.1249 --- Overview.html 14 Aug 2008 22:09:58 -0000 1.1248 +++ Overview.html 18 Aug 2008 04:24:40 -0000 1.1249 @@ -27,7 +27,7 @@ for HTML and XHTML</h2> <h2 class="no-num no-toc" id=editors0><!-- "W3C Working Draft" --> - Editor's Draft <!--ZZZ-->14 August 2008</h2> + Editor's Draft <!--ZZZ-->18 August 2008</h2> <dl><!-- ZZZ: update the month/day <dt>This Version:</dt> @@ -199,7 +199,7 @@ <p>The W3C <a href="http://www.w3.org/html/wg/">HTML Working Group</a> is the W3C working group responsible for this specification's progress along - the W3C Recommendation track. <!--ZZZ:--> This specification is the 14 + the W3C Recommendation track. <!--ZZZ:--> This specification is the 18 August 2008 <!--ZZZ "Working Draft"-->Editor's Draft. <!--:ZZZ--></p> <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --> <!-- relationship to other work (required) --> @@ -5482,23 +5482,34 @@ <li> <p>Perform the remaining steps asynchronously. - </li> - <!-- XXX queue interaction --> <li> <p>If the resource identified by the resulting <a href="#absolute">absolute URL</a> is already being downloaded for other - reasons (e.g. another invocation of this algorithm), then the results of - that existing download process may be used for the purposes of this one, - in which case the following step must be skipped. + reasons (e.g. another invocation of this algorithm), and the resource is + to be obtained using a idempotent action (such as an HTTP GET or + equivalent), and the user agent is configured such that it is to reuse + the data from the existing download instead of initiating a new one, + then use the results of the existing download instead of starting a new + one.</p> - <li> - <p>At a time convenient to the user and the user agent, download the - resource, applying the semantics of the relevant specifications (e.g. - performing an HTTP GET or POST operation, or reading the file from disk, - following redirects, <a href="#dereferenced" + <p>Otherwise, at a time convenient to the user and the user agent, + download the resource, applying the semantics of the relevant + specifications (e.g. performing an HTTP GET or POST operation, or + reading the file from disk, following redirects, <a href="#dereferenced" title=concept-js-deref>dereferencing <span title="javascript - protocol"><code title="">javascript:</code> URLs</span></a>, etc). + protocol"><code title="">javascript:</code> URLs</span></a>, etc).</p> + + <li> + <p>When the resource is available, <a href="#queue">queue a task</a> that + uses the resource as appropriate. If the resource can be processed + incrementally, as, for instance, with a progressively interlaced JPEG or + an HTML file, multiple tasks may be queued to process the data as it is + downloaded. The <a href="#task-source">task source</a> for these tasks + is the <dfn id=networking>networking task source</dfn>.</p> + <!-- XXX make sure each use of 'fetch' defines what the appropriate + task is --> + </ol> <p class=note>The <span>offline application cache</span> processing model @@ -7695,7 +7706,7 @@ attribute DOMString <a href="#registrationmark0" title=dom-registrationMark>registrationMark</a>; readonly attribute DocumentFragment <a href="#originalcontent" title=dom-originalContent>originalContent</a>; - // <a href="#event5">event handler DOM attributes</a> + // <a href="#event6">event handler DOM attributes</a> attribute <span>EventListener</span> <a href="#onabort" title=handler-onabort>onabort</a>; attribute <span>EventListener</span> <a href="#onbeforeunload" title=handler-onbeforeunload>onbeforeunload</a>; attribute <span>EventListener</span> <a href="#onblur" title=handler-onblur>onblur</a>; @@ -7779,7 +7790,7 @@ <dd><code title=attr-title><a href="#title">title</a></code> </dl> - <p>In addition, the following <a href="#event4">event handler content + <p>In addition, the following <a href="#event5">event handler content attributes</a> may be specified on any <span>HTML element</span>: <dl class=element> @@ -8555,9 +8566,6 @@ <!-- XXX WF2: when this is merged into this spec, update xrefs --> - <p class=note>Most interactive elements have content models that disallow - nesting interactive elements. - <h4 id=transparent><span class=secno>3.4.2 </span>Transparent content models</h4> @@ -13136,9 +13144,10 @@ <p class=note>One way that a user agent can enable users to follow hyperlinks is by allowing <code><a href="#a">a</a></code> elements to be - clicked, or focussed and activated by the keyboard. This <span - title="interactive elements">will cause</span> the aforementioned <a - href="#activation0">activation behavior</a> to be invoked. + clicked, or focussed and activated by the keyboard. This <a + href="#interactive1" title="interactive content">will cause</a> the + aforementioned <a href="#activation0">activation behavior</a> to be + invoked. <p>The DOM attributes <dfn id=href3 title=dom-a-href><code>href</code></dfn>, <dfn id=ping0 @@ -13159,7 +13168,7 @@ <div class=example> <p>The <code><a href="#a">a</a></code> element may be wrapped around entire paragraphs, lists, tables, and so forth, even entire sections, so - long as there are no interactive elements within (e.g. buttons or other + long as there is no interactive content within (e.g. buttons or other links). This example shows how this can be used to make an entire advertising block into a link:</p> @@ -16217,10 +16226,14 @@ title=dom-img-complete><code>complete</code></dfn> must return true if the user agent has fetched the image specified in the <code title=attr-img-src><a href="#src">src</a></code> attribute, and it is a - valid image, and false otherwise. + valid image, even if the final <a href="#tasks" + title=concept-task>task</a> queued by the <a href="#networking">networking + task source</a> for the <a href="#fetch" title=fetch>fetching</a> of the + image resource has not yet been processed. Otherwise, the attribute must + return false. <p class=note>The value of <code title=dom-img-complete><a - href="#complete">complete</a></code> can change while a script is + href="#complete">complete</a></code> can thus change while a script is executing. <p>Three constructors are provided for creating <code><a @@ -18247,7 +18260,6 @@ <hr> <!-- XXX - make it an interactive element default activation behavior is to do the play() if paused, pause() otherwise --> @@ -18647,10 +18659,12 @@ whose <code title=dom-media-networkState><a href="#networkstate">networkState</a></code> is in the <code title=dom-media-EMPTY><a href="#empty">EMPTY</a></code> state, the user - agent must implicitly invoke the <code title=dom-media-load><a - href="#load">load()</a></code> method on the <a href="#media7">media - element</a> as soon as all other scripts have finished executing. Any - exceptions raised must be ignored. + agent must <a href="#queue">queue a task</a> that implicitly invokes the + <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 <span>new resource task + source</span>. <p>The DOM attributes <dfn id=src6 title=dom-source-src><code>src</code></dfn>, <dfn id=type9 @@ -18838,10 +18852,13 @@ document and whose <code title=dom-media-networkState><a href="#networkstate">networkState</a></code> is in the <code title=dom-media-EMPTY><a href="#empty">EMPTY</a></code> state is added, - changed, or removed, the user agent must implicitly invoke the <code - title=dom-media-load><a href="#load">load()</a></code> method on the <a - href="#media7">media element</a> as soon as all other scripts have - finished executing. Any exceptions raised must be ignored. + changed, or removed, the user agent must <a href="#queue">queue a task</a> + that implicitly invokes the <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 <span>new resource task + source</span>. <p class=note>If a <code title=attr-media-src><a href="#src7">src</a></code> attribute is specified, the resource it @@ -19404,11 +19421,13 @@ title=dom-media-networkState><a href="#networkstate">networkState</a></code> has the value <code title=dom-media-EMPTY><a href="#empty">EMPTY</a></code> is inserted into a - document, user agents must implicitly invoke the <code - title=dom-media-load><a href="#load">load()</a></code> method on the <a - href="#media7">media element</a> as soon as all other scripts have - finished executing<!-- XXX phrase that better? -->. Any exceptions raised - must be ignored. + document, the user agent must <a href="#queue">queue a task</a> that + implicitly invokes the <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 <span>new resource task + source</span>. <p>The <dfn id=bufferingrate title=dom-media-bufferingRate><code>bufferingRate</code></dfn> attribute @@ -19476,7 +19495,8 @@ any running scripts have finished, <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>. + href="#media7">media element</a>.</p> + <!-- xxx queue --> <p><a href="#media7" title="media element">Media elements</a> have a <dfn id=current0>current playback position</dfn>, which must initially be zero. @@ -19919,14 +19939,16 @@ 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. + element.</p> + <!-- xxx queue --> <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. + element.</p> + <!-- xxx queue --> <p>When <code title=dom-media-currentLoop><a href="#currentloop">currentLoop</a></code> is less than <span><code @@ -19938,7 +19960,8 @@ 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>. + title=event-timeupdate><a href="#timeupdate">timeupdate</a></code>.</p> + <!-- xxx queue --> <p>When <code title=dom-media-currentLoop><a href="#currentloop">currentLoop</a></code> is equal to the <span><code @@ -19960,6 +19983,8 @@ <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 --> <li> <p>The user agent must <a href="#firing2">fire a simple event</a> called @@ -19997,7 +20022,8 @@ running scripts have finished, <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>. + element</a>.</p> + <!-- xxx queue --> <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 @@ -20021,11 +20047,11 @@ title=dom-media-seek>seek</a> to the <var><a href="#effective">effective start</a></var>.</p> - <p class=note>If this involved a seek, the user agent will<!-- - XXX queued--> - <a href="#firing2">fire a simple event</a> called <code - title=event-timeupdate><a href="#timeupdate">timeupdate</a></code> at - the <a href="#media7">media element</a>.</p> + <p class=note>If this involved a seek, the user agent <a + href="#seekUpdate">will later</a> <a href="#firing2">fire a simple + event</a> called <code title=event-timeupdate><a + href="#timeupdate">timeupdate</a></code> at the <a href="#media7">media + element</a>.</p> <li> <p>The <code title=dom-media-playbackRate><a @@ -20062,6 +20088,8 @@ href="#ratechange">ratechange</a></code>) have fired, <a href="#firing2">fire a simple event</a> called <code title=event-pause><a href="#pause1">play</a></code> at the element. + </li> + <!-- xxx queue --> </ol> <p>When the <dfn id=pause0 title=dom-media-pause><code>pause()</code></dfn> @@ -20099,6 +20127,8 @@ the element, and then <a href="#firing2">fire a simple event</a> called <code title=event-pause><a href="#pause1">pause</a></code> at the element. + </li> + <!-- xxx queue --> </ol> <p>When a <a href="#media7">media element</a> is <span>removed from a @@ -20200,11 +20230,13 @@ attribute, then continue the script. The remainder of these steps must be run asynchronously. - <li> + <li id=seekUpdate> <p>Once any running scripts have finished executing, 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 --> <li> <p>If the <a href="#media7">media element</a> was <a @@ -20240,6 +20272,8 @@ <p>Once any running scripts have finished executing, the user agent must <a href="#firing2">fire a simple event</a> called <code title=event-seeked><a href="#seeked">seeked</a></code> at the element. + </li> + <!-- xxx queue --> </ol> <p>The <dfn id=seekable @@ -20374,6 +20408,8 @@ the element. (In the other cases, such as explicit seeks, relevant events get fired as part of the overall process of changing the current playback position.) + </li> + <!-- xxx queue --> <li> <p>If the time was reached through the usual monotonic increase of the @@ -20495,7 +20531,8 @@ scripts have finished executing, the user agent must <a href="#firing2">fire a simple event</a> called <code title=event-volumechange><a href="#volumechange">volumechange</a></code> - at the <a href="#media7">media element</a>. + at the <a href="#media7">media element</a>.</p> + <!-- queue xxx --> <h5 id=time-ranges><span class=secno>4.7.10.11. </span>Time ranges</h5> @@ -23892,9 +23929,10 @@ <p class=note>One way that a user agent can enable users to follow hyperlinks is by allowing <code><a href="#area">area</a></code> elements - to be clicked, or focussed and activated by the keyboard. This <span - title="interactive elements">will cause</span> the aforementioned <a - href="#activation0">activation behavior</a> to be invoked. + to be clicked, or focussed and activated by the keyboard. This <a + href="#interactive1" title="interactive content">will cause</a> the + aforementioned <a href="#activation0">activation behavior</a> to be + invoked. <p>The DOM attributes <dfn id=alt3 title=dom-area-alt><code>alt</code></dfn>, <dfn id=coords0 @@ -27140,7 +27178,7 @@ <dd><a href="#flow-content0">Flow content</a>. - <dd><span>Interactive element</span>. + <dd><a href="#interactive1">Interactive content</a>. <dd><a href="#sectioning1">Sectioning root</a>. @@ -30813,8 +30851,8 @@ <p>Once the DOM in question has been parsed, assuming that it indeed can be parsed and does so successfully, the user agent must wait for no scripts to be executing, and as soon as that opportunity - arises<!-- XXX xref to a strict definition of this -->, run the following - algorithm: + arises<!-- XXX queue; xref to a strict definition of this -->, run the + following algorithm: <ol><!-- precondition: the originalContent is null and the element contains its original content. --> @@ -30939,8 +30977,8 @@ <p>Once the DOM in question has been parsed, assuming that it indeed can be parsed and does so successfully, the user agent must wait for no scripts to be executing, and as soon as that opportunity - arises<!-- XXX xref to a strict definition of this -->, run the following - algorithm: + arises<!-- XXX; queue xref to a strict definition of this -->, run the + following algorithm: <ol> <li> @@ -31693,9 +31731,10 @@ <li> <p>If the <a href="#parent">parent browsing context</a>'s <a href="#active">active document</a> does not have the <span>same</span> - <span>effective origin</span> as the script that is accessing the <code - title=dom-frameElement><a href="#frameelement">frameElement</a></code> - attribute, then throw a <a href="#security10">security exception</a>. + <a href="#effective3">effective script origin</a> as the script that is + accessing the <code title=dom-frameElement><a + href="#frameelement">frameElement</a></code> attribute, then throw a <a + href="#security10">security exception</a>. <li> <p>Otherwise, return the <a href="#browsing2">browsing context @@ -31798,6 +31837,16 @@ reachable browsing contexts</a> forms a <dfn id=unit-of>unit of related browsing contexts</dfn>. + <p>Each <a href="#unit-of">unit of related browsing contexts</a> is then + further divided into the smallest number of groups such that every member + of each group has an <a href="#effective3">effective script origin</a> + that, through appropriate manipulation of the <code + title=dom-document-domain><a href="#domain">document.domain</a></code> + attribute, could be made to be the same as other members of the group, but + could not be made the same as members of any other group. Each such group + is a <dfn id=unit-of0>unit of related similar-origin browsing + contexts</dfn>. + <h4 id=browsing><span class=secno>5.1.6 </span>Browsing context names</h4> <p>Browsing contexts can have a <dfn id=browsing3>browsing context @@ -31966,7 +32015,7 @@ void <a href="#postmessage0" title=dom-window-postMessage-2>postMessage</a>(in DOMString message, in DOMString targetOrigin); void <a href="#postmessage1" title=dom-window-postMessage-3>postMessage</a>(in DOMString message, in <a href="#messageport0">MessagePort</a> messagePort, in DOMString targetOrigin); - // <a href="#event5">event handler DOM attributes</a> + // <a href="#event6">event handler DOM attributes</a> attribute <span>EventListener</span> <a href="#onabort" title=handler-onabort>onabort</a>; attribute <span>EventListener</span> <a href="#onbeforeunload" title=handler-onbeforeunload>onbeforeunload</a>; attribute <span>EventListener</span> <a href="#onblur" title=handler-onblur>onblur</a>; @@ -32254,7 +32303,7 @@ <dd>The owner is the <code>Document</code> to which the <code><a href="#script1">script</a></code> element belongs. - <dt>If a script is in an <a href="#event4" title="event handler content + <dt>If a script is in an <a href="#event5" title="event handler content attributes">event handler content attribute</a> <dd>The owner is the <code>Document</code> to which the attribute node @@ -32599,8 +32648,8 @@ rule in a CSS <code><a href="#style1">style</a></code> element block). <li>Event handlers, whether registered through the DOM using <code - title="">addEventListener()</code>, by explicit <a href="#event4">event - handler content attributes</a>, by <a href="#event5">event handler DOM + title="">addEventListener()</code>, by explicit <a href="#event5">event + handler content attributes</a>, by <a href="#event6">event handler DOM attributes</a>, or otherwise. <li>Processing of technologies like XBL or SVG that have their own @@ -32692,8 +32741,101 @@ <h4 id=event><span class=secno>5.4.2 </span>Event loops</h4> - <p class=big-issue>...</p> - <!-- XXXqueue--> + <p>To coordinate events, user interaction, scripts, rendering, networking, + and so forth, user agents must use <dfn id=event3 title="event loop">event + loops</dfn> as described in this section. + + <p>There must be at least one <a href="#event3">event loop</a> per user + agent, and at most one <a href="#event3">event loop</a> per <a + href="#unit-of0">unit of related similar-origin browsing contexts</a>. + + <p>An <a href="#event3">event loop</a> always has at least one <a + href="#browsing1">browsing context</a>. If an <a href="#event3">event + loop</a>'s <a href="#browsing1" title="browsing context">browsing + contexts</a> all go away, then the <a href="#event3">event loop</a> goes + away as well. A <a href="#browsing1">browsing context</a> always has an <a + href="#event3">event loop</a> coordinating its activities. + + <p>An <a href="#event3">event loop</a> has one or more <dfn id=task-queues + title="task queue">task queues</dfn>. A <a href="#task-queues">task + queue</a> is an ordered list of <dfn id=tasks + title=concept-task>tasks</dfn>, which can be: + + <dl> + <dt>Events + + <dd> + <p>Asynchronously dispatching an <code>Event</code> object at a + particular <code>EventTarget</code> object is a task.</p> + + <p class=note>Not all events are dispatched using the <a + href="#task-queues">task queue</a>, many are dispatched synchronously + during other tasks.</p> + + <dt>Parsing + + <dd> + <p>The <a href="#html-0">HTML parser</a> tokenising a single byte, and + then processing any resulting tokens, is a task. + + <dt>Callbacks + + <dd> + <p>Calling a callback asynchronously is a task. + + <dt>Using a resource + + <dd> + <p>When an algorithm <a href="#fetch" title=fetch>fetches</a> a resource, + if the fetching occurs asynchronously then the processing of the + resource once some or all of the resource is available is a task. + + <dt>Reacting to DOM manipulation + + <dd> + <p>Some elements have tasks that trigger in response to DOM manipulation, + e.g. when that element is inserted into the document.</p> + </dl> + + <p>When a user agent is to <dfn id=queue>queue a task</dfn>, it must add + the given task to one of the <a href="#task-queues" title="task + queue">task queues</a> of the relevant <a href="#event3">event loop</a>. + All the tasks from one particular <dfn id=task-source>task source</dfn> + (e.g. the callbacks generated by timers, the events dispatched for mouse + movements, the tasks queued for the parser) must always be added to the + same <a href="#task-queues">task queue</a>, but tasks from different <a + href="#task-source" title="task source">task sources</a> may be placed in + different <a href="#task-queues" title="task queue">task queues</a>. + + <p class=example>For example, a user agent could have one <a + href="#task-queues">task queue</a> for mouse and key events (the + <span>user interaction task source</span><!-- XXX xref -->), and another + for everything else. The user agent could then give keyboard and mouse + events preference over other tasks three quarters of the time, keeping the + interface responsive but not starving other task queues, and never + processing events from any one <a href="#task-source">task source</a> out + of order. + + <p>An <a href="#event3">event loop</a> must continually run through the + following steps for as long as it exists: + + <ol> + <li> + <p>Run the oldest task on one of the <a href="#event3">event loop</a>'s + <a href="#task-queues" title="task queue">task queues</a>. The user + agent may pick any <a href="#task-queues">task queue</a>. + + <li> + <p>Remove that task from its <a href="#task-queues">task queue</a>. + + <li> + <p>If necessary, update the rendering or user interface of any + <code>Document</code> or <a href="#browsing1">browsing context</a> to + reflect the current state. + + <li> + <p>Return to the first step of the <a href="#event3">event loop</a>. + </ol> <h4 id=security4><span class=secno>5.4.3 </span>Security exceptions</h4> @@ -32801,13 +32943,13 @@ handler attributes</h5> <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cscript%3E%0Aw(a%3Ddocument.implementation.createDocument(null%2C%20null%2C%20null))%3B%0Aw(a.appendChild(a.createElementNS('http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%2C%20'html')))%3B%0Aw(b%3Da.firstChild.appendChild(a.createElementNS('http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%2C%20'body')))%3B%0Aw(b.test%20%3D%20w)%3B%0Aw(b.setAttribute('onclick'%2C%20'test(%22fire%3A%20%22%20%2B%20event)'))%3B%0Aw(b.onclick)%3B%0Aw(e%3Da.createEvent('Event'))%3B%0Aw(e.initEvent('click'%2C%20false%2C%20false))%3B%0Aw(b.dispatchEvent(e))%3B%0A%3C%2Fscript%3E --> - <p><a href="#html-elements">HTML elements</a> can have <dfn id=event3>event + <p><a href="#html-elements">HTML elements</a> can have <dfn id=event4>event handler attributes</dfn> specified. These act as bubbling event listeners for the element on which they are specified. - <p>Each event handler attribute has two parts, an <a href="#event4" + <p>Each event handler attribute has two parts, an <a href="#event5" title="event handler content attributes">event handler content - attribute</a> and an <a href="#event5" title="event handler DOM + attribute</a> and an <a href="#event6" title="event handler DOM attributes">event handler DOM attribute</a>. Event handler attributes must initially be set to null. When their value changes (through the changing of their event handler content attribute or their event handler DOM @@ -32815,11 +32957,11 @@ <code>EventListener</code> object assigned to them. <p>Objects other than <code>Element</code> objects, in particular <code><a - href="#window">Window</a></code>, only have <a href="#event5" title="event + href="#window">Window</a></code>, only have <a href="#event6" title="event handler DOM attributes">event handler DOM attribute</a> (since they have no content attributes). - <p><dfn id=event4>Event handler content attributes</dfn>, when specified, + <p><dfn id=event5>Event handler content attributes</dfn>, when specified, must contain valid ECMAScript code matching the ECMAScript <code title="">FunctionBody</code> production. <a href="#references">[ECMA262]</a></p> @@ -32857,7 +32999,7 @@ <p class=big-issue>How do we allow non-JS event handlers? - <p><dfn id=event5>Event handler DOM attributes</dfn>, on setting, must set + <p><dfn id=event6>Event handler DOM attributes</dfn>, on setting, must set the corresponding event handler attribute to their new value, and on getting, must return whatever the current value of the corresponding event handler attribute is (possibly null). @@ -35615,7 +35757,7 @@ cache</var>. </ol> - <p>The following are the <a href="#event5">event handler DOM attributes</a> + <p>The following are the <a href="#event6">event handler DOM attributes</a> that must be supported by objects implementing the <code><a href="#applicationcache">ApplicationCache</a></code> interface: @@ -37448,13 +37590,14 @@ a script running in one browsing context accesses a local storage area, the UA blocks scripts in other browsing contexts when they try to access the local storage area for the <a href="#same-origin">same origin</a> - until the first script has executed to completion. (Similarly, when a - script in one browsing context accesses its session storage area, any - scripts that have the same top level browsing context and the <a - href="#same-origin">same origin</a> would block when accessing their - session storage area until the first script has executed to completion.) - Another (potentially more efficient but probably more complex) - implementation strategy is to use optimistic transactional script + until the first script has executed to completion <!-- + xxx queue -->. + (Similarly, when a script in one browsing context accesses its session + storage area, any scripts that have the same top level browsing context + and the <a href="#same-origin">same origin</a> would block when accessing + their session storage area until the first script has executed to + completion.) Another (potentially more efficient but probably more + complex) implementation strategy is to use optimistic transactional script execution. This specification does not require any particular implementation strategy, so long as the requirement above is met. @@ -43306,7 +43449,7 @@ <hr> - <p>The following are the <a href="#event5">event handler DOM attributes</a> + <p>The following are the <a href="#event6">event handler DOM attributes</a> that must be supported by objects implementing the <code><a href="#websocket0">WebSocket</a></code> interface: @@ -44642,7 +44785,7 @@ <hr> - <p>The following are the <a href="#event5">event handler DOM attributes</a> + <p>The following are the <a href="#event6">event handler DOM attributes</a> that must be supported by objects implementing the <code><a href="#messageport0">MessagePort</a></code> interface:
Received on Monday, 18 August 2008 04:28:42 UTC