From cec5fcca61595dbaab2235d24a1e4e8655e4569f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= A global object has an import map,
initially an empty import map. For now, only For now, only A global object has a resolved module set, a set
of specifier resolution records, initially
@@ -109215,12 +109216,9 @@ dictionary PromiseRejectionEventInit : EventInit
- Let importMap be an empty import map. If settingsObject's global
- object implements Let importMap be settingsObject's global object's import map. Let serializedBaseURL be baseURL, serialized. When a user agent is to run a worker for a script with Let is shared be true if worker is a Set worker global scope's import map to importMap. Append owner to worker global
scope's owner set. If worker URL is failure, then throw a " Let importMap be an empty import map. If options's If the current global object implements Else, throw a The current global object's import map could be modified, by merging it with a new import map. Such
+ updates will not be reflected in the cloned import map. Let worker be a new Let outside port be a new Run a worker given worker, worker URL, outside
- settings, outside port, and options.Window
global
- objects have their import map modified
- from the initial empty one. The import map is
- only accessed for the resolution of a root module script.Window
and DedicatedWorkerGlobalScope
+ global objects have their import map modified from the initial empty one. The
+ import map is only accessed for the resolution of
+ a root module script.Window
, then set importMap to
- settingsObject's global object's
- import map.Worker
or
SharedWorker
object worker, URL url,
environment settings object outside settings, MessagePort
- outside port, and a WorkerOptions
dictionary options, it must
- run the following steps.WorkerOptions
dictionary options, and an
+ import map importMap, it must run the following steps.
@@ -121137,10 +121165,15 @@ enum WorkerType { "classic", "module" };
SharedWorker
@@ -120591,6 +120589,9 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope
data-x="concept-WorkerGlobalScope-name">name to the value of options's
name
member.
@@ -121108,6 +121115,27 @@ enum WorkerType { "classic", "module" };
[Exposed=(Window,DedicatedWorker,SharedWorker)]
interface Worker : EventTarget {
- constructor((
TrustedScriptURL
or USVString) scriptURL, optional WorkerOptions options = {});
+ constructor((TrustedScriptURL
or USVString) scriptURL, optional DedicatedWorkerOptions options = {});
undefined terminate();
@@ -121015,12 +121016,18 @@ interface Worker : EventTarget {
dictionary WorkerOptions {
WorkerType type = "classic";
- RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module"
+ RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module"
DOMString name = "";
};
+dictionary DedicatedWorkerOptions : WorkerOptions {
+ WorkerImportMapInheritance importMap = "none";
+};
+
enum WorkerType { "classic", "module" };
+enum WorkerImportMapInheritance { "none", "clone" };
+
Worker includes AbstractWorker;
Worker includes MessageEventTarget;SyntaxError
"
DOMException
.importMap
member is "clone
", then:
+
+
+ Window
or
+ DedicatedWorkerGlobalScope
, set importMap to a deep copy of the
+ current global object's import
+ map.TypeError
exception.Worker
object.MessagePort
in outside
@@ -121123,7 +121151,7 @@ enum WorkerType { "classic", "module" };
, outside port options, and importMap.[Exposed=Window]
interface SharedWorker : EventTarget {
- constructor((
TrustedScriptURL
or USVString) scriptURL, optional (DOMString or WorkerOptions) options = {});
+ constructor((TrustedScriptURL
or USVString) scriptURL, optional (DOMString or SharedWorkerOptions) options = {});
readonly attribute MessagePort port;
};
+
+dictionary SharedWorkerOptions : WorkerOptions {
+ any importMap; // used to prevent passing DedicatedWorkerOptions' importMap option
+};
+
SharedWorker includes AbstractWorker;
@@ -121193,7 +121226,7 @@ interface SharedWorker : EventTarget {
"
script
".
If options is a DOMString
, set
- options to a new WorkerOptions
dictionary whose options to a new
SharedWorkerOptions
dictionary whose name
member is set to the value of options and whose other members
are set to their default values.
If urlRecord is failure, then throw a "SyntaxError
"
DOMException
.
If options's importMap
member is not undefined, throw
+ a TypeError
exception.
Let worker be a new SharedWorker
object.
Let outside port be a new MessagePort
in outside
@@ -121338,8 +121374,8 @@ interface SharedWorker : EventTarget {
Otherwise, in parallel, run a worker given worker, - urlRecord, outside settings, outside port, and - options.