Skip to content

Commit 55b4dbb

Browse files
authored
Ground primitives in agents
Using "unit of related similar-origin browsing contexts" never made much sense as a browsing context could always hold several cross-site documents. This also changes the structures these agents hold from lists to (ordered) sets as that's more accurate and precise. Helps with whatwg/html#4198. Fixes #88.
1 parent f97b360 commit 55b4dbb

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

dom.bs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ type: interface
3030
text: WebGLContextEvent
3131
urlPrefix: https://tc39.github.io/ecma262/#; spec: ECMASCRIPT
3232
text: Construct; url: sec-construct; type: abstract-op
33-
text: Realm; url: realm; type: dfn
33+
type: dfn
34+
text: Realm; url: realm
35+
text: surrounding agent; url: surrounding-agent
3436
urlPrefix: https://w3c.github.io/hr-time/#; spec: HR-TIME
3537
type:typedef; urlPrefix: dom-; text: DOMHighResTimeStamp
3638
type:dfn; text: time origin; url: dfn-time-origin
@@ -2273,16 +2275,14 @@ steps:
22732275

22742276
<h5 id=signaling-slot-change>Signaling slot change</h5>
22752277

2276-
<p>Each <a>unit of related similar-origin browsing contexts</a> has a
2277-
<dfn export>signal slot list</dfn> (a list of <a>slots</a>). Unless stated otherwise it is empty.
2278-
[[!HTML]]
2278+
<p>Each <a>similar-origin window agent</a> has <dfn noexport id=signal-slot-list>signal slots</dfn>
2279+
(a <a for=/>set</a> of <a>slots</a>), which is initially empty. [[!HTML]]
22792280

22802281
<p>To <dfn noexport>signal a slot change</dfn>, for a <a>slot</a> <var>slot</var>, run these steps:
22812282

22822283
<ol>
2283-
<li><p>If <var>slot</var> is not in <a>unit of related similar-origin browsing contexts</a>'
2284-
<a>signal slot list</a>, append <var>slot</var> to
2285-
<a>unit of related similar-origin browsing contexts</a>' <a>signal slot list</a>.
2284+
<li><p><a for=set>Append</a> <var>slot</var> to <var>slot</var>'s <a>relevant agent</a>'s
2285+
<a>signal slots</a>.
22862286

22872287
<li><p><a>Queue a mutation observer compound microtask</a>.
22882288
</ol>
@@ -3256,13 +3256,13 @@ invoked, must run these steps:
32563256

32573257
<h3 id=mutation-observers>Mutation observers</h3>
32583258

3259-
<p>Each <a>unit of related similar-origin browsing contexts</a> has a
3259+
<p>Each <a>similar-origin window agent</a> has a
32603260
<dfn noexport>mutation observer compound microtask queued flag</dfn>, which is initially unset.
32613261
[[!HTML]]
32623262

3263-
<p>Each <a>unit of related similar-origin browsing contexts</a> also has a
3264-
<dfn noexport>mutation observer list</dfn> (a <a for=/>list</a> of zero or more {{MutationObserver}}
3265-
objects), which is initially empty.
3263+
<p>Each <a>similar-origin window agent</a> also has
3264+
<dfn noexport id=mutation-observer-list>mutation observers</dfn> (a <a for=/>set</a> of zero or more
3265+
{{MutationObserver}} objects), which is initially empty.
32663266

32673267
<p>To <dfn export>queue a mutation observer compound microtask</dfn>, run these steps:
32683268

@@ -3280,17 +3280,16 @@ objects), which is initially empty.
32803280
<ol>
32813281
<li><p>Unset <a>mutation observer compound microtask queued flag</a>.
32823282

3283-
<li><p>Let <var>notifyList</var> be a <a for=list>clone</a> of
3284-
<a>unit of related similar-origin browsing contexts</a>' <a>mutation observer list</a>.
3283+
<li><p>Let <var>notifySet</var> be a <a for=set>clone</a> of the <a>surrounding agent</a>'s
3284+
<a>mutation observers</a>.
32853285

3286-
<li><p>Let <var>signalList</var> be a <a for=list>clone</a> of
3287-
<a>unit of related similar-origin browsing contexts</a>' <a>signal slot list</a>.
3286+
<li><p>Let <var>signalSet</var> be a <a for=set>clone</a> of the <a>surrounding agent</a>'s
3287+
<a>signal slots</a>.
32883288

3289-
<li><p><a for=list>Empty</a> <a>unit of related similar-origin browsing contexts</a>'
3290-
<a>signal slot list</a>.
3289+
<li><p><a for=set>Empty</a> the <a>surrounding agent</a>'s <a>signal slots</a>.
32913290

32923291
<li>
3293-
<p><a for=list>For each</a> <var>mo</var> of <var>notifyList</var>,
3292+
<p><a for=set>For each</a> <var>mo</var> of <var>notifySet</var>,
32943293
<a>execute a compound microtask subtask</a> to run these steps: [[!HTML]]
32953294

32963295
<ol>
@@ -3309,7 +3308,7 @@ objects), which is initially empty.
33093308
and <var>mo</var>. If this throws an exception, then <a>report the exception</a>.
33103309
</ol>
33113310

3312-
<li><p><a for=list>For each</a> <var>slot</var> of <var>signalList</var>, <a>fire an event</a>
3311+
<li><p><a for=set>For each</a> <var>slot</var> of <var>signalSet</var>, <a>fire an event</a>
33133312
named <code>slotchange</code>, with its {{Event/bubbles}} attribute set to true, at
33143313
<var>slot</var>.
33153314
</ol>
@@ -3451,8 +3450,8 @@ constructor, when invoked, must run these steps:
34513450
<li><p>Let <var>mo</var> be a new {{MutationObserver}} object whose
34523451
<a for=MutationObserver>callback</a> is <var>callback</var>.
34533452

3454-
<li><p><a for=list>Append</a> <var>mo</var> to
3455-
<a>unit of related similar-origin browsing contexts</a>' <a>mutation observer list</a>.
3453+
<li><p><a for=set>Append</a> <var>mo</var> to <var>mo</var>'s <a>relevant agent</a>'s
3454+
<a>mutation observers</a>.
34563455

34573456
<li><p>Return <var>mo</var>.
34583457
</ol>

0 commit comments

Comments
 (0)