Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2853,33 +2853,28 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
1. Let |script| be |serviceWorker|'s [=service worker/script resource=].
1. Assert: |script| is not null.
1. Let |startFailed| be false.
1. Create a separate parallel execution environment (i.e. a separate thread or process or equivalent construct), and run the following steps in that context:
1. Call the JavaScript [=InitializeHostDefinedRealm|InitializeHostDefinedRealm()=] abstract operation with the following customizations:
1. Let |agent| be the result of [=obtain a service worker agent|obtaining a service worker agent=], and run the following steps in that context:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside: It's be great to add "obtaining a service worker agent" as link text.

1. Let |realmExecutionContext| be the result of [=create a new JavaScript realm|creating a new JavaScript realm=] given |agent| and the following customizations:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

* For the global object, create a new {{ServiceWorkerGlobalScope}} object. Let |workerGlobalScope| be the created object.
* Let |realmExecutionContext| be the created [=execution context|JavaScript execution context=].
1. Set |serviceWorker|'s [=service worker/global object=] to |workerGlobalScope|.
1. Let |workerEventLoop| be a newly created <a>event loop</a>.
1. Let |settingsObject| be a new <a>environment settings object</a> whose algorithms are defined as follows:

: The [=environment settings object/realm execution context=]
:: Return |realmExecutionContext|.
: The [=environment settings object/global object=]
:: Return |workerGlobalScope|.
: The <a>responsible event loop</a>
:: Return |workerEventLoop|.
: The [=environment settings object/referrer policy=]
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=].
: The [=environment settings object/module map=]
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/module map=].
: The <a>API URL character encoding</a>
:: Return UTF-8.
:: Return [=UTF-8=].
: The <a>API base URL</a>
:: Return |serviceWorker|'s [=service worker/script url=].
: The [=environment settings object/origin=]
:: Return its registering [=/service worker client=]'s [=environment settings object/origin=].
: The <a>creation URL</a>
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/url=].
: The [=environment settings object/HTTPS state=]
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=].
: The [=environment settings object/referrer policy=]
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=].

1. Set |settingsObject|'s [=environment/id=] to a new unique opaque string, its [=creation URL=] to |serviceWorker|'s [=service worker/script url=], its [=environment/target browsing context=] to null, and its [=active service worker=] to null.
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/url=] to |serviceWorker|'s [=service worker/script url=].
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=] to |serviceWorker|'s <a>script resource</a>'s <a>HTTPS state</a>.
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=] to |serviceWorker|'s <a>script resource</a>'s [=script resource/referrer policy=].
Expand Down