@@ -1634,21 +1634,26 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
1634
1634
<p>The following solution suffers from race conditions:</p>
1635
1635
1636
1636
<ol>
1637
- <li><p>Let <var>p</var> be a new promise.</p></li>
1637
+ <li><p>Let <var>p</var> be a new promise created in <span>this</span>'s <span
1638
+ data-x="concept-relevant-realm">relevant realm</span>.</p></li>
1638
1639
1639
1640
<li>
1640
1641
<p>Run the following steps <span>in parallel</span>:</p>
1641
1642
1642
1643
<ol>
1643
1644
<li><p>If <var>nameList</var> <span data-x="list contains">contains</span> <var>name</var>,
1644
- reject <var>p</var> with a <code>TypeError</code> and abort these steps.</p></li>
1645
+ then <span>queue a global task</span> on the <span>DOM manipulation task source</span> given
1646
+ <span>this</span>'s <span>relevant global object</span> to reject <var>p</var> with a
1647
+ <code>TypeError</code>, and abort these steps.</p></li>
1645
1648
1646
1649
<li><p>Do some potentially lengthy work.</p></li>
1647
1650
1648
1651
<li><p><span data-x="list append">Append</span> <var>name</var> to
1649
1652
<var>nameList</var>.</p></li>
1650
1653
1651
- <li><p>Resolve <var>p</var> with undefined.</p></li>
1654
+ <li><p><span>Queue a global task</span> on the <span>DOM manipulation task source</span>
1655
+ given <span>this</span>'s <span>relevant global object</span> to resolve <var>p</var> with
1656
+ undefined.</p></li>
1652
1657
</ol>
1653
1658
</li>
1654
1659
@@ -1663,21 +1668,26 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
1663
1668
<span>starting a new parallel queue</span>, then:</p>
1664
1669
1665
1670
<ol>
1666
- <li><p>Let <var>p</var> be a new promise.</p></li>
1671
+ <li><p>Let <var>p</var> be a new promise created in <span>this</span>'s <span
1672
+ data-x="concept-relevant-realm">relevant realm</span>.</p></li>
1667
1673
1668
1674
<li>
1669
1675
<p><mark><span>Enqueue the following steps</span> to <var>nameListQueue</var>:</mark></p>
1670
1676
1671
1677
<ol>
1672
1678
<li><p>If <var>nameList</var> <span data-x="list contains">contains</span> <var>name</var>,
1673
- reject <var>p</var> with a <code>TypeError</code> and abort these steps.</p></li>
1679
+ then <span>queue a global task</span> on the <span>DOM manipulation task source</span> given
1680
+ <span>this</span>'s <span>relevant global object</span> to reject <var>p</var> with a
1681
+ <code>TypeError</code>, and abort these steps.</p></li>
1674
1682
1675
1683
<li><p>Do some potentially lengthy work.</p></li>
1676
1684
1677
1685
<li><p><span data-x="list append">Append</span> <var>name</var> to
1678
1686
<var>nameList</var>.</p></li>
1679
1687
1680
- <li><p>Resolve <var>p</var> with undefined.</p></li>
1688
+ <li><p><span>Queue a global task</span> on the <span>DOM manipulation task source</span>
1689
+ given <span>this</span>'s <span>relevant global object</span> resolve <var>p</var> with
1690
+ undefined.</p></li>
1681
1691
</ol>
1682
1692
</li>
1683
1693
0 commit comments