Short URL: http://html5.org/r/2084
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2084 | Further work on the event loop front. (<script>, database API, remote events, and other bits and bobs) | 2008-08-19 09:00 |
Index: source
===================================================================
--- source (revision 2083)
+++ source (revision 2084)
@@ -16340,10 +16340,10 @@
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>
+ implicit loads. Unless otherwise specified, the <span>task
+ source</span> for all the tasks <span title="queue a
+ task">queued</span> in this section and its subsections is the
+ <span>media element event task source</span>.</p>
@@ -23935,7 +23935,7 @@
title="javascript protocol"><code title="">javascript:</code>
URL</span>, then the user agent must not, despite the requirements
in the definition of the <span title="fetch">fetching</span>
- algorithm, actually execute the given script, and instead the user
+ algorithm, actually execute the given script; instead the user
agent must act as if it had received an empty HTTP 400
response.</p>
@@ -24035,9 +24035,9 @@
<p><dfn>When a script completes loading</dfn>: If the script's
element was added to one of the lists mentioned above and the
document is still being parsed, then the parser handles
- it. Otherwise, the UA must run the following steps as soon as as any
- other scripts that may be executing have finished executing:</p>
- <!-- XXX queue -->
+ it. Otherwise, the UA must run the following steps as the <span
+ title="concept-task">task</span> that the <span>networking task
+ source</span> places on the <span>task queue</span>:</p>
<dl class="switch">
@@ -28063,6 +28063,12 @@
<h4>Processing model</h4>
<!-- ua side -->
+ <p>The <span>event source</span> for all <span
+ title="concept-task">tasks</span> <span title="queue a
+ task">queued</span> by algorithms in this section and its
+ subsections is the <dfn>template event source</dfn>.</p>
+
+
<h5>The <code title="dom-originalContent">originalContent</code> DOM
attribute</h5>
@@ -28106,10 +28112,8 @@
parse</span> steps below.</p>
<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 queue; xref to a strict definition of this -->, run the
- following algorithm:</p>
+ can be parsed and does so successfully, the user agent must
+ <span>queue a task</span> to run the following algorithm:</p>
<ol>
<!-- precondition: the originalContent is null and the element
@@ -28235,10 +28239,8 @@
steps below.</p>
<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; queue xref to a strict definition of this -->, run
- the following algorithm:</p>
+ can be parsed and does so successfully, the user agent must
+ <span>queue a task</span> to run the following algorithm:</p>
<ol>
@@ -35032,20 +35034,18 @@
executing, other than in a way that is predictable by the script
itself.</p>
- <p>There are various ways of implementing this requirement. One is
- that if 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 <span>same
- origin</span> 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 <span>same origin</span> 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.</p>
+ <p class="note">There are various ways of implementing this
+ requirement. One is to just have one <span>event loop</span> for all
+ <span title="browsing context">browsing contexts</span>. Another is
+ that if a script running in one browsing context accesses a storage
+ area, the user agent blocks scripts in other browsing contexts when
+ they try to access the same storage area until the <span>event
+ loop</span> running the first script has completed running the task
+ that started that script. Another (potentially more efficient but
+ certainly 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.</p>
@@ -35494,9 +35494,10 @@
title="dom-database-changeVersion">changeVersion()</code>
method.)</p></li>
- <li><p><!-- XXX queue --> Invoke the <i>transaction callback</i>
- with the aforementioned <code>SQLTransaction</code> object as its
- only argument.</p></li>
+ <li><p><span>Queue a task</span> to invoke the <i>transaction
+ callback</i> with the aforementioned <code>SQLTransaction</code>
+ object as its only argument, and wait for that task to be
+ run.</p></li>
<li><p>If the callback couldn't be called (e.g. it was null), or if
the callback was invoked and raised an exception, jump to the last
@@ -35526,10 +35527,11 @@
<li><p>Create a <code>SQLResultSet</code> object that represents
the result of the statement.</p></li>
- <li><p><!-- XXX queue --> If the statement has a result set
- callback, invoke it with the <code>SQLTransaction</code> object
- as its first argument and the new <code>SQLResultSet</code>
- object as its second argument.</p></li>
+ <li><p>If the statement has a result set callback, <span>queue a
+ task</span> to invoke it with the <code>SQLTransaction</code>
+ object as its first argument and the new
+ <code>SQLResultSet</code> object as its second argument, and wait
+ for that task to be run.</p></li>
<li><p>If the callback was invoked and raised an exception, jump
to the last step in the overall steps.</p></li>
@@ -35546,10 +35548,11 @@
<ol>
<li><p>If the statement had an associated error callback, then
- invoke that error callback with the <code>SQLTransaction</code>
- object and a newly constructed <code>SQLError</code> object that
- represents the error that caused these substeps to be run as the
- two arguments, respectively.</p></li>
+ <span>queue a task</span> to invoke that error callback with the
+ <code>SQLTransaction</code> object and a newly constructed
+ <code>SQLError</code> object that represents the error that
+ caused these substeps to be run as the two arguments,
+ respectively, and wait for the task to be run.</p></li>
<li><p>If the error callback returns false, then move on to the
next statement, if any, or onto the next overall step
@@ -35575,15 +35578,17 @@
<li><p>If an error occurred in the committing of the transaction,
jump to the last step.</p></li>
- <li><p>Invoke the <i>success callback</i>.</p></li>
+ <li><p><span>Queue a task</span> to invoke the <i>success
+ callback</i>.</p></li>
<li><p>End these steps. The next step is only used when something
goes wrong.</p></li>
- <li><p>Call the <i>error callback</i> with a newly constructed
- <code>SQLError</code> object that represents the last error to have
- occurred in this transaction. Rollback the transaction. Any
- still-pending statements in the transaction are discarded.</p></li>
+ <li><p><span>Queue a task</span> to invoke the <i>error
+ callback</i> with a newly constructed <code>SQLError</code> object
+ that represents the last error to have occurred in this
+ transaction. Rollback the transaction. Any still-pending statements
+ in the transaction are discarded.</p></li>
</ol>
@@ -40193,12 +40198,29 @@
title="concept-eventsource-list">list of event sources</dfn> that
are registered for that object.</p>
- <p>When a new URI is added to this list, the user agent should, as
- soon as all currently executing scripts (if any) have finished
- executing<!-- XXX queue -->, and if the specified URL isn't removed
- from the list before they do so, <span>fetch</span> the resource
- identified by that URL.</p>
+ <p>When a new <span>absolute URL</span> is added to this list, the
+ user agent should <span>queue a task</span> to run the following
+ steps with the new <span>absolute URL</span>:</p>
+ <ol>
+
+ <li><p>If the entry for the new <span>absolute URL</span> has been
+ removed from the list, then abort these steps.</p></li>
+
+ <li>
+
+ <p><span>Fetch</span> the resource identified by that
+ <span>absolute URL</span>.</p>
+
+ <p>As data is received, the <span
+ title="concept-task">tasks</span> queued by the <span>networking
+ event source</span> to handle the data must consist of following
+ the rules given in the following sections.</p>
+
+ </li>
+
+ </ol>
+
<p>When an event source is removed from the list of event sources
for an object, if that resource is still being fetched, then the
relevant connection must be closed.</p>
@@ -40527,9 +40549,11 @@
<li><p>Set the <var title="">data</var> buffer and the <var
title="">event name</var> buffer to the empty string.</p></li>
- <li><p>Dispatch the newly created event at the
- <code>RemoteEventTarget</code> object to which the event stream is
- registered.</p></li>
+ <li><p><span>Queue a task</span> to dispatch the newly created
+ event at the <code>RemoteEventTarget</code> object to which the
+ event stream is registered. The <span>task source</span> for this
+ <span title="concept-task">task</span> is the <dfn>remote event
+ task source</dfn>.</p></li>
</ol>