From 17525591619f64962b181a4d4b3de7735c16c4c9 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 4 Oct 2016 13:29:37 -0400 Subject: [PATCH] Fix regression in setting up SharedWorkerGlobalScope cf0355d7e0e229b98f7fbd51b8c7608010c787f5 regressed setting up a SharedWorkerGlobalScope by removing the steps that set its constructor url and name. This was noticed in https://github.com/whatwg/html/pull/1782#issuecomment-250763556. This also changes the constructor url from a string to a URL record, for consistency with other URLs stored on objects throughout the spec. --- source | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/source b/source index 2136243f193..d7ca5b74789 100644 --- a/source +++ b/source @@ -96556,7 +96556,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope { data-dfn-for="SharedWorkerGlobalScope" data-x="concept-SharedWorkerGlobalScope-constructor-url">constructor url and name. + data-x="concept-SharedWorkerGlobalScope-name">name. They are initialized when the + SharedWorkerGlobalScope object is created, in the run a worker + algorithm.

Shared workers receive message ports through connect events on their SharedWorkerGlobalScope object for each @@ -96712,8 +96714,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope {

When a user agent is to run a worker for a script with Worker or SharedWorker object worker, URL url, environment settings object outside settings, - MessagePort outside port, and a WorkerOptions dictionary - options, it must run the following steps:

+ MessagePort outside port, a WorkerOptions dictionary + options, and an optional string name, it must run the following steps. + (name is always provided when worker is a SharedWorker.)

    @@ -96760,6 +96763,19 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope { context and outside settings, and let inside settings be the result.

    +
  1. +

    If is shared is true, then:

    + +
      +
    1. Set worker global scope's constructor url to + url.

    2. + +
    3. Set worker global scope's name to name.

    4. +
    +
  2. +
  3. Let destination be "sharedworker" if is shared is true, and "worker" otherwise.

  4. @@ -97360,8 +97376,7 @@ interface SharedWorker : EventTarget { and abort these steps.

  5. -

    Let urlString be the resulting URL string and urlRecord be - the resulting URL record.

    +

    Otherwise, let urlRecord be the resulting URL record.

    Any same-origin URL will do, including blob: URLs.

    @@ -97388,12 +97403,12 @@ interface SharedWorker : EventTarget {
  6. If there exists a SharedWorkerGlobalScope object whose closing flag is false, whose name is exactly equal to name, - whose constructor url is - equal to urlString, and whose relevant settings object's - origin is same origin with - outside settings's origin, then - set worker global scope to that SharedWorkerGlobalScope - object.

  7. + whose constructor url + equals urlRecord, and whose relevant + settings object's origin is + same origin with outside settings's origin, then set worker global scope + to that SharedWorkerGlobalScope object.

  8. If worker global scope is not null, but the user agent has been @@ -97454,7 +97469,8 @@ interface SharedWorker : EventTarget {

  9. Otherwise, run a worker given worker, urlRecord, - outside settings, outside port, and options.

  10. + outside settings, outside port, options, and + name.