diff --git a/source b/source index fb6ff38da8b..b6c15c52a97 100644 --- a/source +++ b/source @@ -2401,7 +2401,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute getting the value of an entry, and setting the value of an entry
Whenever a Document
object is discarded, it is also removed from the list of the worker's
- Document
s of each worker whose list contains that Document
.
Document
.
When a browsing context is discarded, the strong reference from the user agent itself to the browsing context must be severed, and all the @@ -96884,6 +96887,19 @@ interface WorkerGlobalScope : EventTarget { attribute EventHandler onunhandledrejection; }; +
A WorkerGlobalScope
object has an associated owner
+ set (a set of Document
and WorkerGlobalScope
+ objects). It is initially empty and populated when the worker is created or obtained.
It is a set, instead of a single owner, to accomodate
+ SharedWorkerGlobalScope
objects.
A WorkerGlobalScope
object has an associated worker set (a set of
+ WorkerGlobalScope
objects). It is initially empty and populated when the worker
+ creates or obtains further workers.
A WorkerGlobalScope
object has an associated type ("classic
" or "module
"). It is set during creation.
@@ -97127,63 +97143,48 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope {
contexts through message channels and their
MessagePort
objects.
Each WorkerGlobalScope
worker global scope has a list of
+
Each WorkerGlobalScope
object worker global scope has a list of
the worker's ports, which consists of all the MessagePort
objects that are entangled with another port and that have one (but only one) port owned by
- worker global scope. This list includes the implicit MessagePort
in the case of dedicated workers.
Each WorkerGlobalScope
also has a list of the worker's
- workers. Initially this list is empty; it is populated when the worker creates or obtains
- further workers.
Finally, each WorkerGlobalScope
also has a list of the
- worker's Document
s. Initially this list is empty; it is populated when the
- worker is created.
Whenever a Document
d is added to the worker's Document
s, the user agent must, for
- each worker q in the list of the worker's workers whose list of
- the worker's Document
s does not contain d, add d to q's WorkerGlobalScope
owner's list of the worker's
- Document
s.
MessagePort
in the
+ case of dedicated workers.
Whenever a Document
object is discarded,
- it must be removed from the list of the worker's Document
s of each
- worker whose list contains that Document
.
Given an environment settings object o when creating or obtaining a
- worker, the list of relevant Document
objects to add depends on the type
- of global object specified by o.
- If o specifies a global object
- that is a WorkerGlobalScope
object (i.e. if we are creating a nested worker), then
- the relevant Document
s are the the worker's Document
s of
- the global object specified by o.
- Otherwise, o specifies a global
- object that is a Window
object, and the relevant Document
is just
- the responsible document specified by o.
WorkerGlobalScope
object whose set contains that
+ Document
object.
+
+ Given an environment settings object
+ o when creating or obtaining a worker, the relevant owner to add depends on
+ the type of global object specified by
+ o. If o specifies a global
+ object that is a WorkerGlobalScope
object (i.e., if we are creating a nested
+ worker), then the relevant owner is that global object. Otherwise, o specifies a global object that is a Window
object,
+ and the relevant owner is the responsible document specified by o.
A worker is said to be a permissible worker if its list of the worker's
- Document
s is not empty, or if its list has been empty for no more than a short
- user-agent-defined timeout value, its WorkerGlobalScope
is actually a
- SharedWorkerGlobalScope
object (i.e. the worker is a shared worker), and the user
- agent has a browsing context whose Document
is not completely
- loaded.
A worker is said to be a permissible worker if its WorkerGlobalScope
's
+ owner set is not empty or:
WorkerGlobalScope
object is a SharedWorkerGlobalScope
object
+ (i.e., the worker is a shared worker), andDocument
object is not
+ completely loaded.The second part of this definition allows a shared worker to survive for a short time while a page is loading, in case that page is going to contact the shared worker again. This can be used by user agents as a way to avoid the cost of restarting a shared worker used by a site when the user is navigating from page to page within that site.
-A worker is said to be an active needed worker if any of the Document
- objects in the worker's Document
s are fully active.
A worker is said to be an active needed worker if any its owners are either Document
objects that are fully active or
+ active needed workers.
A worker is said to be a protected worker if it is an active needed worker and either it has outstanding timers, database transactions, or network connections, @@ -97219,15 +97220,13 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope {
Let is shared be true if worker is a SharedWorker
object, and false otherwise.
Let docs be the list of relevant Document
objects to
- add given outside settings.
Let owner be the relevant owner to add given outside + settings.
Let parent worker global scope be null.
-If outside settings's global
- object is a WorkerGlobalScope
object (i.e. we are creating a nested worker),
- set parent worker global scope to outside settings's global object.
If owner is a WorkerGlobalScope
object (i.e., we are creating a
+ nested worker), then set parent worker global scope to owner.
Call the JavaScript SharedWorkerGlobalScope : WorkerGlobalScope {
Entangle outside port and inside port. Add to worker global
- scope's list of the worker's Append owner to worker global
+ scope's owner set. If parent worker global scope is not null, add worker global scope
- to the list of the worker's workers of parent worker global
- scope. If parent worker global scope is not null, then append worker global scope to parent worker global scope's
+ worker set. Set worker global scope's type to the value of the Empty the worker's list of
- the worker's Empty worker global scope's owner set. Associate the outside port with worker. Let docs be the list of relevant Return worker, and run the following step in parallel. Run a worker given worker, worker URL, outside
@@ -97962,15 +97957,15 @@ interface SharedWorker : EventTarget {
data-x="dom-MessageEvent-source">source Add to worker global
- scope's list of the worker's Append the relevant owner to add given
+ outside settings to worker global scope's owner
+ set. If outside settings's global
- object is a Document
s the
- Document
objects in docs.SharedWorkerGlobalScope : WorkerGlobalScope {
attribute initialized to inside
port.Document
s.Document
objects to
- add given outside settings.Document
s the
- list of relevant Document
objects to add given outside
- settings.WorkerGlobalScope
object, add worker global scope
- to the list of the worker's workers of outside settings's global object.WorkerGlobalScope
object, then append worker global scope to outside settings's global object's worker
+ set.