@@ -2401,15 +2401,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2401
2401
<dfn data-x="map get" data-x-href="https://infra.spec.whatwg.org/#map-get">getting the value of an entry</dfn>, and
2402
2402
<dfn data-x="map set" data-x-href="https://infra.spec.whatwg.org/#map-set">setting the value of an entry</dfn></li>
2403
2403
<li>The <dfn data-x-href="https://infra.spec.whatwg.org/#list">list</dfn> data structure and the associated definitions for
2404
- <dfn data-x="list append" data-x-href="https://infra.spec.whatwg.org/#list-append">append</dfn>, and
2404
+ <dfn data-x="list append" data-x-href="https://infra.spec.whatwg.org/#list-append">append</dfn>,
2405
+ <dfn data-x="list remove" data-x-href="https://infra.spec.whatwg.org/#list-remove">remove</dfn>,
2406
+ <dfn data-x="list empty" data-x-href="https://infra.spec.whatwg.org/#list-empty">empty</dfn>,
2405
2407
<dfn data-x="list contains" data-x-href="https://infra.spec.whatwg.org/#list-contain">contains</dfn>,
2406
2408
<dfn data-x="list size" data-x-href="https://infra.spec.whatwg.org/#list-size">size</dfn>,
2407
2409
<dfn data-x="list is empty" data-x-href="https://infra.spec.whatwg.org/#list-is-empty">is empty</dfn>, and
2408
2410
<dfn data-x="list iterate" data-x-href="https://infra.spec.whatwg.org/#list-iterate">iterate</dfn></li>
2409
2411
<li>The <dfn data-x-href="https://infra.spec.whatwg.org/#stack">stack</dfn> data structure and the associated definitions for
2410
2412
<dfn data-x="stack push" data-x-href="https://infra.spec.whatwg.org/#stack-push">push</dfn> and
2411
2413
<dfn data-x="stack pop" data-x-href="https://infra.spec.whatwg.org/#stack-pop">pop</dfn></li>
2412
- <li>The <dfn data-x="set" data-x-href="https://infra.spec.whatwg.org/#ordered-set">ordered set</dfn> data structure</li>
2414
+ <li>The <dfn data-x="set" data-x-href="https://infra.spec.whatwg.org/#ordered-set">ordered set</dfn> data structure and the associated definition for
2415
+ <dfn data-x="set append" data-x-href="https://infra.spec.whatwg.org/#set-append">append</dfn></li>
2413
2416
<li><dfn data-x-href="https://infra.spec.whatwg.org/#html-namespace">HTML namespace</dfn></li>
2414
2417
<li><dfn data-x-href="https://infra.spec.whatwg.org/#mathml-namespace">MathML namespace</dfn></li>
2415
2418
<li><dfn data-x-href="https://infra.spec.whatwg.org/#svg-namespace">SVG namespace</dfn></li>
@@ -79148,8 +79151,8 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span
79148
79151
</ol>
79149
79152
79150
79153
<p class="note">Whenever a <code>Document</code> object is <span data-x="discard a
79151
- Document">discarded</span>, it is also removed from the list of < span>the worker's
79152
- <code>Document</code>s</span> of each worker whose list contains that <code>Document</code>.</p>
79154
+ Document">discarded</span>, it is also removed from the <span>owner set</ span> of each worker
79155
+ whose set contains that <code>Document</code>.</p>
79153
79156
79154
79157
<p>When <dfn data-export="">a <em>browsing context</em> is discarded</dfn>, the strong reference
79155
79158
from the user agent itself to the <span>browsing context</span> must be severed, and all the
@@ -96884,6 +96887,19 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
96884
96887
attribute <span>EventHandler</span> <span data-x="handler-WorkerGlobalScope-onunhandledrejection">onunhandledrejection</span>;
96885
96888
};</pre>
96886
96889
96890
+ <p id="the-worker's-documents">A <code>WorkerGlobalScope</code> object has an associated <dfn
96891
+ id="concept-WorkerGlobalScope-owner-set" data-export="" data-for="WorkerGlobalScope">owner
96892
+ set</dfn> (a <span>set</span> of <code>Document</code> and <code>WorkerGlobalScope</code>
96893
+ objects). It is initially empty and populated when the worker is created or obtained.</p>
96894
+
96895
+ <p class="note">It is a <span>set</span>, instead of a single owner, to accomodate
96896
+ <code>SharedWorkerGlobalScope</code> objects.</p>
96897
+
96898
+ <p>A <code>WorkerGlobalScope</code> object has an associated <dfn id="the-worker's-workers"
96899
+ data-export="" data-for="WorkerGlobalScope">worker set</dfn> (a <span>set</span> of
96900
+ <code>WorkerGlobalScope</code> objects). It is initially empty and populated when the worker
96901
+ creates or obtains further workers.</p>
96902
+
96887
96903
<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-export=""
96888
96904
data-dfn-for="WorkerGlobalScope" data-x="concept-WorkerGlobalScope-type">type</dfn> ("<code
96889
96905
data-x="">classic</code>" or "<code data-x="">module</code>"). It is set during creation.
@@ -97127,63 +97143,48 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
97127
97143
contexts</span> through <span data-x="channel messaging">message channels</span> and their
97128
97144
<code>MessagePort</code> objects.</p>
97129
97145
97130
- <p>Each <code>WorkerGlobalScope</code> <var>worker global scope</var> has a list of
97146
+ <p>Each <code>WorkerGlobalScope</code> object <var>worker global scope</var> has a list of
97131
97147
<dfn data-export="">the worker's ports</dfn>, which consists of all the <code>MessagePort</code>
97132
97148
objects that are entangled with another port and that have one (but only one) port owned by
97133
- <var>worker global scope</var>. This list includes <!--all the <code>MessagePort</code> objects
97134
- that are in events pending in the <code>WorkerGlobalScope</code> object's <span>event loop</span>,
97135
- as well as (commented out because in practice it makes no difference either way as far as I can
97136
- tell, and it would be hard to strictly implement since these ports might not yet be across the
97137
- thread boundary)--> the implicit <code>MessagePort</code> in the case of <span
97138
- data-x="DedicatedWorkerGlobalScope">dedicated workers</span>.</p>
97139
-
97140
- <p>Each <code>WorkerGlobalScope</code> also has a list of <dfn data-export="">the worker's
97141
- workers</dfn>. Initially this list is empty; it is populated when the worker creates or obtains
97142
- further workers.</p>
97143
-
97144
- <p>Finally, each <code>WorkerGlobalScope</code> also has a list of <dfn data-export="">the
97145
- worker's <code>Document</code>s</dfn>. Initially this list is empty; it is populated when the
97146
- worker is created.</p>
97147
-
97148
- <p>Whenever a <code>Document</code> <var>d</var> is <dfn data-x="add a document to the
97149
- worker's Documents">added to the worker's <code>Document</code>s</dfn>, the user agent must, for
97150
- each worker <var>q</var> in the list of <span>the worker's workers</span> whose list of
97151
- <span>the worker's <code>Document</code>s</span> does not contain <var>d</var>, <span
97152
- data-x="add a document to the worker's Documents">add <var>d</var> to <var>q</var>'s <code>WorkerGlobalScope</code> owner's list of <span>the worker's
97153
- <code>Document</code>s</span></span>.</p> <!-- suggestions welcome on making this sentence into
97154
- understandable English -->
97149
+ <var>worker global scope</var>. This list includes the implicit <code>MessagePort</code> in the
97150
+ case of <span data-x="DedicatedWorkerGlobalScope">dedicated workers</span>.</p>
97155
97151
97156
97152
<p>Whenever a <code>Document</code> object is <span data-x="discard a Document">discarded</span>,
97157
- it must be removed from the list of <span>the worker's <code>Document</code>s</span> of each
97158
- worker whose list contains that <code>Document</code>.</p>
97159
-
97160
- <p>Given an <span>environment settings object</span> <var>o</var> when creating or obtaining a
97161
- worker, the <dfn>list of relevant <code>Document</code> objects to add</dfn> depends on the type
97162
- of <span data-x="concept-settings-object-global">global object</span> specified by <var>o</var>.
97163
- If <var>o</var> specifies a <span data-x="concept-settings-object-global">global object</span>
97164
- that is a <code>WorkerGlobalScope</code> object (i.e. if we are creating a nested worker), then
97165
- the relevant <code>Document</code>s are the <span>the worker's <code>Document</code>s</span> of
97166
- the <span data-x="concept-settings-object-global">global object</span> specified by <var>o</var>.
97167
- Otherwise, <var>o</var> specifies a <span data-x="concept-settings-object-global">global
97168
- object</span> that is a <code>Window</code> object, and the relevant <code>Document</code> is just
97169
- the <span>responsible document</span> specified by <var>o</var>.</p>
97153
+ it must be <span data-x="list remove">removed</span> from the <span>owner set</span> of each
97154
+ <code>WorkerGlobalScope</code> object whose set <span data-x="list contains">contains</span> that
97155
+ <code>Document</code> object.</p>
97156
+
97157
+ <p id="list-of-relevant-document-objects-to-add">Given an <span>environment settings object</span>
97158
+ <var>o</var> when creating or obtaining a worker, the <dfn>relevant owner to add</dfn> depends on
97159
+ the type of <span data-x="concept-settings-object-global">global object</span> specified by
97160
+ <var>o</var>. If <var>o</var> specifies a <span data-x="concept-settings-object-global">global
97161
+ object</span> that is a <code>WorkerGlobalScope</code> object (i.e., if we are creating a nested
97162
+ worker), then the relevant owner is that global object. Otherwise, <var>o</var> specifies a <span
97163
+ data-x="concept-settings-object-global">global object</span> that is a <code>Window</code> object,
97164
+ and the relevant owner is the <span>responsible document</span> specified by <var>o</var>.</p>
97170
97165
97171
97166
<hr>
97172
97167
97173
- <p>A worker is said to be a <dfn>permissible worker</dfn> if its list of <span>the worker's
97174
- <code>Document</code>s</span> is not empty, or if its list has been empty for no more than a short
97175
- user-agent-defined timeout value, its <code>WorkerGlobalScope</code> is actually a
97176
- <code>SharedWorkerGlobalScope</code> object (i.e. the worker is a shared worker), and the user
97177
- agent has a <span>browsing context</span> whose <code>Document</code> is not <span>completely
97178
- loaded</span>.</p>
97168
+ <p>A worker is said to be a <dfn>permissible worker</dfn> if its <code>WorkerGlobalScope</code>'s
97169
+ <span>owner set</span> is not <span data-x="list is empty">empty</span> or:</p>
97170
+
97171
+ <ul class=brief>
97172
+ <li>its <span>owner set</span> has been <span data-x="list is empty">empty</span> for no more
97173
+ than a short user-agent-defined timeout value,</li>
97174
+ <li>its <code>WorkerGlobalScope</code> object is a <code>SharedWorkerGlobalScope</code> object
97175
+ (i.e., the worker is a shared worker), and</li>
97176
+ <li>the user agent has a <span>browsing context</span> whose <code>Document</code> object is not
97177
+ <span>completely loaded</span>.</li>
97178
+ </ul>
97179
97179
97180
97180
<p class="note">The second part of this definition allows a shared worker to survive for a short
97181
97181
time while a page is loading, in case that page is going to contact the shared worker again. This
97182
97182
can be used by user agents as a way to avoid the cost of restarting a shared worker used by a site
97183
97183
when the user is navigating from page to page within that site.</p>
97184
97184
97185
- <p>A worker is said to be an <dfn>active needed worker</dfn> if any of the <code>Document</code>
97186
- objects in <span>the worker's <code>Document</code>s</span> are <span>fully active</span>.</p>
97185
+ <p>A worker is said to be an <dfn>active needed worker</dfn> if any its <span data-x="owner
97186
+ set">owners</span> are either <code>Document</code> objects that are <span>fully active</span> or
97187
+ <span data-x="active needed worker">active needed workers</span>.</p>
97187
97188
97188
97189
<p>A worker is said to be a <dfn>protected worker</dfn> if it is an <span>active needed
97189
97190
worker</span> and either it has outstanding timers, database transactions, or network connections,
@@ -97219,15 +97220,13 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
97219
97220
<li><p>Let <var>is shared</var> be true if <var>worker</var> is a <code>SharedWorker</code>
97220
97221
object, and false otherwise.</p></li>
97221
97222
97222
- <li><p>Let <var>docs </var> be the <span>list of relevant <code>Document</code> objects to
97223
- add</span> given <var>outside settings</var>.</p></li>
97223
+ <li><p>Let <var>owner </var> be the <span>relevant owner to add</span> given <var>outside
97224
+ settings</var>.</p></li>
97224
97225
97225
97226
<li><p>Let <var>parent worker global scope</var> be null.</p>
97226
97227
97227
- <li><p>If <var>outside settings</var>'s <span data-x="concept-settings-object-global">global
97228
- object</span> is a <code>WorkerGlobalScope</code> object (i.e. we are creating a nested worker),
97229
- set <var>parent worker global scope</var> to <var>outside settings</var>'s <span
97230
- data-x="concept-settings-object-global">global object</span>.</p></li>
97228
+ <li><p>If <var>owner</var> is a <code>WorkerGlobalScope</code> object (i.e., we are creating a
97229
+ nested worker), then set <var>parent worker global scope</var> to <var>owner</var>.</p></li>
97231
97230
97232
97231
<li>
97233
97232
<p>Call the JavaScript <span
@@ -97334,13 +97333,12 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
97334
97333
97335
97334
<li><p><span>Entangle</span> <var>outside port</var> and <var>inside port</var>.</p></li>
97336
97335
97337
- <li><p><span data-x="add a document to the worker's Documents">Add to <var>worker global
97338
- scope</var>'s list of <span>the worker's <code>Document</code>s</span></span> the
97339
- <code>Document</code> objects in <var>docs</var>.</p></li>
97336
+ <li><p><span data-x="set append">Append</span> <var>owner</var> to <var>worker global
97337
+ scope</var>'s <span>owner set</span>.</p></li>
97340
97338
97341
- <li><p>If <var>parent worker global scope</var> is not null, add <var>worker global scope</var>
97342
- to the list of < span>the worker's workers</span> of <var>parent worker global
97343
- scope</var >.</p></li>
97339
+ <li><p>If <var>parent worker global scope</var> is not null, then <span data-x="set
97340
+ append">append</ span> <var> worker global scope</var> to <var>parent worker global scope</var>'s
97341
+ <span>worker set</span >.</p></li>
97344
97342
97345
97343
<li><p>Set <var>worker global scope</var>'s <span
97346
97344
data-x="concept-WorkerGlobalScope-type">type</span> to the value of the <code
@@ -97436,8 +97434,8 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
97436
97434
<li>
97437
97435
97438
97436
<!-- this has no normative impact but makes it clearer that the worker is irrelevant now, and
97439
- doesn't have to survive until its Documents all die off too --> <p>Empty the worker's list of
97440
- < span>the worker's <code>Document</code>s </span>.</p>
97437
+ doesn't have to survive until its Documents all die off too --> <p><span data-x=" list
97438
+ empty">Empty</ span> <var> worker global scope</var>'s <span>owner set </span>.</p>
97441
97439
97442
97440
</li>
97443
97441
@@ -97811,9 +97809,6 @@ enum <dfn>WorkerType</dfn> { "classic", "module" };
97811
97809
97812
97810
<li><p>Associate the <var>outside port</var> with <var>worker</var>.</p></li>
97813
97811
97814
- <li><p>Let <var>docs</var> be the <span>list of relevant <code>Document</code> objects to
97815
- add</span> given <var>outside settings</var>.</p></li>
97816
-
97817
97812
<li><p>Return <var>worker</var>, and run the following step <span>in parallel</span>.</p></li>
97818
97813
97819
97814
<li><p><span>Run a worker</span> given <var>worker</var>, <var>worker URL</var>, <var>outside
@@ -97962,15 +97957,15 @@ interface <dfn>SharedWorker</dfn> : <span>EventTarget</span> {
97962
97957
data-x="dom-MessageEvent-source">source</code> attribute initialized to <var>inside
97963
97958
port</var>.</p></li>
97964
97959
97965
- <li><p><span data-x="add a document to the worker's Documents">Add to <var>worker global
97966
- scope</var>'s list of <span>the worker's <code>Document</code>s</span></span> the
97967
- <span>list of relevant <code>Document</code> objects to add</span> given <var>outside
97968
- settings</var>.</p></li>
97960
+ <li><p><span data-x="set append">Append</span> the <span>relevant owner to add</span> given
97961
+ <var>outside settings</var> to <var>worker global scope</var>'s <span>owner
97962
+ set</span>.</p></li>
97969
97963
97970
97964
<li><p>If <var>outside settings</var>'s <span data-x="concept-settings-object-global">global
97971
- object</span> is a <code>WorkerGlobalScope</code> object, add <var>worker global scope</var>
97972
- to the list of <span>the worker's workers</span> of <var>outside settings</var>'s <span
97973
- data-x="concept-settings-object-global">global object</span>.</p></li>
97965
+ object</span> is a <code>WorkerGlobalScope</code> object, then <span data-x="set
97966
+ append">append</span> <var>worker global scope</var> to <var>outside settings</var>'s <span
97967
+ data-x="concept-settings-object-global">global object</span>'s <span>worker
97968
+ set</span>.</p></li>
97974
97969
</ol>
97975
97970
</li>
97976
97971
0 commit comments