Skip to content

Commit

Permalink
Fix regression in setting up SharedWorkerGlobalScope
Browse files Browse the repository at this point in the history
cf0355d regressed setting up a
SharedWorkerGlobalScope by removing the steps that set its constructor
url and name. This was noticed in
#1782 (comment).

This also changes the constructor url from a string to a URL record, for
consistency with other URLs stored on objects throughout the spec.
  • Loading branch information
domenic committed Oct 6, 2016
1 parent d3c9442 commit 1752559
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -96556,7 +96556,9 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
data-dfn-for="SharedWorkerGlobalScope"
data-x="concept-SharedWorkerGlobalScope-constructor-url">constructor url</dfn> and <dfn
data-dfn-for="SharedWorkerGlobalScope"
data-x="concept-SharedWorkerGlobalScope-name">name</dfn>.
data-x="concept-SharedWorkerGlobalScope-name">name</dfn>. They are initialized when the
<code>SharedWorkerGlobalScope</code> object is created, in the <span>run a worker</span>
algorithm.

<p>Shared workers receive message ports through <code
data-x="event-WorkerGlobalScope-connect">connect</code> events on their <code>SharedWorkerGlobalScope</code> object for each
Expand Down Expand Up @@ -96712,8 +96714,9 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
<p>When a user agent is to <dfn data-export="">run a worker</dfn> for a script with
<code>Worker</code> or <code>SharedWorker</code> object <var>worker</var>, <span>URL</span>
<var>url</var>, <span>environment settings object</span> <var>outside settings</var>,
<code>MessagePort</code> <var>outside port</var>, and a <code>WorkerOptions</code> dictionary
<var>options</var>, it must run the following steps:</p>
<code>MessagePort</code> <var>outside port</var>, a <code>WorkerOptions</code> dictionary
<var>options</var>, and an optional string <var>name</var>, it must run the following steps.
(<var>name</var> is always provided when <var>worker</var> is a <code>SharedWorker</code>.)</p>

<ol>

Expand Down Expand Up @@ -96760,6 +96763,19 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
context</var> and <var>outside settings</var>, and let <var>inside settings</var> be the
result.</p></li>

<li>
<p>If <var>is shared</var> is true, then:</p>

<ol>
<li><p>Set <var>worker global scope</var>'s <span
data-x="concept-SharedWorkerGlobalScope-constructor-url">constructor url</span> to
<var>url</var>.</p></li>

<li><p>Set <var>worker global scope</var>'s <span
data-x="concept-SharedWorkerGlobalScope-name">name</span> to <var>name</var>.</p></li>
</ol>
</li>

<li><p>Let <var>destination</var> be "<code data-x="">sharedworker</code>" if <var>is
shared</var> is true, and "<code data-x="">worker</code>" otherwise.</p></li>

Expand Down Expand Up @@ -97360,8 +97376,7 @@ interface <dfn>SharedWorker</dfn> : <span>EventTarget</span> {
and abort these steps.</p></li>

<li>
<p>Let <var>urlString</var> be the <span>resulting URL string</span> and <var>urlRecord</var> be
the <span>resulting URL record</span>.</p>
<p>Otherwise, let <var>urlRecord</var> be the <span>resulting URL record</span>.</p>

<p class="note">Any <span data-x="same origin">same-origin</span> URL will do, including <code
data-x="blob protocol">blob:</code> URLs.</p>
Expand All @@ -97388,12 +97403,12 @@ interface <dfn>SharedWorker</dfn> : <span>EventTarget</span> {
<li><p>If there exists a <code>SharedWorkerGlobalScope</code> object whose <span
data-x="dom-WorkerGlobalScope-closing">closing</span> flag is false, whose <span
data-x="concept-SharedWorkerGlobalScope-name">name</span> is exactly equal to <var>name</var>,
whose <span data-x="concept-SharedWorkerGlobalScope-constructor-url">constructor url</span> is
equal to <var>urlString</var>, and whose <span>relevant settings object</span>'s
<span data-x="concept-settings-object-origin">origin</span> is <span>same origin</span> with
<var>outside settings</var>'s <span data-x="concept-settings-object-origin">origin</span>, then
set <var>worker global scope</var> to that <code>SharedWorkerGlobalScope</code>
object.</p></li>
whose <span data-x="concept-SharedWorkerGlobalScope-constructor-url">constructor url</span>
<span data-x="concept-url-equals">equals</span> <var>urlRecord</var>, and whose <span>relevant
settings object</span>'s <span data-x="concept-settings-object-origin">origin</span> is
<span>same origin</span> with <var>outside settings</var>'s <span
data-x="concept-settings-object-origin">origin</span>, then set <var>worker global scope</var>
to that <code>SharedWorkerGlobalScope</code> object.</p></li>

<li>
<p>If <var>worker global scope</var> is not null, but the user agent has been
Expand Down Expand Up @@ -97454,7 +97469,8 @@ interface <dfn>SharedWorker</dfn> : <span>EventTarget</span> {
</li>

<li><p>Otherwise, <span>run a worker</span> given <var>worker</var>, <var>urlRecord</var>,
<var>outside settings</var>, <var>outside port</var>, and <var>options</var>.</p></li>
<var>outside settings</var>, <var>outside port</var>, <var>options</var>, and
<var>name</var>.</p></li>
</ol>
</li>

Expand Down

0 comments on commit 1752559

Please sign in to comment.