@@ -2855,6 +2855,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2855
2855
2856
2856
<ul class="brief">
2857
2857
<li><dfn data-x-href="https://tc39.github.io/ecma262/#active-function-object">active function object</dfn></li>
2858
+ <li><dfn data-x-href="https://tc39.github.io/ecma262/#sec-agents">agent</dfn> and
2859
+ <dfn data-x-href="https://tc39.github.io/ecma262/#sec-agent-clusters">agent cluster</dfn></li>
2858
2860
<li><dfn data-x-href="https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion">automatic semicolon insertion</dfn></li>
2859
2861
<li>The <dfn data-x-href="https://tc39.github.io/ecma262/#current-realm">current Realm Record</dfn></li>
2860
2862
<li><dfn data-x-href="https://tc39.github.io/ecma262/#early-error-rule">early error</dfn></li>
@@ -2936,6 +2938,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2936
2938
<li>The <dfn data-x="js-abstract-equality" data-x-href="https://tc39.github.io/ecma262/#sec-abstract-equality-comparison">Abstract Equality Comparison</dfn> algorithm</li>
2937
2939
<li>The <dfn data-x="js-strict-equality" data-x-href="https://tc39.github.io/ecma262/#sec-strict-equality-comparison">Strict Equality Comparison</dfn> algorithm</li>
2938
2940
<li>The <dfn data-x-href="https://tc39.github.io/ecma262/#sec-date-objects"><code>Date</code></dfn> class</li>
2941
+ <li>The <dfn data-x-href="https://tc39.github.io/ecma262/#sec-sharedarraybuffer-objects"><code>SharedArrayBuffer</code></dfn> class</li>
2939
2942
<li>The <dfn data-x-href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror"><code>TypeError</code></dfn> class</li>
2940
2943
<li>The <dfn data-x="js-RangeError" data-x-href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-rangeerror"><code>RangeError</code></dfn> class</li>
2941
2944
<li>The <dfn data-x="js-typeof" data-x-href="https://tc39.github.io/ecma262/#sec-typeof-operator"><code>typeof</code></dfn> operator</li>
@@ -3780,6 +3783,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
3780
3783
<li><dfn data-x-href="https://w3c.github.io/ServiceWorker/#dfn-serviceworker-link">serviceworker link</dfn></li>
3781
3784
<li><dfn data-x-href="https://w3c.github.io/ServiceWorker/#serviceworker"><code>ServiceWorker</code></dfn> interface</li>
3782
3785
<li><dfn data-x-href="https://w3c.github.io/ServiceWorker/#serviceworkercontainer"><code>ServiceWorkerContainer</code></dfn> interface</li>
3786
+ <li><dfn data-x-href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope"><code>ServiceWorkerGlobalScope</code></dfn> interface</li>
3783
3787
<li><dfn data-x-href="https://w3c.github.io/ServiceWorker/#dfn-use-cache">use cache</dfn></li>
3784
3788
</ul>
3785
3789
@@ -3905,6 +3909,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
3905
3909
</ul>
3906
3910
</dd>
3907
3911
3912
+ <dt>Worklets</dt>
3913
+
3914
+ <dd>
3915
+ <p>The following feature is defined in the <cite>Worklets</cite> specification: <ref
3916
+ spec=WORKLETS></p>
3917
+
3918
+ <ul class="brief">
3919
+ <li><dfn data-x-href="https://drafts.css-houdini.org/worklets/#workletglobalscope"><code>WorkletGlobalScope</code></dfn></li>
3920
+ </ul>
3921
+ </dd>
3922
+
3908
3923
</dl>
3909
3924
3910
3925
<hr>
@@ -88419,6 +88434,139 @@ import "https://example.com/foo/../module2.js";</pre>
88419
88434
data-x="concept-module-script-module-record">module record</span>.</p></li>
88420
88435
</ol>
88421
88436
88437
+ <h5>Integration with the JavaScript agent formalism</h5>
88438
+
88439
+ <p>JavaScript defines the concept of an <span>agent</span>. Until such a time that this standard
88440
+ has a better handle on lifetimes, we define five types of <span data-x="agent">agents</span> that
88441
+ user agents must allocate at the appropriate time.</p>
88442
+
88443
+ <p class="note">In the future, when this specification has a better handle on lifetimes, we hope
88444
+ to define exactly when <span data-x="agent">agents</span> and <span data-x="agent cluster">agent
88445
+ clusters</span> are created.</p>
88446
+
88447
+ <dl>
88448
+ <dt><dfn data-export="">Similar-origin window agent</dfn></dt>
88449
+ <dd>
88450
+ <p>An <span>agent</span> whose [[CanBlock]] is false and whose set of <span
88451
+ data-x="JavaScript realm">realms</span> consists of all <span
88452
+ data-x="concept-global-object-realm">realms</span> of <code>Window</code> objects whose
88453
+ <span>relevant settings object</span>'s <span>responsible browsing context</span> is in the same
88454
+ <span>unit of related similar-origin browsing contexts</span>.</p>
88455
+
88456
+ <p class="note">Two <code>Window</code> objects that are <span>same origin</span> can be in
88457
+ different <span data-x="similar-origin window agent">similar-origin window agents</span>, for
88458
+ instance iif they are each in their own <span>top-level browsing context</span>.</p>
88459
+ </dd>
88460
+
88461
+ <dt><dfn data-export="">Dedicated worker agent</dfn></dt>
88462
+ <dd><p>An <span>agent</span> whose [[CanBlock]] is true and whose set of <span data-x="JavaScript
88463
+ realm">realms</span> consists of a single <code>DedicatedWorkerGlobalScope</code> object's <span
88464
+ data-x="concept-global-object-realm">Realm</span>.</p></dd>
88465
+
88466
+ <dt><dfn data-export="">Shared worker agent</dfn></dt>
88467
+ <dd><p>An <span>agent</span> whose [[CanBlock]] is true and whose set of <span data-x="JavaScript
88468
+ realm">realms</span> consists a single <code>SharedWorkerGlobalScope</code> object's <span
88469
+ data-x="concept-global-object-realm">Realm</span>.</p></dd>
88470
+
88471
+ <dt><dfn data-export="">Service worker agent</dfn></dt>
88472
+ <dd><p>An <span>agent</span> whose [[CanBlock]] is false and whose set of <span data-x="JavaScript
88473
+ realm">realms</span> consists of a single <code>ServiceWorkerGlobalScope</code> object's <span
88474
+ data-x="concept-global-object-realm">Realm</span>.</p></dd>
88475
+
88476
+ <dt><dfn data-export="">Worklet agent</dfn></dt>
88477
+ <dd>
88478
+ <p>An <span>agent</span> whose [[CanBlock]] is false and whose set of <span
88479
+ data-x="JavaScript realm">realms</span> consists of a single <code>WorkletGlobalScope</code>
88480
+ object's <span data-x="concept-global-object-realm">Realm</span>.</p>
88481
+
88482
+ <p class="note">While conceptually it might be cleaner for worklets that end up with multiple
88483
+ realms to put all those in the same agent, it is not observable in practice.</p>
88484
+ </dd>
88485
+ </dl>
88486
+
88487
+ <p>For convenience in what follows, for all <span data-x="agent">agents</span> that are not <span
88488
+ data-x="similar-origin window agent">similar-origin window agents</span>, we define <dfn
88489
+ data-x="concept-agent-realm">the agent's realm</dfn> to be the single <span data-x="JavaScript
88490
+ realm">realm</span> in its set of realms, and <dfn data-x="concept-agent-global">the agent's
88491
+ global object</dfn> to be <span data-x="concept-agent-realm">the agent's realm</span>'s <span
88492
+ data-x="concept-realm-global">global object</span>.</p>
88493
+
88494
+ <p>To determine the manifestation of JavaScript's <span>agent cluster</span> concept in user
88495
+ agents, we first define an <dfn>agent subcluster</dfn> for a given <span>agent</span>
88496
+ <var>agent</var>, based on its type:</p>
88497
+
88498
+ <dl class="switch">
88499
+ <dt><span>Similar-origin window agent</span></dt>
88500
+ <dd><p>The set containing <var>agent</var> and any <span>dedicated worker agent</span> whose
88501
+ <span data-x="concept-agent-global">global object</span>'s <span>owner set</span> contains a
88502
+ <code>Document</code> object whose <span data-x="concept-relevant-realm">relevant Realm</span>
88503
+ belongs to <var>agent</var>.</p></dd>
88504
+
88505
+ <dt><span>Dedicated worker agent</span></dt>
88506
+ <dd>
88507
+ <p>The set containing:
88508
+
88509
+ <ul>
88510
+ <li><var>agent</var>,</li>
88511
+ <li>any <span>agent</span> with a <span data-x="JavaScript realm">realm</span> whose <span
88512
+ data-x="concept-realm-global">global object</span> is in <var>agent</var>'s <span
88513
+ data-x="concept-agent-global">global object</span>'s <span>owner set</span>, and</li>
88514
+ <li>any <span>dedicated worker agent</span> whose <span data-x="concept-agent-global">global
88515
+ object</span> is in <var>agent</var>'s <span data-x="concept-agent-global">global
88516
+ object</span>'s <span>worker set</span>.
88517
+ </ul>
88518
+ </dd>
88519
+
88520
+ <dt><span>Worklet agent</span></dt>
88521
+ <dd><p class="XXX">Currently worklets have no clearly defined owner, see: <a
88522
+ href="https://github.com/w3c/css-houdini-drafts/issues/224">w3c/css-houdini-drafts issue
88523
+ #224</a>.</p></dd>
88524
+
88525
+ <dt><span>Shared worker agent</span></dt>
88526
+ <dt><span>Service worker agent</span></dt>
88527
+ <dd><p>The set containing <var>agent</var> and any <span>dedicated worker agent</span> whose
88528
+ <span data-x="concept-agent-global">global object</span> is in <var>agent</var>'s <span
88529
+ data-x="concept-agent-global">global object</span>'s <span>worker set</span>.</p></dd>
88530
+ </dl>
88531
+
88532
+ <p>Then, the transitive closure of <span data-x="agent subcluster">agent subclusters</span> is an
88533
+ <span>agent cluster</span>.</p>
88534
+
88535
+ <p class="note">The <span>agent cluster</span> concept is crucial for defining the JavaScript
88536
+ memory model, and in particular among which <span data-x="agent">agents</span> the backing data of
88537
+ <code>SharedArrayBuffer</code> objects can be shared.</p>
88538
+
88539
+ <div class="example">
88540
+ <p>The following pairs of global objects are each within the same <span>agent cluster</span>, and
88541
+ thus can use <code>SharedArrayBuffer</code> instances to share memory with each other:</p>
88542
+
88543
+ <ul class="brief">
88544
+ <li>A <code>Window</code> and a dedicated worker that it created</li>
88545
+
88546
+ <li>A worker (of any type) and a dedicated worker it creates</li>
88547
+
88548
+ <li>A <code>Window</code> and the <code>Window</code> of an <code>iframe</code> element that
88549
+ could be <span>same origin-domain</span></li>
88550
+
88551
+ <li>A <code>Window</code> and the <code>Window</code> that opened it</li>
88552
+ </ul>
88553
+
88554
+ <p>The following pairs of global objects are <em>not</em> within the same <span>agent
88555
+ cluster</span>, and thus cannot share memory:</p>
88556
+
88557
+ <ul class="brief">
88558
+ <li>A <code>Window</code> and a shared worker it creates</li>
88559
+
88560
+ <li>A worker (of any type) and a shared worker it creates</li>
88561
+
88562
+ <li>A <code>Window</code> and a service worker it creates</li>
88563
+
88564
+ <li>A <code>Window</code> and the <code>Window</code> of an <code>iframe</code> element that
88565
+ cannot be <span>same origin-domain</span></li>
88566
+ </ul>
88567
+
88568
+ </div>
88569
+
88422
88570
</div>
88423
88571
88424
88572
@@ -119747,6 +119895,9 @@ INSERT INTERFACES HERE
119747
119895
<dt id="refsWHATWGWIKI">[WHATWGWIKI]</dt>
119748
119896
<dd><cite><a href="https://wiki.whatwg.org/">The WHATWG Wiki</a></cite>. WHATWG.</dd>
119749
119897
119898
+ <dt id="refsWORKLETS">[WORKLETS]</dt>
119899
+ <dd><cite><a href="https://drafts.css-houdini.org/worklets/">Worklets</a></cite>. I. Kilpatrick. W3C.</dd>
119900
+
119750
119901
<dt id="refsWSP">[WSP]</dt>
119751
119902
<dd><cite><a href="https://tools.ietf.org/html/rfc6455">The WebSocket protocol</a></cite>, I. Fette, A. Melnikov. IETF.</dd>
119752
119903
0 commit comments