HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/7236

SVNBugCommentTime (UTC)
723615095[Gecko] [Internet Explorer] [Opera] [Webkit] Recast how the origin handling is done for data: URLs in workers, and fix the shared worker origin handling for data: URLs so that you can actually reconnect to a data: shared worker.2012-08-09 18:29
Index: source
===================================================================
--- source	(revision 7235)
+++ source	(revision 7236)
@@ -79575,37 +79575,11 @@
 
    <dd>
 
-    <dl class="switch">
+    <p>The <span>origin</span> and <span>effective script
+    origin</span> of the <span>URL</span> are the origin defined in
+    <cite>The Web Origin Concept</cite>. <a
+    href="#refsORIGIN">[ORIGIN]</a></p>
 
-     <dt>If the URL is a <span title="data protocol"><code
-     title="">data:</code> URL</span> used in a <code
-     title="dom-Worker">Worker()</code> or <code
-     title="dom-SharedWorker">SharedWorker()</code> constructor</dt>
-
-     <dd>
-
-      <p>The <span>origin</span> and <span>effective script
-      origin</span> of the <span>URL</span> are the
-      <span>origin</span> and <span>effective script origin</span> of
-      the <span>entry script</span> at the time that the constructor
-      is invoked. (They are not <span
-      title="concept-origin-alias">aliases</span>.)</p>
-
-     </dd>
-
-     <dt>Otherwise</dt>
-
-     <dd>
-
-      <p>The <span>origin</span> and <span>effective script
-      origin</span> of the <span>URL</span> are the origin defined in
-      <cite>The Web Origin Concept</cite>. <a
-      href="#refsORIGIN">[ORIGIN]</a></p>
-
-     </dd>
-
-    </dl>
-
    </dd>
 
 
@@ -95024,6 +94998,8 @@
 
   </ol>
 
+  <hr>
+
   <p>The following are the <span>event handlers</span> (and their
   corresponding <span title="event handler event type">event handler
   event types</span>) that must be supported, as IDL attributes, by
@@ -95040,9 +95016,20 @@
     <tr><td><dfn title="handler-WorkerGlobalScope-ononline"><code>ononline</code></dfn> <td> <code title="event-online">online</code> <!-- new -->
   </table>
 
+  <hr>
 
+  <p>Each <code>WorkerGlobalScope</code> object has a <dfn>worker
+  origin</dfn> that is set when the object is created.</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"></code> attribute.</p>
 
+
+
   <h5>Dedicated workers and the <code>DedicatedWorkerGlobalScope</code> interface</h5>
 
   <pre class="idl">interface <dfn>DedicatedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
@@ -95143,27 +95130,7 @@
   -->
 
 
-  <h4>Origins of workers</h4>
 
-  <p>Both the <span>origin</span> and <span>effective script
-  origin</span> of scripts running in a worker are the
-  <span>origin</span> of the <span>absolute URL</span> that was
-  obtained after <span title="resolve a URL">resolving</span> the
-  argument to the <code title="dom-Worker">Worker()</code> or <code
-  title="dom-SharedWorker">SharedWorker()</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"></code> attribute.</p>
-
-
-
   <h4>The event loop</h4>
 
   <p>Each <code>WorkerGlobalScope</code> object has an <span>event
@@ -95802,26 +95769,28 @@
 
    <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 <span>entry script</span>, then throw a
-    <code>SecurityError</code> exception.</p>
+    <p>If the <span title="url-scheme">&lt;scheme></span> component of
+    the resulting <span>absolute URL</span> is not "<code
+    title="data-protocol">data</code>", and 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 <span>entry
+    script</span>, then throw a <code>SecurityError</code> exception
+    and abort these steps.</p>
 
     <p class="note">Thus, scripts must either be external files with
     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>https:</code>
-    page couldn't start workers using scripts with <code>http:</code>
-    URLs.</p>
+    title="data protocol"><code title="">data:</code> URLs</span>. For
+    example, you can't load a script from a <span title="javascript
+    protocol"><code title="">javascript:</code> URL</span>, and an
+    <code>https:</code> page couldn't start workers using scripts with
+    <code>http:</code> URLs.</p>
 
    </li>
 
-   <li><p>Create a new <code>DedicatedWorkerGlobalScope</code>
-   object. Let <var title="">worker global scope</var> be this new
-   object.</p></li>
+   <li><p>Create a new <code>DedicatedWorkerGlobalScope</code> object
+   whose <span>worker origin</span> is the origin of the <span>entry
+   script</span>. Let <var title="">worker global scope</var> be this
+   new object.</p></li>
 
    <li><p>Create a new <code>Worker</code> object, associated with
    <var title="">worker global scope</var>. Let <var
@@ -95945,20 +95914,21 @@
 
    <li>
 
-    <p>If the <span>origin</span> of <var title="">scriptURL</var> is
-    not the <span title="same origin">same</span> as the origin of the
-    <span>entry script</span>, then throw a <code>SecurityError</code>
-    exception.</p>
+    <p>If the <span title="url-scheme">&lt;scheme></span> component of
+    <var title="">scriptURL</var> is not "<code
+    title="data-protocol">data</code>", and the <span>origin</span> of
+    <var title="">scriptURL</var> is not the <span title="same
+    origin">same</span> as the origin of the <span>entry
+    script</span>, then throw a <code>SecurityError</code> exception
+    and abort these steps.</p>
 
     <p class="note">Thus, scripts must either be external files with
     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>https:</code>
-    page couldn't start workers using scripts with <code>http:</code>
-    URLs.</p>
+    title="data protocol"><code title="">data:</code> URLs</span>. For
+    example, you can't load a script from a <span title="javascript
+    protocol"><code title="">javascript:</code> URL</span>, and an
+    <code>https:</code> page couldn't start workers using scripts with
+    <code>http:</code> URLs.</p>
 
    </li>
 
@@ -96002,12 +95972,11 @@
       title="dom-WorkerGlobalScope-closing">closing</span> flag is
       false, whose <code
       title="dom-WorkerGlobalScope-name">name</code> attribute is
-      exactly equal to <var title="">name</var>, and whose <code
-      title="dom-WorkerGlobalScope-location">location</code> attribute
-      represents an <span>absolute URL</span> with the <span>same
-      origin</span> as <var title="">scriptURL</var>, then let <var
-      title="">worker global scope</var> be that
-      <code>SharedWorkerGlobalScope</code> object.</p>
+      exactly equal to <var title="">name</var>, and whose
+      <span>worker origin</span> is the <span>same origin</span> as
+      <var title="">scriptURL</var>, then let <var title="">worker
+      global scope</var> be that <code>SharedWorkerGlobalScope</code>
+      object.</p>
 
       <p>Otherwise, if <var title="">name</var> is the empty string
       and there exists a <code>SharedWorkerGlobalScope</code> object
@@ -96112,9 +96081,10 @@
 
      </li>
 
-     <li><p>Create a new <code>SharedWorkerGlobalScope</code>
-     object. Let <var title="">worker global scope</var> be this new
-     object.</p></li>
+     <li><p>Create a new <code>SharedWorkerGlobalScope</code> object
+     whose <span>worker origin</span> is the origin of the <span>entry
+     script</span>. Let <var title="">worker global scope</var> be
+     this new object.</p></li>
 
      <li><p>Associate <var title="">worker</var> with <var
      title="">worker global scope</var>.</p></li>
@@ -96238,14 +96208,6 @@
    <li><p>If any fail, throw a <code>SyntaxError</code>
    exception.</p></li>
 
-<!--
-   <li><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 <code>SecurityError</code>
-   exception.</p></li>
--->
-
    <li>
 
     <p>Attempt to <span>fetch</span> each resource identified by the

|