version 1.333, 2012/06/26 20:18:11
|
version 1.334, 2012/07/17 21:53:27
|
Line 216
|
Line 216
|
|
|
<h1>Web Workers</h1> |
<h1>Web Workers</h1> |
|
|
<h2 class="no-num no-toc" id="editor-s-draft-26-june-2012">Editor's Draft 26 June 2012</h2> |
<h2 class="no-num no-toc" id="editor-s-draft-17-july-2012">Editor's Draft 17 July 2012</h2> |
<dl><dt>Latest Published Version:</dt> |
<dl><dt>Latest Published Version:</dt> |
<dd><a href="http://www.w3.org/TR/workers/">http://www.w3.org/TR/workers/</a></dd> |
<dd><a href="http://www.w3.org/TR/workers/">http://www.w3.org/TR/workers/</a></dd> |
<dt>Latest Editor's Draft:</dt> |
<dt>Latest Editor's Draft:</dt> |
Line 355
|
Line 355
|
</dl><p>The W3C <a href="http://www.w3.org/2008/webapps/">Web Applications |
</dl><p>The W3C <a href="http://www.w3.org/2008/webapps/">Web Applications |
Working Group</a> is the W3C working group responsible for this |
Working Group</a> is the W3C working group responsible for this |
specification's progress along the W3C Recommendation track. |
specification's progress along the W3C Recommendation track. |
This specification is the 26 June 2012 Editor's Draft. |
This specification is the 17 July 2012 Editor's Draft. |
</p> |
</p> |
|
|
|
|
Line 1472 worker.port.postMessage({ foo: 'structur
|
Line 1472 worker.port.postMessage({ foo: 'structur
|
<h3 id="origins-of-workers"><span class="secno">4.3 </span>Origins of workers</h3> |
<h3 id="origins-of-workers"><span class="secno">4.3 </span>Origins of workers</h3> |
|
|
<p>Both the <span>origin</span> and <span>effective script |
<p>Both the <span>origin</span> and <span>effective script |
origin</span> of scripts running in workers are the |
origin</span> of scripts running in a worker are the |
<span>origin</span> of the <span>absolute URL</span> given in that |
<span>origin</span> of the <span>absolute URL</span> that was |
the worker's <code title="dom-WorkerGlobalScope-location"><a href="#dom-workerglobalscope-location">location</a></code> attribute |
obtained after <span title="resolve a URL">resolving</span> the |
represents.</p> |
argument to the <code title="dom-Worker"><a href="#dom-worker">Worker()</a></code> or <code title="dom-SharedWorker"><a href="#dom-sharedworker">SharedWorker()</a></code> constructor that |
|
initially created the worker, in the algorithm for that |
|
constructor.</p> |
|
|
|
<p class="note">For <span title="data protocol"><code title="">data:</code> URLs</span>, this is the <span>origin</span> |
|
of the <span>entry script</span> that called the constructor. For |
|
other <span title="URL">URLs</span>, this is the |
|
<span>origin</span> of the value of the <span>absolute URL</span> |
|
given in the worker's <code title="dom-WorkerGlobalScope-location"><a href="#dom-workerglobalscope-location"></a></code> attribute.</p> |
|
|
|
|
|
|
Line 1972 interface <dfn id="worker">Worker</dfn>
|
Line 1980 interface <dfn id="worker">Worker</dfn>
|
origin of the <span>entry script</span>, then throw a |
origin of the <span>entry script</span>, then throw a |
<code>SecurityError</code> exception.</p> |
<code>SecurityError</code> exception.</p> |
|
|
<p class="note">Thus, scripts must be external files with the same |
<p class="note">Thus, scripts must either be external files with |
scheme as the original page: you can't load a script from a <span title="data protocol"><code title="">data:</code> URL</span> or |
the same scheme, host, and port as the original page, or <span title="data protocol"><code title="">data:</code> URLs</span> (the |
|
latter are special-cases in the definition of |
|
<span>origin</span>). For example, you can't load a script from a |
<span title="javascript protocol"><code title="">javascript:</code> URL</span>, and an <code>http:</code> |
<span title="javascript protocol"><code title="">javascript:</code> URL</span>, and an <code>http:</code> |
page couldn't start workers using scripts with <code>http:</code> |
page couldn't start workers using scripts with <code>http:</code> |
URLs.</p> |
URLs.</p> |
Line 2094 interface <dfn id="sharedworker">SharedW
|
Line 2104 interface <dfn id="sharedworker">SharedW
|
<span>entry script</span>, then throw a <code>SecurityError</code> |
<span>entry script</span>, then throw a <code>SecurityError</code> |
exception.</p> |
exception.</p> |
|
|
<p class="note">Thus, scripts must be external files with the same |
<p class="note">Thus, scripts must either be external files with |
scheme as the original page: you can't load a script from a <span title="data protocol"><code title="">data:</code> URL</span> or |
the same scheme, host, and port as the original page, or <span title="data protocol"><code title="">data:</code> URLs</span> (the |
|
latter are special-cases in the definition of |
|
<span>origin</span>). For example, you can't load a script from a |
<span title="javascript protocol"><code title="">javascript:</code> URL</span>, and an <code>http:</code> |
<span title="javascript protocol"><code title="">javascript:</code> URL</span>, and an <code>http:</code> |
page couldn't start workers using scripts with <code>http:</code> |
page couldn't start workers using scripts with <code>http:</code> |
URLs.</p> |
URLs.</p> |