From afc1353841350673981da503b744f9013cad06b9 Mon Sep 17 00:00:00 2001
From: Ms2ger
Assert: the result of running the module type allowed steps - given moduleType and settingsObject is true. Otherwise, we would not have - reached this point because a failure would have been raised when inspecting - moduleRequest.[[Attributes]] in - HostLoadImportedModule or fetch a single imported module script.
Let moduleMap be settingsObject's module map.
If the result of running the module type allowed steps given - moduleType and settingsObject is false, then run onComplete - given null, and return.
Fetch a single module script given url, fetchClient, destination, options, settingsObject, referrer, @@ -108530,7 +108531,7 @@ document.querySelector("button").addEventListener("click", bound);
The module type allowed steps, given a string moduleType - and an environment settings object settings, are as follows:
+ and a realm realm, are as follows:If moduleType is not " If moduleType is "javascript-or-wasm
", "css
" and the
CSSStyleSheet
interface is not exposed in
- settings's realm, then
- return false.
Return true.
If the result of running the module type allowed steps given - moduleType and settingsObject is false, then:
+ moduleType and settingsObject's realm is false, then:Let completion be Completion Record { [[Type]]: throw,
From 002d9fa3931906ebdb54078cd47df4c229a57cdd Mon Sep 17 00:00:00 2001
From: Ms2ger
An environment settings object, containing various settings that are shared - with other scripts in the same context.
A realm where the script is evaluated, which is shared with other + scripts in the same context.
The settings object of a script is the + settings object of the script's + realm.
A classic script is a type of script that has the following additional item:
@@ -108274,8 +108277,8 @@ document.querySelector("button").addEventListener("click", bound);Let script be a new classic script that this algorithm will subsequently initialize.
Set script's settings - object to settings.
Set script's realm to + settings's realm.
Set script's base URL to baseURL.
Let script be a new module script that this algorithm will subsequently initialize.
Set script's settings - object to settings.
Set script's realm to + settings's realm.
Set script's base URL to baseURL.
Let script be a new module script that this algorithm will subsequently initialize.
Set script's settings - object to settings.
Set script's realm to + settings's realm.
Set script's base URL to baseURL.
Let script be a new module script that this algorithm will subsequently initialize.
Set script's settings - object to settings.
Set script's realm to + settings's realm.
Set script's base URL and fetch options to null.
Let script be a new module script that this algorithm will subsequently initialize.
Set script's settings - object to settings.
Set script's realm to + settings's realm.
Set script's base URL and fetch options to null.
If active script is not null, set script execution context to a new JavaScript execution context, with its Function field set to null, its Realm field - set to active script's settings - object's realm, and its + set to active script's realm, and its ScriptOrModule set to active script's record.
From 3d1c1f25ad109e896d6131152ea2a817c3e49101 Mon Sep 17 00:00:00 2001 From: Ms2gerDocument
object with a null browsing
context, and, accordingly, any script
elements they create need to have
their already started set to true in the prepare the script element
- algorithm and never get executed (scripting is
+ algorithm and never get executed (scripting is
disabled). Such script
elements still need to have their parser
document set, though, such that their async
IDL
attribute will return false in the absence of an async
@@ -107049,45 +107049,45 @@ document.querySelector("button").addEventListener("click", bound);
Scripting is enabled for - an environment settings object settings when all of the following - conditions are true:
+Scripting is enabled for a realm realm + when all of the following conditions are true:
Window
object,
- or settings's global object's
+ Window
object,
+ or realm's global object's
associated Document
's active
sandboxing flag set does not have its sandboxed scripts browsing context flag
set.Scripting is disabled - for an environment settings object when scripting is not enabled for it, i.e., when any of the above conditions - are false.
+Scripting is disabled for a realm when + scripting is not enabled for it, i.e., when any of the + above conditions are false.
Scripting is enabled for a node node if node's node document's browsing - context is non-null, and scripting is - enabled for node's relevant settings object.
+ context is non-null, and scripting is + enabled for node's relevant + realm.Scripting is disabled for a node when scripting is not enabled, i.e., when its node document's browsing context is null or when scripting is disabled for its relevant settings - object.
+ data-x="concept-realm-noscript">scripting is disabled for its relevant realm.If scripting is disabled for - settings, then set source to the empty string.
If scripting is disabled for + settings's realm, then set + source to the empty string.
Let script be a new classic script that this algorithm will subsequently initialize.
If scripting is disabled for - settings, then set source to the empty string.
If scripting is disabled for + settings's realm, then set + source to the empty string.
Let script be a new module script that this algorithm will subsequently initialize.
If scripting is disabled for - settings, then set bodyBytes to the byte sequence 0x00 0x61 0x73 0x6d 0x01 - 0x00 0x00 0x00.
+If scripting is disabled for + settings's realm, + then set bodyBytes to the byte sequence 0x00 0x61 0x73 0x6d 0x01 0x00 0x00 0x00.
This byte sequence corresponds to an empty WebAssembly module with only the magic bytes and version number provided.
@@ -108708,8 +108710,9 @@ document.querySelector("button").addEventListener("click", bound); settings is aWindow
object whose Document
object is not
fully active, then return "do not run".
- If scripting is disabled for - settings, then return "do not run".
+If scripting is disabled for + settings's realm, then + return "do not run".
Return "run".
If the MIME type essence of mimeType is "text/css
"
and moduleType is "css
", then set moduleScript to
the result of creating a CSS module script given sourceText and
- settingsObject.
If mimeType is a JSON MIME type and
moduleType is "json
", then set moduleScript to
the result of creating a JSON module script given sourceText and
- settingsObject.
To create a CSS module script, given a - string source and an environment settings object settings:
+ string source and a realm realm:Let script be a new module script that this algorithm will subsequently initialize.
Set script's realm to - settings's realm.
Set script's base URL and fetch options to null.
To create a JSON module script, given a - string source and an environment settings object settings:
+ string source and a realm realm:Let script be a new module script that this algorithm will subsequently initialize.
Set script's realm to - settings's realm.
Set script's base URL and fetch options to null.
Let script be the result of creating a JavaScript module script - using sourceText, settingsObject, baseURL, and + using sourceText, settingsObject's + realm, baseURL, and options.
Fetch the descendants of
@@ -108192,8 +108193,9 @@ document.querySelector("button").addEventListener("click", bound);
If mimeType is a JavaScript MIME type and moduleType
is "javascript-or-wasm
", then set moduleScript to the result of
creating a JavaScript module script given sourceText,
- settingsObject, response's URL, and options.
If the MIME type essence of mimeType is "text/css
"
and moduleType is "css
", then set moduleScript to
@@ -108325,20 +108327,19 @@ document.querySelector("button").addEventListener("click", bound);
To create a JavaScript module script, - given a string source, an environment settings - object settings, a URL baseURL, and a script fetch - options options:
+ given a string source, a realm realm, + a URL baseURL, and a script fetch options + options:If scripting is disabled for - settings's realm, then set - source to the empty string.
Let script be a new module script that this algorithm will subsequently initialize.
Set script's realm to - settings's realm.
Set script's base URL to baseURL.
Let result be ParseModule(source, - settings's realm, - script).
+ realm, script).Passing script as the last parameter here ensures result.[[HostDefined]] will be script.
From 50f5d5c82556a376a72fbe62cde7352838f0d9fc Mon Sep 17 00:00:00 2001 From: Ms2gerapplication/wasm
" and moduleType is "javascript-or-wasm
", then set moduleScript to the result of
creating a WebAssembly module script given bodyBytes,
- settingsObject, response's URL, and options.Otherwise:
@@ -108376,14 +108377,13 @@ document.querySelector("button").addEventListener("click", bound);To create a WebAssembly module script, - given a byte sequence bodyBytes, an environment settings - object settings, a URL baseURL, and a script fetch - options options:
+ given a byte sequence bodyBytes, a realm realm, + a URL baseURL, and a script fetch options + options:If scripting is disabled for - settings's realm, +
If scripting is disabled for realm, then set bodyBytes to the byte sequence 0x00 0x61 0x73 0x6d 0x01 0x00 0x00 0x00.
This byte sequence corresponds to an empty WebAssembly module with only the magic @@ -108394,7 +108394,7 @@ document.querySelector("button").addEventListener("click", bound); subsequently initialize.
Set script's realm to - settings's realm.
Set script's base URL to baseURL.
Let result be the result of parsing a - WebAssembly module given bodyBytes, - settings's realm, and + WebAssembly module given bodyBytes, realm, and script.
Passing script as the last parameter here ensures
From e14e94d4cef93b861c04814c6c4bc6e860273b38 Mon Sep 17 00:00:00 2001
From: Ms2ger
Let settingsObject and baseURL be null.
Let realm and baseURL be null.
If referringScript is not null, then:
Set settingsObject to referringScript's - settings object.
Set realm to referringScript's + realm.
Set baseURL to referringScript's base URL.
Assert: there is a current settings object.
Assert: there is a current realm.
Set settingsObject to the current settings object.
Set realm to the current realm.
Set baseURL to settingsObject's API base - URL.
Set baseURL to realm's + settings object's + API base URL.
Let importMap be an empty import map.
If settingsObject's global
- object implements Window
, then set importMap to
- settingsObject's global object's
+
If realm's global object implements
+ Window
, then set importMap to realm's
+ global object's
import map.
Let serializedBaseURL be baseURL, PromiseRejectionEventInit : EventInitIf result is not null, then:
Add module to resolved module set given settingsObject, - serializedBaseURL, normalizedSpecifier, and asURL.
Add module to resolved module set given realm's + global object, serializedBaseURL, + normalizedSpecifier, and asURL.
Return result.
To add module to resolved module set given an environment settings - object settingsObject, a string serializedBaseURL, a - string normalizedSpecifier, and a URL-or-null - asURL:
+To add module to resolved module set given + a realm realm, + a string serializedBaseURL, + a string normalizedSpecifier, + and a URL-or-null asURL:
Let global be settingsObject's global object.
Let global be realm's global object.
If global does not implement Window
, then return.
Let script be the result of creating a classic script using - source text, settings object, base URL, and - options.
Mark as ready el given script.
Let baseURL be settings's API base URL.
Let script be the result of creating a classic script given - scriptSource, settings, baseURL, and the default script - fetch options.
Let evaluationStatus be the result of running the classic script script.
Let script be the result of creating a classic script given - sourceText, settingsObject, response's URL, options, - mutedErrors, and url.
Let script be the result of creating a classic script using - sourceText, settingsObject, response's URL, and the default script fetch - options.
Run onComplete given script.
Let script be the result of creating a classic script given - sourceText, settingsObject, response's URL, the default script fetch options, and - mutedErrors.
Return script.
To create a classic script, given a - string source, an environment settings object - settings, a URL baseURL, a script fetch options - options, an optional boolean mutedErrors (default false), and an optional + string source, a realm realm, + a URL baseURL, a script fetch options options, + an optional boolean mutedErrors (default false), and an optional URL-or-null sourceURLForWindowScripts (default null):
If scripting is disabled for - settings's realm, then set - source to the empty string.
Let script be a new classic script that this algorithm will subsequently initialize.
Set script's realm to - settings's realm.
Set script's base URL to baseURL.
Let result be ParseScript(source, - settings's realm, - script).
+ realm, script).Passing script as the last parameter here ensures result.[[HostDefined]] will be script.
@@ -115268,7 +115267,7 @@ enum DOMParserSupportedType {Let script be the result of creating a classic script given - handler, settings object, base URL, and fetch + handler, realm, base URL, and fetch options.
Run the classic script
From 9e9543ba473821c167e441a99a11abf4f4c8dec7 Mon Sep 17 00:00:00 2001
From: Ms2ger
Let settings be the settings - object of script.
Let realm be the realm of + script.
Check if we can run script with settings. If this returns "do +
Check if we can run script with realm. If this returns "do not run" then return NormalCompletion(empty).
Record classic script execution start time given script.
Prepare to run script given settings.
Prepare to run script given realm's environment settings object.
Let evaluationStatus be null.
Clean up after running script with settings.
Clean up after running script with realm's environment settings object.
Rethrow evaluationStatus.[[Value]].
Clean up after running script with settings.
Clean up after running script with realm's environment settings object.
Throw a "NetworkError
" DOMException
.
Clean up after running script with settings.
Clean up after running script with realm's environment settings object.
Return evaluationStatus.
Clean up after running script with settings.
Clean up after running script with realm's environment settings object.
If evaluationStatus is a normal completion, then return evaluationStatus.
Let settings be the settings - object of script.
Let realm be the realm of + script.
Check if we can run script with settings. If this returns "do not +
Check if we can run script with realm. If this returns "do not run", then return a promise resolved with undefined.
Record module script execution start time given script.
Prepare to run script given settings.
Prepare to run script given realm's environment settings object.
Let evaluationPromise be null.
Clean up after running script with settings.
Clean up after running script with realm's environment settings object.
Return evaluationPromise.
The steps to check if we can run script with an environment settings - object settings are as follows. They return either "run" or "do not run".
+The steps to check if we can run script with a realm realm + are as follows. They return either "run" or "do not run".
If the global object specified by
- settings is a Window
object whose Document
object is not
+
If the global object specified by
+ realm is a Window
object whose Document
object is not
fully active, then return "do not run".
If scripting is disabled for - settings's realm, then - return "do not run".
+ realm, then return "do not run".Return "run".
Let entry be - finalizationRegistry.[[CleanupCallback]].[[Callback]].[[Realm]]'s environment settings object.
Check if we can run script with entry. If this returns "do not run", then return.
Prepare to run script with entry.
+Prepare to run script with entry's environment settings object.
This affects the entry concept while the cleanup callback runs.
@@ -110626,7 +110632,8 @@ dictionary PromiseRejectionEventInit : EventInitLet result be the result of performing CleanupFinalizationRegistry(finalizationRegistry).
Clean up after running script with entry.
Clean up after running script with entry's environment settings object.
If result is an abrupt completion, then report an exception given by result.[[Value]] for @@ -110693,8 +110700,8 @@ dictionary PromiseRejectionEventInit : EventInitQueue a microtask to perform the following steps:
If job settings is not null, then check if we can run script - with job settings. If this returns "do not run" then return.
If realm is not null, then check if we can run script with + realm. If this returns "do not run" then return.
If job settings is not null, then prepare to run script with
From 1beeb822bdc30477f4d42bdea72ac6f0248627ca Mon Sep 17 00:00:00 2001
From: Ms2ger Report an exception given by evaluationStatus.[[Value]] for
- script's settings object's
- global object.
Clean up after running script with realm's environment settings object.
If preventErrorReporting is false, then upon rejection of evaluationPromise with reason, report an exception given by - reason for script's settings - object's global object.
Clean up after running script with realm's environment settings object.
Prepare to run script given navigation's relevant settings - object.
+Prepare to run script given navigation's relevant realm.
See the discussion for other navigation API events to understand why we do this.
@@ -93143,8 +93143,8 @@ enum NavigationHistoryBehavior {Clean up after running script given navigation's relevant - settings object.
Clean up after running script given navigation's relevant realm.
In implementations, same-document navigations can cause is same document is true.
Prepare to run script given navigation's relevant settings - object.
+Prepare to run script given navigation's relevant realm.
Again there are two interesting environment
- settings objects in play: that of a.html
, and that of b.html
. When the location.assign()
- method triggers the Location
-object navigate algorithm, what will be
- the incumbent settings object? As before, it should intuitively be that of a.html
: the click
listener was originally
- scheduled by a.html
, so even if something involving b.html
causes the listener to fire, the incumbent responsible is that of a.html
.
Again there are two interesting realms in play: that of
+ a.html
, and that of b.html
.
+ When the location.assign()
method triggers the
+ Location
-object navigate algorithm, what will be the incumbent realm?
+ As before, it should intuitively be that of a.html
: the click
listener was originally scheduled by a.html
, so even if something involving b.html
causes the
+ listener to fire, the incumbent responsible is
+ that of a.html
.
The callback setup is similar to the previous example: when bound
is
- converted to a Web IDL callback type, the
- incumbent settings object is that corresponding to a.html
,
- which is stored as the callback's callback context.
a.html
, which is stored as the callback's callback context.
When the click()
method is called inside b.html
, it dispatches a is author code on the stack; the topmost
script-having execution context is that of the
onLoad
function,
whose skip-when-determining-incumbent counter gets incremented. Additionally, a.html
's environment settings object (stored as the
- EventHandler
's callback context) is pushed onto the
- backup incumbent settings object stack.
EventHandler
's
+ callback context) is pushed onto the backup incumbent realm stack.
Now, when the Location
-object navigate algorithm looks up the
- incumbent settings object, the topmost script-having execution
- context is still that of the onLoad
function (due to the fact we
- are using a bound function as the callback). Its skip-when-determining-incumbent
- counter value is one, however, so we fall back to the backup incumbent settings
- object stack. This gives us the environment settings object of a.html
, as expected.
onLoad
+ function (due to the fact we are using a bound function as the callback).
+ Its skip-when-determining-incumbent counter value is one, however, so we fall back
+ to the backup incumbent realm stack.
+ This gives us the realm of a.html
, as expected.
Note that this means that even though it is the iframe
inside a.html
that navigates, it is a.html
itself that is used
@@ -110551,14 +110548,14 @@ dictionary PromiseRejectionEventInit : EventInitJAVASCRIPT
Let incumbent settings be - callback.[[HostDefined]].[[IncumbentSettings]].
Let incumbent realm be + callback.[[HostDefined]].[[IncumbentRealm]].
Let script execution context be callback.[[HostDefined]].[[ActiveScriptContext]].
Prepare to run a callback with incumbent settings.
+Prepare to run a callback with incumbent realm.
This affects the incumbent concept while the callback runs.
@@ -110579,8 +110576,7 @@ dictionary PromiseRejectionEventInit : EventInitpop script execution context from the JavaScript execution context stack.Clean up after running a callback with incumbent - settings.
Clean up after running a callback with incumbent realm.
Return result.
Let incumbent settings be the incumbent settings object.
Let incumbent realm be the incumbent realm.
Let active script be the active script.
Return the JobCallback Record { [[Callback]]: callable, - [[HostDefined]]: { [[IncumbentSettings]]: incumbent settings, [[ActiveScriptContext]]: + [[HostDefined]]: { [[IncumbentRealm]]: incumbent realm, [[ActiveScriptContext]]: script execution context } }.
If script is a classic script and script's muted errors is true, then return.
-Let settingsObject be the current settings object.
Let realm be the current realm.
If script is not null, then set settingsObject to - script's settings - object.
If script is not null, then set realm to script's + realm.
Let global be settingsObject's global object.
Let global be realm's + global object.
If operation is "reject
", then:
User agents that support JavaScript must also implement the ShadowRealm API + proposal. The following terms are defined there, and used in this specification: + JSSHADOWREALM
+ +DOMHighResTimeStamp
Performance
If the current settings object's If the current principal settings object's cross-origin isolated
capability is false, then throw a "DataCloneError
"
DOMException
.
Let registry be the current global object's +
Let registry be the current principal global object's
CustomElementRegistry
object.
Let element be the result of internally creating a new object implementing the interface - to which the active function object corresponds, given the current + to which the active function object corresponds, given the current principal realm and NewTarget.
Set element's node document to the current global
- object's associated
+ Set element's node document to the current principal
+ global object's associated
Set element's namespace to
@@ -29913,7 +29926,7 @@ img.decode().then(() => {
the legacy factory function must perform the following steps: Let document be the current global object's Let document be the current principal global object's associated Let img be the result of creating an
@@ -35449,7 +35462,7 @@ interface HTMLAudioElement : HTMLMediaElement
must perform the following steps: Let document be the current global object's Let document be the current principal global object's associated Let audio be the result of creating an
@@ -54655,7 +54668,7 @@ interface HTMLOptionElement : HTMLElement {
function must perform the following steps: Let document be the current global object's Let document be the current principal global object's associated Let option be the result of creating an
@@ -89499,7 +89512,7 @@ dictionary DragEventInit : MouseEventInit {
Return true if the current settings object's Return true if the current principal settings object's origin is same origin-domain with
O's relevant settings object's origin, and false otherwise. This abstract operation does not return a Completion Record. Here the current settings object roughly corresponds to the "caller",
- because this check occurs before the execution
- context for the getter/setter/method in question makes its way onto the JavaScript
- execution context stack. For example, in the code Here the current principal settings object roughly corresponds to the
+ "caller", because this check occurs before the execution context for the getter/setter/method in question makes its way onto the
+ JavaScript execution context stack. For example, in the code Let crossOriginKey be a tuple consisting of the current settings
- object, O's relevant settings object, and P. Let crossOriginKey be a tuple consisting of the current principal
+ settings object, O's relevant settings object, and
+ P. For each e of CrossOriginProperties(O): Let value be originalDesc.[[Value]]. If IsCallable(value) is true, then set value to
- an anonymous built-in function, created in the current realm, that performs
- the same steps as the IDL operation P on object O.Document
.
-
Document
.
-
Document
.
-
Document
.IsPlatformObjectSameOrigin ( O )
-
w.document
, this
- step is invoked before the document
getter is reached as part
- of the [[Get]] algorithm for the WindowProxy
- w.w.document
, this step is invoked before the document
getter is reached as part of the [[Get]] algorithm for the WindowProxy
w.CrossOriginGetOwnPropertyHelper ( O, P )
@@ -89522,8 +89535,9 @@ dictionary DragEventInit : MouseEventInit {
practice this is handled by the caller calling CrossOriginPropertyFallback.
-
Set crossOriginDesc to PropertyDescriptor{ [[Value]]: value, @@ -89567,15 +89581,15 @@ dictionary DragEventInit : MouseEventInit {
Let crossOriginGet be undefined.
If e.[[NeedsGet]] is true, then set crossOriginGet to an - anonymous built-in function, created in the current realm, that performs the - same steps as the getter of the IDL attribute P on object + anonymous built-in function, created in the current principal realm, that + performs the same steps as the getter of the IDL attribute P on object O.
Let crossOriginSet be undefined.
If e.[[NeedsSet]] is true, then set crossOriginSet to an - anonymous built-in function, created in the current realm, that performs the - same steps as the setter of the IDL attribute P on object + anonymous built-in function, created in the current principal realm, that + performs the same steps as the setter of the IDL attribute P on object O.
Set crossOriginDesc to PropertyDescriptor{
@@ -90602,7 +90616,7 @@ dictionary WindowPostMessageOptions : StructuredSeri
If container's node document's origin is not same origin-domain with the
- current settings object's current principal settings object's origin, then return null. Return container.
Check if an access between two browsing contexts - should be reported, given the current global object's + should be reported
If IsPlatformObjectSameOrigin(W) is true, then return ? OrdinaryGet(this, P, Receiver).
Check if an access between two browsing contexts - should be reported, given the current global object's browsing - context, W's browsing context, P, - and the current settings object.
If IsPlatformObjectSameOrigin(W) is true, then:
@@ -106076,8 +106091,8 @@ new PaymentRequest(…); // Allowed to use data-x="concept-relevant-realm">relevant realm's agent. -The agent equivalent of the current realm is the surrounding - agent.
+The agent equivalent of the current principal realm is the + surrounding agent.
The JavaScript specification introduces the realm concept, representing a global - environment in which script is run. Each realm comes with an implementation-defined - global object; much of this specification is devoted to defining that global object - and its properties.
+ environment in which script is run. + +In the context of the JavaScript ShadowRealm API proposal, there are two kinds of realms: + JSSHADOWREALM
+ +A principal realm comes with an implementation-defined + global object; much of this specification is devoted to defining that global object + and its properties.
A synthetic realm is created by the ShadowRealm API and includes a reduced set + of properties.
For web specifications, it is often useful to associate values or algorithms with a
- realm/global object pair. When the values are specific to a particular type of realm, they are
- associated directly with the global object in question, e.g., in the definition of the
+ principal realm/global object pair. When the values are specific to a particular type of realm,
+ they are associated directly with the global object in question, e.g., in the definition of the
Window
or WorkerGlobalScope
interfaces. When the values have utility
across multiple realms, we use the environment settings object concept.
Each synthetic realm originates from a principal realm + (its settings object's + principal realm). + Generally, in contexts where the associated values or algorithms of a realm are needed, + the associated values and algorithms of this associated principal realm are used.
+Finally, in some cases it is necessary to track associated values before a realm/global object/environment settings object even comes into existence (for example, during navigation). These values are tracked in the @@ -106452,8 +106483,17 @@ new PaymentRequest(…); // Allowed to use
A global object is a JavaScript object that is the [[GlobalObject]] field of a realm.
-In this specification, all realms are created with global
+ A realm's global object is found in its [[GlobalObject]] field. A global
+ object's realm is the unique
+ realm whose global object is that object. A principal global object is a global object of a principal
+ realm. Similarly, a synthetic global object is a global object of a
+ synthetic realm. In this specification, all principal realms
+ are created with global
objects that are either There is always a 1-to-1-to-1 mapping between realms, global objects, and environment settings objects: There is always a 1-to-1-to-1 mapping between principal
+ realms, principal global objects, and environment settings objects: A realm has a [[HostDefined]] field, which contains the realm's
- settings object. A principal realm has a [[HostDefined]] field, which contains the
+ principal realm's settings object. A realm has a [[GlobalObject]] field, which contains the realm's global
- object. A principal realm has a global
+ object. Each global object in this specification is created during the creation of a corresponding realm, known as
- the global
- object's realm. Each principal global object in this specification is created during the
+ creation of a corresponding principal
+ realm, which is the global object's
+ realm. Each global object in this
- specification is created alongside a corresponding environment settings object,
- known as its relevant settings object. Each principal global object
+ in this specification is created alongside a corresponding environment settings
+ object, known as its relevant settings object. An environment settings object's realm execution context's
Realm component is Return realm execution context. Each synthetic realm has an associated synthetic realm settings object
+ with the following fields: An execution context The JavaScript execution context for the scripts within this realm. A principal realm The principal realm which this synthetic realm exists within. An underlying realm The synthetic realm which this settings object represents. A module map A module map that is used when importing JavaScript modules. Synthetic realm settings objects' module map entries are copies of successfully
+ fetched modules found in the principal realm's module map, so this map never contains entries
+ which are null or " Synthetic realms are created with global objects which are initialized by the JavaScript specification's
+ SetDefaultGlobalBindings algorithm. Synthetic
+ global objects implement only certain specifically exposed interfaces. Analogously, there is always a 1-to-1-to-1 mapping between synthetic realms, synthetic global
+ objects, and synthetic realm settings
+ objects: A synthetic realm has a [[HostDefined]] field, which contains the synthetic realm's settings
+ object. A synthetic realm has a global
+ object. Each synthetic global object in this specification is created as part of the
+ Each synthetic global object in this specification is created alongside a
+ corresponding synthetic realm settings object, known as its relevant synthetic
+ realm settings object. A synthetic realm settings object's realm execution context's
+ Realm component is the synthetic realm settings object's realm. A synthetic realm settings object's synthetic realm settings object's global object is its
+ realm's
+ global. The principal realm of any
+ realm realm is defined by the following algorithm: If realm.[[HostDefined]] is a synthetic realm settings object,
+ then: Assert: realm is a synthetic realm. Set realm to the principal realm of
+ realm.[[HostDefined]]. Assert: realm.[[HostDefined]] is an environment settings
+ object and realm is a principal realm. Return realm. The execution context of a
- realm realm is the realm execution context of the
- environment settings object of
- realm.Window
, WorkerGlobalScope
, or
WorkletGlobalScope
objects.
-
-
Synthetic realm settings objects
+
+
+
+
+ fetching
".
+
+
+ ShadowRealm
constructor, which creates the global object's realm.
+
+
+
+
If realm is a principal realm, then return the + realm execution context of the + environment settings object of + realm.
Assert: realm is a synthetic realm.
Return the execution context + of the synthetic realm settings + object of realm.
The module map of a realm + realm is defined by the following algorithm:
+ +If realm is a principal realm, then return the module map of the + environment settings object of + realm.
Assert: realm is a synthetic realm.
Return the module map + of the synthetic realm settings + object of realm.
When defining algorithm steps throughout this specification, it is often important to indicate - what realm is to be used—or, equivalently, what global object or - environment settings object is to be used. In general, there are at least four - possibilities:
+ what principal realm is to be used—or, equivalently, what principal global + object or environment settings object is to be used. In general, there are at + least four possibilities:The incumbent realm is that of b.html
.
The current realm is that of c.html
(since it is the
- print()
method from c.html
whose code is
- running).
The current principal realm is that of c.html
(since it is the print()
method from
+ c.html
whose code is running).
The relevant realm of the object on which
the print()
method is being called is that of d.html
.
If the algorithm for the getBattery()
method
- had instead used the current realm, all the results would be reversed. That is,
- after the first call to getBattery()
in outer.html
, the Navigator
object in current principal realm
getBattery()
in
+ outer.html
, the Navigator
object in inner.html
would be permanently storing a Promise
object
created in outer.html
's realm, and calls like that inside the
- hello()
function would thus return a promise from the "wrong" realm. Since
- this is undesirable, the algorithm instead uses the hello() function would thus return a promise from the "wrong" realm.
+ Since this is undesirable, the algorithm instead uses the relevant realm, giving the sensible results indicated in
the comments above.
@@ -106747,7 +106907,8 @@ new PaymentRequest(…); // Allowed to use
With this in hand, we define the entry execution context to be the most recently pushed item in the JavaScript execution context stack that is a realm execution context. The entry - realm is the entry execution context's Realm component.
+ realm is the principal realm of the + entry execution context's Realm component.Then, the entry settings object is the environment settings object of the Then, the incumbent settings object is the incumbent realm's + principal realm's settings object.
Similarly, the incumbent global object is @@ -107027,12 +107189,23 @@ document.querySelector("button").addEventListener("click", bound);
The JavaScript specification defines the current realm, also known as the "current Realm Record". JAVASCRIPT
-Then, the current settings object is the environment settings object of the current
+ The current principal realm is the principal realm of the current
realm. Similarly, the current global object is the global object of the current realm. Note that the current realm, unlike the entry, incumbent and
+ relevant concepts, can refer to a synthetic realm. Almost all uses of the "current"
+ concept in this document and other Web specifications need to refer to the current principal
+ realm as well. One exception is JavaScript module processing, as synthetic realms have a separate set of module instances (derived from a common
+ module map across the shared environment settings object). Then, the current principal settings object is the environment settings object of the current
+ principal realm. Similarly, the current principal global object is the global object of the current principal realm. A realm where the script is evaluated, which is shared with other
- scripts in the same context.Relevant
@@ -107157,7 +107330,10 @@ document.querySelector("button").addEventListener("click", bound);
The settings object of a script is the - settings object of the script's + settings object of the + principal realm of the script's realm.
A classic script is a type of script @@ -107748,7 +107925,8 @@ document.querySelector("button").addEventListener("click", bound);
Fetch a single module script given url, settingsObject,
- "script
", options, settingsObject, "script
", options, settingsObject's
+ realm, "client
", true, and with the following steps given result:
Fetch a single module script given url, settingsObject,
- destination, options, settingsObject, "destination, options, settingsObject's
+ realm, "
client
", true, and with the following steps given result:
Fetch a single module script given url,
- fetchClient, destination, options, settingsObject,
+ fetchClient, destination, options, settingsObject's
+ realm,
"client
", true, and onSingleFetchComplete as defined below. If
performFetch was given, pass it along as well.
To fetch a single module script, given a URL url, an environment settings object fetchClient, a destination destination, a script - fetch options options, an environment settings object - settingsObject, a referrer - referrer, an optional ModuleRequest Record moduleRequest, a - boolean isTopLevel, an algorithm + fetch options
Assert: the result of running the module type allowed steps - given moduleType and settingsObject's realm is true. Otherwise, we would not have reached this point because a - failure would have been raised when inspecting moduleRequest.[[Attributes]] in + given moduleType and moduleMapRealm is true. + Otherwise, we would not have reached this point because a failure would have been raised when + inspecting moduleRequest.[[Attributes]] in HostLoadImportedModule or fetch a single imported module script.
Let moduleMap be settingsObject's module map.
Let moduleMap be moduleMapRealm's module map.
If moduleMap[(url, moduleType)] is
"fetching
", wait in parallel until that entry's value
@@ -108106,6 +108286,23 @@ document.querySelector("button").addEventListener("click", bound);
data-x="map exists">exists, run onComplete given
moduleMap[(url, moduleType)], and return.
If moduleMapRealm is a synthetic realm, then:
+ +Let script be the result of + cloning a module + given url, moduleType and moduleMapRealm.
Set moduleMap[(url, + moduleType)] to script.
Run onComplete given script.
Return.
Set moduleMap[(url,
moduleType)] to "fetching
".
application/wasm
" and moduleType is "javascript-or-wasm
", then set moduleScript to the result of
creating a WebAssembly module script given bodyBytes,
- settingsObject's realm,
- response's URL, and
- options.
+ moduleMapRealm, response's
+ URL, and options.
Otherwise:
@@ -108197,21 +108393,18 @@ document.querySelector("button").addEventListener("click", bound);If mimeType is a JavaScript MIME type and moduleType
is "javascript-or-wasm
", then set moduleScript to the result of
creating a JavaScript module script given sourceText,
- settingsObjects realm,
- response's URL, and
- options.
If the MIME type essence of mimeType is "text/css
"
and moduleType is "css
", then set moduleScript to
the result of creating a CSS module script given sourceText and
- settingsObject's realm.
If mimeType is a JSON MIME type and
moduleType is "json
", then set moduleScript to
the result of creating a JSON module script given sourceText and
- settingsObject's realm.
To clone a module given a URL, moduleType, and + moduleMapRealm, perform the following steps.
+ +Assert: moduleMapRealm is a synthetic realm.
Let parentModuleMap be moduleMapRealm's + principal realm's settings object's module map.
Assert: parentModuleMap[(url, moduleType)] + exists.
Let parentModule be parentModuleMap[(url, + moduleType)].
Let childModule be a new module script that this algorithm will + subsequently initialize.
Set childModule's realm to + moduleMapRealm.
Set childModule's base URL to + parentModule's base URL.
Set childModule's fetch + options to parentModule's fetch options.
Set childModule's error to + rethrow to parentModule's error + to rethrow.
Should this be cloned? Can this be an arbitrary + value?Let parentRecord be parentModule's record.
If parentRecord is null, then:
+ +Let parentParseError be parentModule's parse error.
Assert: parentParseError is a SyntaxError
+ instance.
Set childModule's parse
+ error to a new SyntaxError
in moduleMapRealm with the same
+ message as parentParseError.
Set childModule's record to + null.
Return childModule.
Set childModule's error to + rethrow to null.
Can parentModule be a CSS or JSON module?
Set childModule's record to + a new Source Text Module Record { [[Realm]]: moduleMapRealm, + [[Environment]]: undefined, [[Namespace]]: undefined, [[Status]]: unlinked, [[EvaluationError]]: + undefined, [[HostDefined]]: childModule, [[ECMAScriptCode]]: + parentRecord.[[ECMAScriptCode]], [[Context]]: empty, [[ImportMeta]]: empty, + [[RequestedModules]]: parentRecord.[[RequestedModules]], + [[ImportEntries]]: parentRecord.[[ImportEntries]], + [[LocalExportEntries]]: parentRecord.[[LocalImportEntries]], + [[IndirectExportEntries]]: parentRecord.[[IndirectImportEntries]], + [[StarExportEntries]]: parentRecord.[[StarImportEntries]], [[DFSIndex]]: undefined, + [[DFSAncestorIndex]]: undefined }. Is 'unlinked' correct?
Return childModule.
To fetch a single imported module script, given a URL url, an environment settings object fetchClient, a destination destination, a script - fetch options options, environment settings object - settingsObject, a referrer - referrer, a ModuleRequest Record moduleRequest, an - algorithm onComplete, and an optional options, a realm moduleMapRealm, + a referrer referrer, + a ModuleRequest Record moduleRequest, + an algorithm onComplete, and an optional perform the fetch hook performFetch, run these steps. onComplete must be an algorithm accepting null (on failure) or a module script (on success).
@@ -108251,11 +108523,11 @@ document.querySelector("button").addEventListener("click", bound); request steps given moduleRequest.If the result of running the module type allowed steps given - moduleType and settingsObject's realm is false, then run onComplete given null, and return.
Fetch a single module script given url, fetchClient, - destination, options, settingsObject, referrer, + destination, options, moduleMapRealm, referrer, moduleRequest, false, and onComplete. If performFetch was given, pass it along as well.
Let settings be realm's settings object.
If realm is a principal realm, then:
+ +Let settings be realm's settings object.
Add settings to the surrounding agent's event loop's currently running task's - script evaluation environment settings object set.
Add settings to the surrounding agent's event loop's currently running task's + script evaluation environment settings object set.
The steps to clean up after running script with a realm @@ -110765,7 +111043,8 @@ dictionary PromiseRejectionEventInit : EventInitJAVASCRIPT
Let incumbent realm be the incumbent realm.
Let incumbent realm be the incumbent + realm.
Let active script be the active script.
import()
expression is evaluated,
there will still be no active script. Fortunately that is handled by our
implementation of HostLoadImportedModule by falling back to using the
- current settings object's API base URL.
+ current principal settings object's API base URL.
@@ -111028,11 +111307,18 @@ import "https://example.com/foo/../module2.mjs";
must use the following implementation: JAVASCRIPT
Let settingsObject be the current settings object.
Let moduleMapRealm be the current realm.
+ +In the case of the ShadowRealm.prototype.importValue
API the
+ current realm is set to the appropriate synthetic realm.
If settingsObject's global
- object implements WorkletGlobalScope
or ServiceWorkerGlobalScope
+
If moduleMapRealm's principal
+ realm's (can we check moduleMapRealm directly?)
+ global object implements
+ WorkletGlobalScope
or ServiceWorkerGlobalScope
and loadState is undefined, then:
loadState is undefined when the current fetching process has been @@ -111064,14 +111350,20 @@ import "https://example.com/foo/../module2.mjs";
Set referencingScript to referrer.[[HostDefined]].
-Set settingsObject to referencingScript's settings object.
Set fetchReferrer to referencingScript's base URL.
Set originalFetchOptions to referencingScript's fetch options.
Set moduleMapRealm to referencing script's realm
+ +In the case of a dynamic import nested within a module loaded through the
+ ShadowRealm.prototype.importValue
API, the realm of the script is set to the
+ appropriate synthetic realm.
If the result of running the module type allowed steps given - moduleType and settingsObject's realm is false, then:
+ moduleType and moduleMapRealm is false, then:Let completion be Completion Record { [[Type]]: throw, @@ -111184,6 +111475,10 @@ import "https://example.com/foo/../module2.mjs";
Let settingsObject be moduleMapRealm's + principal realm's + settings object.
Let fetchOptions be the result of getting the descendant script fetch options given originalFetchOptions, url, and settingsObject.
Fetch a single imported module script given url, fetchClient, destination, fetchOptions, - settingsObject, fetchReferrer, moduleRequest, and + moduleMapRealm, fetchReferrer, moduleRequest, and onSingleFetchComplete as defined below. If loadState is not undefined and loadState.[[PerformFetch]] is not null, pass loadState.[[PerformFetch]] along as well.
@@ -111246,6 +111541,71 @@ import "https://example.com/foo/../module2.mjs";JavaScript contains an implementation-defined HostInitializeShadowRealm(realm) + abstract operation. User agents must use the following implementation: + JSSHADOWREALM
+ +Let settings be a new synthetic realm settings object that this + algorithm will subsequently initialize.
Set settings's principal realm to the + current principal realm.
Set settings's underlying realm to + realm.
Set settings's module + map to a new module map, initially empty.
Set realm.[[HostDefined]] to settings.
Define the global property references on realm.[[GlobalObject]], + given realm.
Let selfSteps be the following series of steps:
+ +Let thisValue be the result of getting the ShadowRealm global object with realm and the this + value.
Return thisValue.
Let selfGetter be CreateBuiltinFunction(selfSteps, 0, + "get self", « », realm).
Let selfDescriptor be the PropertyDescriptor{[[Get]]: + selfGetter, [[Set]]: undefined, [[Enumerable]]: true, [[Configurable]]: + true}.
Perform ! DefinePropertyOrThrow(realm.[[GlobalObject]], "self", + selfDescriptor).
Assert: calleeRealm is a synthetic realm
If thisValue is null or undefined, return + calleeRealm.[[GlobalObject]].
If thisValue is not an Object, then throw a + TypeError.
If thisValue is not a global object, then throw a + TypeError.
Assert: thisValue is + calleeRealm.[[GlobalObject]].
Return thisValue.
Let global be the current global object.
Let global be the current principal global object.
Let timeBeforePause be the current high resolution time given global.
Let parsed be the result of encoding-parsing a URL given - string, relative to the current settings object.
If parsed is failure, then return a promise rejected with a
"SyntaxError
" DOMException
.
Let realm be the current realm.
Let realm be the current principal realm.
Let p be a new promise.
It does its URL parsing up front, on the event loop, before going to the in parallel steps. This is necessary, since parsing depends on the current - settings object, which would no longer be current after going in + principal settings object, which would no longer be current after going in parallel.
Alternately, it could have saved a reference to the current settings
+ Alternately, it could have saved a reference to the current principal settings
object's API base URL and used it during the in parallel steps;
that would have been equivalent. However, we recommend instead doing as much work as possible up
front, as this example does. Attempting to save the correct values can be error prone; for
- example, if we'd saved just the current settings object, instead of its API
- base URL, there would have been a potential race.
It implicitly passes a list of strings from the
initial steps to the in parallel steps. This is OK, as both OnBeforeUnloadEventHandlerNonNull? OnBeforeUnl
In practice, this only affects the resolution of relative URLs via import()
,
which consult the base URL of the associated
script. Nulling out [[ScriptOrModule]] means that HostLoadImportedModule will
- fall back to the current settings object's API base URL.
Worker constructor
", and "script
".
- Let outside settings be the current settings object.
+Let outside settings be the current principal settings object.
Let worker URL be the result of encoding-parsing a URL given @@ -121148,7 +121509,8 @@ interface SharedWorker : EventTarget { data-x="">name member is set to the value of options and whose other members are set to their default values.
Let outside settings be the current settings object.
Let outside settings be the current principal settings + object.
Let urlRecord be the result of encoding-parsing a URL given
@@ -121368,7 +121730,8 @@ interface SharedWorker : EventTarget {
data-x="concept-WorkerGlobalScope-type">type is "module
", throw a
TypeError
exception.
Let settings object be the current settings object.
Let settings object be the current principal settings + object.
If urls is empty, return.
A module map
A module map that is used when importing JavaScript modules.
- -Synthetic realm settings objects' module map entries are copies of successfully
- fetched modules found in the principal realm's module map, so this map never contains entries
- which are null or "fetching
".
A module map that is used when importing JavaScript modules.
Synthetic realms are created with exists, run onComplete given moduleMap[(url, moduleType)], and return.
-If moduleMapRealm is a synthetic realm, then:
- -Let script be the result of - cloning a module - given url, moduleType and moduleMapRealm.
Set moduleMap[(url, - moduleType)] to script.
Run onComplete given script.
Return.
Set moduleMap[(url,
moduleType)] to "fetching
".
To clone a module given a URL, moduleType, and - moduleMapRealm, perform the following steps.
- -Assert: moduleMapRealm is a synthetic realm.
Let parentModuleMap be moduleMapRealm's - principal realm's settings object's module map.
Assert: parentModuleMap[(url, moduleType)] - exists.
Let parentModule be parentModuleMap[(url, - moduleType)].
Let childModule be a new module script that this algorithm will - subsequently initialize.
Set childModule's realm to - moduleMapRealm.
Set childModule's base URL to - parentModule's base URL.
Set childModule's fetch - options to parentModule's fetch options.
Set childModule's error to - rethrow to parentModule's error - to rethrow.
Should this be cloned? Can this be an arbitrary - value?Let parentRecord be parentModule's record.
If parentRecord is null, then:
- -Let parentParseError be parentModule's parse error.
Assert: parentParseError is a SyntaxError
- instance.
Set childModule's parse
- error to a new SyntaxError
in moduleMapRealm with the same
- message as parentParseError.
Set childModule's record to - null.
Return childModule.
Set childModule's error to - rethrow to null.
Can parentModule be a CSS or JSON module?
Set childModule's record to - a new Source Text Module Record { [[Realm]]: moduleMapRealm, - [[Environment]]: undefined, [[Namespace]]: undefined, [[Status]]: unlinked, [[EvaluationError]]: - undefined, [[HostDefined]]: childModule, [[ECMAScriptCode]]: - parentRecord.[[ECMAScriptCode]], [[Context]]: empty, [[ImportMeta]]: empty, - [[RequestedModules]]: parentRecord.[[RequestedModules]], - [[ImportEntries]]: parentRecord.[[ImportEntries]], - [[LocalExportEntries]]: parentRecord.[[LocalImportEntries]], - [[IndirectExportEntries]]: parentRecord.[[IndirectImportEntries]], - [[StarExportEntries]]: parentRecord.[[StarImportEntries]], [[DFSIndex]]: undefined, - [[DFSAncestorIndex]]: undefined }. Is 'unlinked' correct?
Return childModule.
To fetch a single imported module script, given a URL url,
an environment settings object fetchClient, a destination destination, a script
@@ -111316,8 +111214,7 @@ import "https://example.com/foo/../module2.mjs";
If moduleMapRealm's principal
- realm's (can we check moduleMapRealm directly?)
- global object implements
+ realmWorkletGlobalScope
or ServiceWorkerGlobalScope
and loadState is undefined, then:
Set moduleMapRealm to referencing script's realm
+Set moduleMapRealm to referencingScript's realm.
In the case of a dynamic import nested within a module loaded through the
ShadowRealm.prototype.importValue
API, the realm of the script is set to the
@@ -111485,7 +111382,9 @@ import "https://example.com/foo/../module2.mjs";
Let destination be "script"
.
Let fetchClient be settingsObject.
Let fetchClient be moduleMapRealm's + principal realm's + settings object.
If loadState is not undefined, then:
From 8131d2749cabf1096850eab7b4899b1498ef8fe8 Mon Sep 17 00:00:00 2001 From: Ms2gerShadowRealmGlobalObject
interfaceMove this!
+ +[Global] +interface ShadowRealmGlobalObject : EventTarget { + readonly attribute ShadowRealmGlobalObject self; +};+ +
The self
getter steps are to return
+ this.
The [[SetPrototypeOf]] internal method of a platform object O that
+ implements ShadowRealmGlobalObject
, when called with ECMAScript language
+ value V, must perform the following step:
Return OrdinarySetPrototypeOf(O, V).
This overrides the [[SetPrototypeOf]] + section in WebIDL. WEBIDL
+ +Do EventTarget.prototype
and
+ ShadowRealmGlobalObject.prototype
need a similar change?
JavaScript contains an implementation-defined JSSHADOWREALM
Let globalObject be a new ShadowRealmGlobalObject
+ object with realm.
Perform SetRealmGlobalObject(realm, + globalObject, undefined). (Should this use + InitializeHostDefinedRealm?)
Perform ? SetDefaultGlobalBindings(realm).
Let settings be a new synthetic realm settings object that this algorithm will subsequently initialize.
Set realm.[[HostDefined]] to settings.
Define the global property references on realm.[[GlobalObject]], - given realm.
Let selfSteps be the following series of steps:
- -Let thisValue be the result of getting the ShadowRealm global object with realm and the this - value.
Return thisValue.
Let selfGetter be CreateBuiltinFunction(selfSteps, 0, - "get self", « », realm).
Let selfDescriptor be the PropertyDescriptor{[[Get]]: - selfGetter, [[Set]]: undefined, [[Enumerable]]: true, [[Configurable]]: - true}.
Perform ! DefinePropertyOrThrow(realm.[[GlobalObject]], "self", - selfDescriptor).
Assert: calleeRealm is a synthetic realm
If thisValue is null or undefined, return - calleeRealm.[[GlobalObject]].
If thisValue is not an Object, then throw a - TypeError.
If thisValue is not a global object, then throw a - TypeError.
Assert: thisValue is - calleeRealm.[[GlobalObject]].
Return thisValue.
Return unused.
Do EventTarget.prototype
and
- ShadowRealmGlobalObject.prototype
need a similar change?
TODO: override step 8 of "create an interface + prototype object.
Let moduleMapRealm be the current realm.
-In the case of the ShadowRealm.prototype.importValue
API the
- current realm is set to the appropriate synthetic realm.
In the case of the ShadowRealm.prototype.importValue
API both the
+ current realm and referrer are set to the corresponding
+ synthetic realm.
[Global]
[LegacyFactoryFunction]
[LegacyLenientThis]
The [[SetPrototypeOf]] internal method of a platform object O that
- implements ShadowRealmGlobalObject
, when called with ECMAScript language
- value V, must perform the following step:
Return OrdinarySetPrototypeOf(O, V).
This overrides the [[SetPrototypeOf]] - section in WebIDL. WEBIDL
- -TODO: override step 8 of "create an interface - prototype object.
-JavaScript contains an implementation-defined ShadowRealmGlobalObject : EventTargetJSSHADOWREALM
Mark realm as having a + mutable global prototype chain.
+Let globalObject be a new ShadowRealmGlobalObject
object with realm.
[Global]
[LegacyFactoryFunction]
[LegacyLenientThis]
Mark realm as having a - mutable global prototype chain.
+Set realm's is global prototype chain mutable to true.
Let globalObject be a new ShadowRealmGlobalObject
object with realm.
JavaScript contains an implementation-defined HostInitializeShadowRealm(realm) - abstract operation. User agents must use the following implementation: + data-x="js-HostInitializeShadowRealm">HostInitializeShadowRealm(realm, + context) abstract operation. User agents must use the following implementation: JSSHADOWREALM
Let settings be a new synthetic realm settings object that this algorithm will subsequently initialize.
Set settings's execution context to + context.
Set settings's principal realm to the current principal realm.
ShadowRealmGlobalObject
interfaceShadowRealmGlobalScope
interfaceMove this!
[Global] -interface ShadowRealmGlobalObject : EventTarget { - readonly attribute ShadowRealmGlobalObject self; +interface ShadowRealmGlobalScope : EventTarget { + readonly attribute ShadowRealmGlobalScope self; };-
The self
getter steps are to return
+
The self
getter steps are to return
this.
Set realm's is global prototype chain mutable to true.
-Let globalObject be a new ShadowRealmGlobalObject
+
Let globalObject be a new ShadowRealmGlobalScope
object with realm.
Perform
Date: Thu, 18 Jan 2024 14:31:22 +0100
Subject: [PATCH 23/46] Add atob, btoa, structuredClone to shadow realms
---
source | 150 +++++++++++++++++++++++++++++++--------------------------
1 file changed, 82 insertions(+), 68 deletions(-)
diff --git a/source b/source
index e38cc3e5d12..beed7bc4d18 100644
--- a/source
+++ b/source
@@ -10768,7 +10768,7 @@ o.myself = o;
The The The Other standards are encouraged to further extend it using The In these APIs, for mnemonic purposes, the "b" can be considered to stand for
+ "binary", and the "a" for "ASCII". In practice, though, for primarily historical reasons, both the
+ input and output of these functions are Unicode strings. Takes the input data, in the form of a Unicode string containing only characters in the range
+ U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF respectively, and
+ converts it to its base64 representation, which it returns. Throws an " Takes the input data, in the form of a Unicode string containing base64-encoded binary data,
+ decodes it, and returns a string consisting of characters in the range U+0000 to U+00FF, each
+ representing a binary byte with values 0x00 to 0xFF respectively, corresponding to that binary
+ data. Throws an " The The Let decodedData be the result of running forgiving-base64 decode
+ on data. If decodedData is failure, then throw an
+ " Return decodedData. The The In these APIs, for mnemonic purposes, the "b" can be considered to stand for
- "binary", and the "a" for "ASCII". In practice, though, for primarily historical reasons, both the
- input and output of these functions are Unicode strings. Takes the input data, in the form of a Unicode string containing only characters in the range
- U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF respectively, and
- converts it to its base64 representation, which it returns. Throws an " Takes the input data, in the form of a Unicode string containing base64-encoded binary data,
- decodes it, and returns a string consisting of characters in the range U+0000 to U+00FF, each
- representing a binary byte with values 0x00 to 0xFF respectively, corresponding to that binary
- data. Throws an " The The Let decodedData be the result of running forgiving-base64 decode
- on data. If decodedData is failure, then throw an
- " Return decodedData. APIs for dynamically inserting markup into the document interact with the parser,
From d8e159431033c4fb192ff98d1c2cf278a93f3089 Mon Sep 17 00:00:00 2001
From: Ms2ger The Other standards are encouraged to further extend it using Other standards are encouraged to further extend it using The The The The Other standards are encouraged to further extend it using The The Move this! The JavaScript contains an implementation-defined ShadowRealmGlobalScope : EventTarget
Let globalObject be a new Perform SetRealmGlobalObject(realm,
- globalObject, undefined). (Should this use
- InitializeHostDefinedRealm?) Perform ? SetDefaultGlobalBindings(realm). Let settings be a new synthetic realm settings object that this
algorithm will subsequently initialize. Set realm.[[HostDefined]] to settings. Return unused. Return globalObject. The structuredClone(value,
options)
method steps are:The
+
+ WindowOrWorkerOrShadowRealmGlobalScope
mixinWindowOrWorkerOrShadowRealmGlobalScope
mixin is for use of APIs that are to be exposed on
+ Window
and WorkerGlobalScope
objects.partial
+ interface mixin WindowOrWorkerOrShadowRealmGlobalScope { … };
along with an
+ appropriate reference.
+
+ interface mixin WindowOrWorkerOrShadowRealmGlobalScope {
+ // base64 utility methods
+ DOMString btoa(DOMString data);
+ ByteString atob(DOMString data);
+
+ // structured cloning
+ any structuredClone(any value, optional StructuredSerializeOptions options = {});
+ };
+ Window includes WindowOrWorkerGlobalScope;
+ WorkerGlobalScope includes WindowOrWorkerGlobalScope;
+ ShadowRealmGlobalScope includes WindowOrWorkerGlobalScope;
Base64 utility methods
+
+ atob()
and btoa()
methods
+ allow developers to transform content to and from the base64 encoding.
+
+
+ result = self.btoa(data)
InvalidCharacterError
" DOMException
+ exception if the input string contains any out-of-range characters.result = self.atob(data)
InvalidCharacterError
" DOMException
if the
+ input string is not valid base64 data.btoa(data)
method must throw an
+ "InvalidCharacterError
" DOMException
if data
+ contains any character whose code point is greater than U+00FF. Otherwise, the user agent must
+ convert data to a byte sequence whose nth byte is the eight-bit
+ representation of the nth code point of data, and then must apply
+ forgiving-base64 encode to that byte sequence and return the result.atob(data)
method steps are:
+
+
+ InvalidCharacterError
" DOMException
.The
WindowOrWorkerGlobalScope
mixinWindowOrWorkerGlobalScope
mixin is for use of APIs that are to be exposed on
@@ -113948,10 +114029,6 @@ interface mixin WindowOrWorkerGlobalScope {
undefined reportError(any e);
- // base64 utility methods
- DOMString btoa(DOMString data);
- ByteString atob(DOMString data);
-
// timers
long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
undefined clearTimeout(optional long id = 0);
@@ -113964,9 +114041,6 @@ interface mixin WindowOrWorkerGlobalScope {
// ImageBitmap
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options = {});
Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options = {});
-
- // structured cloning
- any structuredClone(any value, optional StructuredSerializeOptions options = {});
};
Window includes WindowOrWorkerGlobalScope;
WorkerGlobalScope includes WindowOrWorkerGlobalScope;
@@ -114025,66 +114099,6 @@ document.body.appendChild(frame)
- Base64 utility methods
-
- atob()
and btoa()
methods
- allow developers to transform content to and from the base64 encoding.
-
-
- result = self.btoa(data)
InvalidCharacterError
" DOMException
- exception if the input string contains any out-of-range characters.result = self.atob(data)
InvalidCharacterError
" DOMException
if the
- input string is not valid base64 data.btoa(data)
method must throw an
- "InvalidCharacterError
" DOMException
if data
- contains any character whose code point is greater than U+00FF. Otherwise, the user agent must
- convert data to a byte sequence whose nth byte is the eight-bit
- representation of the nth code point of data, and then must apply
- forgiving-base64 encode to that byte sequence and return the result.atob(data)
method steps are:
-
-
- InvalidCharacterError
" DOMException
.Dynamic markup insertion
The
WindowOrWorkerOrShadowRealmGlobalScope
mixinWindowOrWorkerOrShadowRealmGlobalScope
mixin is for use of APIs that are to be exposed on
- Window
and WorkerGlobalScope
objects.Window
and WorkerGlobalScope
objects.partial
- interface mixin WindowOrWorkerOrShadowRealmGlobalScope { … };
along with an
- appropriate reference.partial
+ interface mixin WindowOrWorkerOrShadowRealmGlobalScope { … };
along with an
+ appropriate reference.interface mixin WindowOrWorkerOrShadowRealmGlobalScope {
- // base64 utility methods
- DOMString btoa(DOMString data);
- ByteString atob(DOMString data);
+
+ // structured cloning
+ any structuredClone(any value, optional StructuredSerializeOptions options = {});
+};
+Window includes WindowOrWorkerGlobalScope;
+WorkerGlobalScope includes WindowOrWorkerGlobalScope;
+ShadowRealmGlobalScope includes WindowOrWorkerGlobalScope;interface mixin WindowOrWorkerOrShadowRealmGlobalScope {
+ // base64 utility methods
+ DOMString btoa(DOMString data);
+ ByteString atob(DOMString data);
- // microtask queuing
- undefined queueMicrotask(VoidFunction callback);
+ // microtask queuing
+ undefined queueMicrotask(VoidFunction callback);
- // structured cloning
- any structuredClone(any value, optional StructuredSerializeOptions options = {});
- };
- Window includes WindowOrWorkerGlobalScope;
- WorkerGlobalScope includes WindowOrWorkerGlobalScope;
- ShadowRealmGlobalScope includes WindowOrWorkerGlobalScope;
Base64 utility methods
From b1021fef93d81f60fec5c6c20e277eff00d8a632 Mon Sep 17 00:00:00 2001
From: Ms2ger structuredClone(value,
options)
method steps are:The
+ WindowOrWorkerOrShadowRealmGlobalScope
mixinThe
- UniversalGlobalScope
mixinWindowOrWorkerOrShadowRealmGlobalScope
mixin is for use of APIs that are to be exposed on
- Window
and WorkerGlobalScope
objects.UniversalGlobalScope
mixin is for use of APIs that are to be exposed on all
+ global objects.partial
- interface mixin WindowOrWorkerOrShadowRealmGlobalScope { … };
along with an
+ interface mixin UniversalGlobalScope { … }; along with an
appropriate reference.interface mixin WindowOrWorkerOrShadowRealmGlobalScope {
+
+Window includes UniversalGlobalScope;
+WorkerGlobalScope includes UniversalGlobalScope;
+ShadowRealmGlobalScope includes UniversalGlobalScope;
+WorkletGlobalScope includes UniversalGlobalScope;interface mixin UniversalGlobalScope {
// base64 utility methods
DOMString btoa(DOMString data);
ByteString atob(DOMString data);
@@ -113990,7 +113990,7 @@ interface mixin WindowEventHandlers {
The
btoa(data)
method must throw an
"InvalidCharacterError
" DOMException
if data
contains any character whose code point is greater than U+00FF. Otherwise, the user agent must
@@ -113998,7 +113998,7 @@ interface mixin WindowEventHandlers {
representation of the nth code point of data, and then must apply
forgiving-base64 encode to that byte sequence and return the result.The
atob(data)
method steps are:
From 01e83bb244f3a6bb12bbfa92ce953b8f8652f626 Mon Sep 17 00:00:00 2001
From: Ms2ger
- The
-
- ShadowRealmGlobalScope
interface[Global]
-interface ShadowRealmGlobalScope : EventTarget {
- readonly attribute ShadowRealmGlobalScope self;
-};
-
- self
getter steps are to return
- this.HostInitializeShadowRealm(realm, context)
ShadowRealmGlobalScope
object with realm.The
+
+ ShadowRealmGlobalScope
interface
+
+ [Global]
+interface ShadowRealmGlobalScope : EventTarget {
+ readonly attribute ShadowRealmGlobalScope self;
+};
self
getter steps are to return
+ this.Event loops
@@ -113950,9 +113941,10 @@ interface mixin WindowEventHandlers {
// structured cloning
any structuredClone(any value, optional StructuredSerializeOptions options = {});
};
-Window includes WindowOrWorkerGlobalScope;
-WorkerGlobalScope includes WindowOrWorkerGlobalScope;
-ShadowRealmGlobalScope includes WindowOrWorkerGlobalScope;Base64 utility methods
From 0dc0ee4ac01bb3c9fd2708487b9f1e973eec77d4 Mon Sep 17 00:00:00 2001
From: Ms2ger
JavaScript contains an implementation-defined HostInitializeShadowRealm(realm, @@ -111463,8 +111463,8 @@ import "https://example.com/foo/../module2.mjs"; context.
Set settings's principal realm to the - current principal realm.
Set settings's underlying realm to
From 9e48745b351ba74115c9ea8527d735c274006386 Mon Sep 17 00:00:00 2001
From: Ms2ger JavaScript contains an implementation-defined HostInitializeShadowRealm(realm,
- context) abstract operation. User agents must use the following implementation:
- JSSHADOWREALM
Set realm's is global prototype chain mutable to true.
From ea3c573330b79c960fcbc6ff4d0c03dcc8707ddf Mon Sep 17 00:00:00 2001 From: Ms2gerSet realm.[[HostDefined]] to settings.
Return globalObject.
Set realm.[[GlobalObject]] to globalObject.
Set realm.[[GlobalEnv]] to + NewGlobalEnvironment(globalObject, globalObject).
Perform ? SetDefaultGlobalBindings(realm).
Return NormalCompletion(unused).
ShadowRealmGlobalScope
interfaceA principal realm comes with an implementation-defined - global object; much of this specification is devoted to defining that global object - and its properties.
A principal realm comes with an implementation-defined + global object; much of this specification is devoted to defining that global object + and its properties.
A synthetic realm is created by the ShadowRealm API and includes a reduced set - of properties.
A synthetic realm is created by the ShadowRealm API and includes a reduced set + of properties.
For web specifications, it is often useful to associate values or algorithms with a
From f5194b0bd9622cc8aba01c08e011aaf692076053 Mon Sep 17 00:00:00 2001
From: Ms2ger
If realm is a principal realm, then:
+If realm is a principal realm:
Let settings be realm's
Date: Tue, 19 Nov 2024 16:11:29 +0100
Subject: [PATCH 33/46] Remove unnecessary concept
---
source | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/source b/source
index 8ed79761010..2b453b2398b 100644
--- a/source
+++ b/source
@@ -106624,11 +106624,6 @@ new PaymentRequest(…); // Allowed to use
The principal realm which this synthetic realm exists within. An underlying realm The synthetic realm which this settings object represents. A module map
Set settings's underlying realm to - realm.
Set settings's module map to a new module map, initially empty.
Let event loop be global's relevant agent's event loop.
Let document be global's associated Document
, if global is
- a Window
object; otherwise null.
Let principal global be global's + realm's + principal realm's + global.
Let document be principal global's associated Document
,
+ if principal global is a Window
object; otherwise null.
Queue a task given source, event loop, document, and steps.
Let realm be the current principal realm.
Let realm be the current realm.
Let p be a new promise.
Let value be originalDesc.[[Value]].
If IsCallable(value) is true, then set value to - an anonymous built-in function, created in the current principal realm, that - performs the same steps as the IDL operation P on object O.
Set crossOriginDesc to PropertyDescriptor{ [[Value]]: value, @@ -89582,14 +89582,14 @@ dictionary DragEventInit : MouseEventInit {
Let crossOriginGet be undefined.
If e.[[NeedsGet]] is true, then set crossOriginGet to an - anonymous built-in function, created in the current principal realm, that - performs the same steps as the getter of the IDL attribute P on object + anonymous built-in function, created in the current realm, that performs the + same steps as the getter of the IDL attribute P on object O.
Let crossOriginSet be undefined.
If e.[[NeedsSet]] is true, then set crossOriginSet to an - anonymous built-in function, created in the current principal realm, that + anonymous built-in function, created in the current realm, that performs the same steps as the setter of the IDL attribute P on object O.
The agent equivalent of the current principal realm is the - surrounding agent.
+The agent equivalent of the current realm or + current principal realm is the surrounding agent.
@@ -106479,6 +106479,28 @@ new PaymentRequest(…); // Allowed to use object's relevant agent's event loop. +Each synthetic realm has an associated synthetic realm settings object + with the following fields:
+ +An execution context
The JavaScript execution context for the scripts within this realm.
A principal realm
The principal realm which this synthetic realm exists within.
A module map
A module map that is used when importing JavaScript modules.
A global object is a JavaScript object that is the [[GlobalObject]] field of @@ -106608,32 +106630,7 @@ new PaymentRequest(…); // Allowed to use
Return realm execution context.
Each synthetic realm has an associated synthetic realm settings object - with the following fields:
- -An execution context
The JavaScript execution context for the scripts within this realm.
A principal realm
The principal realm which this synthetic realm exists within.
A module map
A module map that is used when importing JavaScript modules.
Synthetic realms are created with global objects which are initialized by the JavaScript specification's - SetDefaultGlobalBindings algorithm. Synthetic - global objects implement only certain specifically exposed interfaces.
+Analogously, there is always a 1-to-1-to-1 mapping between synthetic realms, synthetic global
@@ -106726,9 +106723,9 @@ new PaymentRequest(…); // Allowed to use
When defining algorithm steps throughout this specification, it is often important to indicate
- what principal realm is to be used—or, equivalently, what principal global
- object or environment settings object is to be used. In general, there are at
- least four possibilities:
The incumbent realm is that of b.html
.
The current principal realm is that of The current realm is that of c.html
(since it is the print()
method from
c.html
whose code is running).
The relevant realm of the object on which @@ -106868,13 +106865,13 @@ new PaymentRequest(…); // Allowed to use </script>
If the algorithm for the getBattery()
method
- had instead used the current principal realm, all the results would be reversed.
- That is, after the first call to getBattery()
in
- outer.html
, the Navigator
object in current realm, all the results would be reversed. That is,
+ after the first call to
function would thus return a promise from the "wrong" realm. Since
+ this is undesirable, the algorithm instead uses the relevant realm, giving the sensible results indicated in
the comments above.getBattery()
in outer.html
, the Navigator
object in inner.html
would be permanently storing a Promise
object
created in outer.html
's realm, and calls like that inside the
- hello()
function would thus return a promise from the "wrong" realm.
- Since this is undesirable, the algorithm instead uses the hello()
Note that the current realm, unlike the entry, incumbent and - relevant concepts, can refer to a synthetic realm. Almost all uses of the "current" - concept in this document and other Web specifications need to refer to the current principal - realm as well. One exception is JavaScript module processing, as synthetic realms have a separate set of module instances (derived from a common - module map across the shared environment settings object).
-Then, the current principal settings object is the environment settings object of the current principal realm.
Similarly, the current principal global object is the global object of the current principal realm.
+ data-x="concept-realm-global">global object of the + current principal realm. + +Note that the current realm can refer to a synthetic realm. + Whether to use the "current" or "current principal" concept depends on the situation. + It appears to be the case that in most situations where a realm is needed, + the current realm is a better choice than the current principal realm, + while it is more likely that for a settings object, the current principal settings object + is to be used; notably the settings object for a synthetic realm contains much less + information. + Note that in the context of APIs that are not exposed in a synthetic realm, both + concepts coincide.
JavaScript contains an implementation-defined HostInitializeShadowRealm(realm, - context, O) abstract operation. - User agents must use the following implementation: JSSHADOWREALM
+ShadowRealmGlobalScope
interface[Global]
+interface ShadowRealmGlobalScope : EventTarget {
+ readonly attribute ShadowRealmGlobalScope self;
+};
+
+ The self
getter steps are to return
+ this.
When performing InitializeHostDefinedRealm
+ in the ShadowRealm
constructor, the steps to
+ create a global object created in a host-defined manner are the following:
Let realm be the current realm.
+Set realm's is global prototype chain mutable to true.
Let globalObject be a new ShadowRealmGlobalScope
object with realm.
Return globalObject.
JavaScript contains an implementation-defined HostInitializeShadowRealm(realm, + context, O) abstract operation. + User agents must use the following implementation: JSSHADOWREALM
+ +Let globalObject be realm.[[GlobalObject]].
Let settings be a new synthetic realm settings object that this algorithm will subsequently initialize.
Set realm.[[HostDefined]] to settings.
Set realm.[[GlobalObject]] to globalObject.
Set realm.[[GlobalEnv]] to - NewGlobalEnvironment(globalObject, globalObject).
Perform ? SetDefaultGlobalBindings(realm).
Return NormalCompletion(unused).
ShadowRealmGlobalScope
interface[Global]
-interface ShadowRealmGlobalScope : EventTarget {
- readonly attribute ShadowRealmGlobalScope self;
-};
-
- The self
getter steps are to return
- this.
Note that the current realm can refer to a synthetic realm. Whether to use the "current" or "current principal" concept depends on the situation. - It appears to be the case that in most situations where a realm is needed, - the current realm is a better choice than the current principal realm, - while it is more likely that for a settings object, the current principal settings object - is to be used; notably the settings object for a synthetic realm contains much less + For example, if you need a realm to create an object or a function you should probably + use the current realm, while if you are checking whether some operation is allowed or not + in the current context you are probably looking for the current principal settings + object; notably the settings object for a synthetic realm contains much less information. Note that in the context of APIs that are not exposed in a synthetic realm, both concepts coincide.
From c8d1b45998094cfec01936a9d99fcbd97e00cd98 Mon Sep 17 00:00:00 2001 From: Ms2gerLet settingsObject be moduleMapRealm's +
Let fetchClient be moduleMapRealm's principal realm's settings object.
Let fetchOptions be the result of getting the descendant script fetch options given - originalFetchOptions, url, and settingsObject.
Let destination be "script"
.
Let fetchClient be moduleMapRealm's - principal realm's - settings object.
If loadState is not undefined, then:
From a12d85ec35d35b15d77cb49e5367474ae362674f Mon Sep 17 00:00:00 2001 From: Ms2gerImport maps are not currently supported in + synthetic realms. This could change in the future.
+The simplest use of import maps is to globally remap a bare module specifier:
From 2039fa1bafb6d95830bff09985c2ed1c35aed977 Mon Sep 17 00:00:00 2001 From: Ms2ger[Global]
interface ShadowRealmGlobalScope : EventTarget {
- readonly attribute ShadowRealmGlobalScope self;
+ readonly attribute ShadowRealmGlobalScope self;
};
The The The following are the event handlers (and their corresponding event handler event types) that must be supported,
+ as event handler IDL attributes, by objects implementing the
+ When performing InitializeHostDefinedRealm
@@ -113240,9 +113257,9 @@ interface ShadowRealmGlobalScope : EventTarget
Let special error event handling be true if event is an
Date: Tue, 26 Nov 2024 10:17:59 +0100
Subject: [PATCH 41/46] event handlers
---
source | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/source b/source
index 5aa96236701..47513fea021 100644
--- a/source
+++ b/source
@@ -111444,12 +111444,29 @@ import "https://example.com/foo/../module2.mjs";
[Global]
interface ShadowRealmGlobalScope : EventTarget {
readonly attribute ShadowRealmGlobalScope self;
+ attribute OnErrorEventHandler onerror;
+ attribute EventHandler onrejectionhandled;
+ attribute EventHandler onunhandledrejection;
};
self
getter steps are to return
this.ShadowRealmGlobalScope
interface:
+
+
+
+ Event handler Event handler event type
+ onerror
error
+ onrejectionhandled
rejectionhandled
+ onunhandledrejection
unhandledrejection
+ Creating a Shadow Realm
ErrorEvent
object, event's type
is
"error
", and event's currentTarget
implements the
- WindowOrWorkerGlobalScope
mixin. Otherwise, let special error event
- handling be false.WindowOrWorkerGlobalScope
mixin or the ShadowRealmGlobalScope
+ interface. Otherwise, let special error event handling be false.
Process the Event
object event as follows:
The The reportError(e)
method steps are to
report an exception e for this.
interface mixin UniversalGlobalScope {
+ undefined reportError(any e);
+
// base64 utility methods
DOMString btoa(DOMString data);
ByteString atob(DOMString data);
@@ -114051,8 +114053,6 @@ interface mixin WindowOrWorkerGlobalScope {
readonly attribute boolean isSecureContext;
readonly attribute boolean crossOriginIsolated;
- undefined reportError(any e);
-
// timers
long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
undefined clearTimeout(optional long id = 0);
From 8cf315000bd72a87b30731780a118b5a6e1de139 Mon Sep 17 00:00:00 2001
From: Ms2ger
Date: Tue, 26 Nov 2024 11:09:46 +0100
Subject: [PATCH 43/46] isSecureContext
---
source | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/source b/source
index 1ad5765a67c..7c890c4b8c8 100644
--- a/source
+++ b/source
@@ -113960,6 +113960,8 @@ interface mixin WindowEventHandlers {
appropriate reference.
interface mixin UniversalGlobalScope {
+ readonly attribute boolean isSecureContext;
+
undefined reportError(any e);
// base64 utility methods
@@ -114050,7 +114052,6 @@ interface mixin WindowEventHandlers {
interface mixin WindowOrWorkerGlobalScope {
[Replaceable] readonly attribute USVString origin;
- readonly attribute boolean isSecureContext;
readonly attribute boolean crossOriginIsolated;
// timers
@@ -114100,10 +114101,12 @@ document.body.appendChild(frame)
- The The isSecureContext
getter steps are to return true if
- this's relevant settings object is a secure context, or
- false otherwise.
+ this's realm's
+ principal realm's
+ settings object is a
+ secure context, or false otherwise.
The origin
getter steps are to return this's
From acb7665a9a520095eb17c0926684bc99e4b2f5c1 Mon Sep 17 00:00:00 2001
From: Ms2ger
Date: Wed, 27 Nov 2024 09:31:05 +0100
Subject: [PATCH 44/46] Fix base url in module specifier resolution
---
source | 1 +
1 file changed, 1 insertion(+)
diff --git a/source b/source
index 7c890c4b8c8..0a78222ca1c 100644
--- a/source
+++ b/source
@@ -109377,6 +109377,7 @@ dictionary PromiseRejectionEventInit : EventInitSet realm to the current realm.
Set baseURL to realm's
+ principal realm's
settings object's
API base URL.
From 7449ee076f55c4c95d9143c712c49261f6425ea6 Mon Sep 17 00:00:00 2001
From: Ms2ger
Date: Wed, 27 Nov 2024 11:24:30 +0100
Subject: [PATCH 45/46] Fix HostInitializeShadowRealm
---
source | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source b/source
index 0a78222ca1c..7194eac5540 100644
--- a/source
+++ b/source
@@ -111504,7 +111504,8 @@ interface ShadowRealmGlobalScope : EventTarget
Set settings's principal realm to O's
- associated realm.
+ associated realm's
+ principal realm.
Set settings's module
map to a new module map, initially empty.
From a2fe477c75d0e1fedf0b6853b9b96d38ceb1ee9a Mon Sep 17 00:00:00 2001
From: Ms2ger
Date: Wed, 27 Nov 2024 14:22:52 +0100
Subject: [PATCH 46/46] relevant principal *
---
source | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/source b/source
index 7194eac5540..b09e547904a 100644
--- a/source
+++ b/source
@@ -107214,6 +107214,18 @@ document.querySelector("button").addEventListener("click", bound);
object of the relevant realm for
o.
+ The relevant principal realm for a platform object o
+ is o's relevant realm's
+ principal realm.
+
+ The relevant principal settings object for a platform object
+ o is o's relevant principal realm's
+ environment settings object.
+
+ The relevant principal global object for a platform object
+ o is o's relevant principal realm's
+ global object.
+
Enabling and disabling scripting