- From: poot <cvsmail@w3.org>
- Date: Fri, 8 Aug 2008 14:27:37 +0900 (JST)
- To: public-html-diffs@w3.org
Change importScript() to importScripts() and allow it to take any number of arguments. (whatwg r52) 3.2 APIs defined in other specifications http://people.w3.org/mike/diffs/html5/workers/Overview.1.45.html#apis-defined importScripts(urls) http://people.w3.org/mike/diffs/html5/workers/Overview.1.45.html#importscripts WorkerUtils http://people.w3.org/mike/diffs/html5/workers/Overview.1.45.html#workerutils 3.1 Importing scripts and libraries http://people.w3.org/mike/diffs/html5/workers/Overview.1.45.html#importing 3. APIs available to workers http://people.w3.org/mike/diffs/html5/workers/Overview.1.45.html#apis-available http://people.w3.org/mike/diffs/html5/workers/Overview.diff.html http://dev.w3.org/cvsweb/html5/workers/Overview.html?r1=1.44&r2=1.45&f=h http://html5.org/tools/web-apps-tracker?from=51&to=52 =================================================================== RCS file: /sources/public/html5/workers/Overview.html,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- Overview.html 8 Aug 2008 05:05:08 -0000 1.44 +++ Overview.html 8 Aug 2008 05:26:43 -0000 1.45 @@ -460,7 +460,7 @@ <p>The stock updater worker is as follows: - <pre>importScript('io.js'); + <pre>importScripts('io.js'); var timer; var symbol; function update() { @@ -476,7 +476,7 @@ <p>The search query worker is as follows: - <pre>importScript('io.js'); + <pre>importScripts('io.js'); port.onmessage = function (event) { port.postMessage(get('search.cgi?' + event.message)); };</pre> @@ -1667,7 +1667,7 @@ <pre class=idl>[NoInterfaceObject] interface <dfn id=workerutils>WorkerUtils</dfn> { - boolean <a href="#importscript" title=dom-WorkerGlobalScope-importScript>importScript</a>(in DOMString url); + boolean <a href="#importscripts" title=dom-WorkerGlobalScope-importScripts>importScripts</a>([Variadic] in DOMString urls); readonly attribute <span>Storage</span> <a href="#localstorage" title=dom-localStorage>localStorage</a>; <span>Database</span> <a href="#opendatabase" title=dom-opendatabase>openDatabase</a>(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize); void <a href="#shownotification" title=dom-showNotification>showNotification</a>(in DOMString title, in DOMString subtitle, in DOMString description); @@ -1696,58 +1696,73 @@ <h3 id=importing><span class=secno>3.1 </span>Importing scripts and libraries</h3> - <p>When a script invokes the <dfn id=importscript - title=dom-WorkerGlobalScope-importScript><code>importScript(<var - title="">url</var>)</code></dfn> method on a <code><a + <p>When a script invokes the <dfn id=importscripts + title=dom-WorkerGlobalScope-importScripts><code>importScripts(<var + title="">urls</var>)</code></dfn> method on a <code><a href="#workerglobalscope">WorkerGlobalScope</a></code> object, the user agent must run the following steps: <ol> <li> - <p><span title="resolve a url">Resolve</span> the <var title="">url</var> - argument. + <p><span title="resolve a url">Resolve</span> each argument. <li> - <p>If this fails, throw a <code>SYNTAX_ERR</code> exception. + <p>If any fail, throw a <code>SYNTAX_ERR</code> exception. <li> - <p>If the <span>origin</span> of the resulting <span>absolute URL</span> - is not the <span title="same origin">same</span> as the origin of the - script that invoked the method, then throw a <span>security - exception</span>. + <p>If any of the resulting <span title="absolute URL">absolute + URLs</span> have an <span>origin</span> that is not the <span + title="same origin">same</span> as the origin of the script that invoked + the method, then throw a <span>security exception</span>. <li> - <p>Attempt to <span>fetch</span><!-- XXX --> the resource identified by - the resulting <span>absolute URL</span>.</p> + <p>Attempt to <span>fetch</span> each resource identified by the + resulting <span title="absolute URLs">absolute URL</span>.</p> - <p>If the attempt fails, return false and abort these steps.</p> + <li> + <p>For each argument in turn, in the order given, starting with the first + one, run these substeps:</p> - <p>If the attempt succeeds, then let <var title="">script</var> be the - resource that was obtained.</p> + <ol> + <li> + <p>Wait for the fetching attempt for the corresponding resource to + complete.</p> - <p class=note>As with the initial script, the script here is always - assumed to be JavaScript, regardless of the MIME type.</p> - <!-- XXX --> + <p>If the fetching attempt failed, return false and abort all these + steps.</p> - <li> - <p>Let <var title="">script</var>'s <span>script execution - context</span>, <span>script browsing context</span>, and <span>script - document context</span> be the same as for the script that was executed - by the <a href="#run-a">run a worker</a> processing model for this - worker.</p> + <p>If the fetching attempt succeeded, then let <var + title="">script</var> be the resource that was obtained.</p> - <li> - <p>Run <var title="">script</var> until it either returns, fails to catch - an exception, or gets prematurely aborted by the "<a href="#kill-a">kill - a worker</a>" algorithm above.</p> + <p class=note>As with the worker's script, the script here is always + assumed to be JavaScript, regardless of the MIME type.</p> + <!-- XXX --> - <p>If an exception was raised or if the script was prematurely aborted, - then abort these steps, letting the exception or aborting continue to be - processed by the script that called the <code - title=dom-WorkerGlobalScope-importScript><a - href="#importscript">importScript()</a></code> method.</p> + <li> + <p>Let <var title="">script</var>'s <span>script execution + context</span>, <span>script browsing context</span>, and <span>script + document context</span> be the same as for the script that was + executed by the <a href="#run-a">run a worker</a> processing model for + this worker.</p> - <p>Otherwise, return true.</p> + <li> + <p>Run <var title="">script</var> until it either returns, fails to + catch an exception, or gets prematurely aborted by the "<a + href="#kill-a">kill a worker</a>" algorithm above.</p> + + <p>If an exception was raised or if the script was prematurely aborted, + then abort all these steps, letting the exception or aborting continue + to be processed by the script that called the <code + title=dom-WorkerGlobalScope-importScripts><a + href="#importscripts">importScripts()</a></code> method.</p> + + <p>If the "<a href="#kill-a">kill a worker</a>" algorithm aborts the + script then abort all these steps (the return value is + inconsequential).</p> + </ol> + + <li> + <p>Return true. </ol> <h3 id=apis-defined><span class=secno>3.2 </span>APIs defined in other
Received on Friday, 8 August 2008 05:28:18 UTC