diff --git a/worklets/Overview.bs b/worklets/Overview.bs
index d33c2df3..c172dd4d 100644
--- a/worklets/Overview.bs
+++ b/worklets/Overview.bs
@@ -219,17 +219,17 @@ Note:
When a user agent is to create a WorkletGlobalScope, given |workletGlobalScopeType|,
|moduleResponsesMap|, and |outsideSettings|, it must run the following steps:
- 1. Create the worklet global scope execution environment and run the rest of these steps
- in that context.
+ 1. Let |agent| be the result of [=obtain a worklet agent|obtaining a worklet agent=] given
+ |outsideSettings|. This agent corresponds to the a worklet global scope execution
+ environment. Run the rest of these steps in that context.
- 2. Call the JavaScript InitializeHostDefinedRealm abstract operation with the following
- customizations:
+ 2. Let |realmExecutionContext| be the result of
+ [=create a new JavaScript realm|creating a new JavaScript realm=] given |agent| and
+ the following customizations:
- For the global object, create a new |workletGlobalScopeType| object. Let
|workletGlobalScope| be the created object.
- - Let |realmExecutionContext| be the created JavaScript execution context.
-
3. Let |insideSettings| be the result of set up a worklet environment settings object
given |realmExecutionContext|, and |outsideSettings|.
@@ -275,13 +275,11 @@ When a user agent is to set up a worklet environment settings object
5. Let |inheritedReferrerPolicy| be |outsideSettings|'s referrer policy.
- 6. Let |workletEventLoop| be a newly created event loop.
-
- 7. Let |realm| be the value of |executionContext|'s Realm component.
+ 6. Let |realm| be the value of |executionContext|'s Realm component.
- 8. Let |workletGlobalScope| be |realm|'s global object.
+ 7. Let |workletGlobalScope| be |realm|'s global object.
- 9. Let |settingsObject| be a new environment settings object whose algorithms are defined
+ 8. Let |settingsObject| be a new environment settings object whose algorithms are defined
as follows:
: The realm execution context
@@ -293,12 +291,8 @@ When a user agent is to set up a worklet environment settings object
: The responsible browsing context
:: Return |inheritedResponsibleBrowsingContext|.
- : The responsible event loop
- :: Return |workletEventLoop|.
-
: The responsible document
- :: Not applicable (the responsible event loop is not a browsing context
- event loop).
+ :: Not applicable (the responsible event loop is not a window event loop).
: The API URL character encoding
:: Return UTF-8.
@@ -309,19 +303,22 @@ When a user agent is to set up a worklet environment settings object
: The origin
:: Return |origin|.
+ : The top-level origin
+ :: Return |outsideSettings|'s top-level origin.
+
: The HTTPS state
:: Return |inheritedHTTPSState|.
: The referrer policy
:: Return |inheritedReferrerPolicy|.
- 10. Set |settingsObject|'s id to a new unique opaque string, |settingsObject|'s
+ 9. Set |settingsObject|'s id to a new unique opaque string, |settingsObject|'s
creation URL to |inheritedAPIBaseURL|, |settingsObject|'s target browsing
context to null, and |settingsObject|'s active service worker to null.
- 11. Set |realm|'s \[[HostDefined]] field to |settingsObject|.
+ 10. Set |realm|'s \[[HostDefined]] field to |settingsObject|.
- 12. Return |settingsObject|.
+ 11. Return |settingsObject|.
Issue: Merge this with https://html.spec.whatwg.org/multipage/workers.html#set-up-a-worker-environment-settings-object
@@ -641,4 +638,3 @@ could follow the following steps:
Arguments=["true"]).
5. Return |result|.
-