Skip to content

Commit e9ffffd

Browse files
authored
Assign correct realm to re-used objects. (#400)
1 parent 3959bf9 commit e9ffffd

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

index.html

+22-6
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,14 @@ <h2>
385385
"https://www.w3.org/TR/html51/browsers.html#list-of-the-descendant-browsing-contexts">
386386
list of descendant browsing contexts</a></dfn>, and <dfn><a href=
387387
"https://www.w3.org/TR/html51/browsers.html#creating-a-new-browsing-context">
388-
creating a new browsing context</a></dfn> are defined in [[!HTML51]].
388+
creating a new browsing context</a></dfn>, and <dfn><a href=
389+
"https://www.w3.org/TR/html51/webappapis.html#current">current
390+
realm</a></dfn> are defined by [[!HTML51]].
391+
</p>
392+
<p>
393+
The term <dfn><a href=
394+
"https://tc39.github.io/ecma262/#sec-code-realms">JavaScript
395+
realm</a></dfn> is defined in [[!ECMASCRIPT]].
389396
</p>
390397
<p>
391398
The terms <dfn><code><a href=
@@ -900,6 +907,10 @@ <h3>
900907
The <a>task source</a> for the tasks mentioned in this specification
901908
is the <dfn>presentation task source</dfn>.
902909
</p>
910+
<p>
911+
Unless otherwise specified, the <a>JavaScript realm</a> for script
912+
objects constructed by algorithm steps is the <a>current realm</a>.
913+
</p>
903914
</section>
904915
<section>
905916
<h3>
@@ -1663,7 +1674,8 @@ <h4>
16631674
<code>presentationRequest</code>, return that <a>Promise</a> and
16641675
abort these steps.
16651676
</li>
1666-
<li>Otherwise, let <var>P</var> be a new <a>Promise</a>.
1677+
<li>Otherwise, let <var>P</var> be a new <a>Promise</a> constructed
1678+
in the <a>JavaScript realm</a> of <var>presentationRequest</var>.
16671679
</li>
16681680
<li>Return <var>P</var>, but continue running these steps <a>in
16691681
parallel</a>.
@@ -1694,8 +1706,9 @@ <h4>
16941706
</li>
16951707
<li>Set the <a>presentation display availability</a> for
16961708
<var>presentationRequest</var> to a newly created
1697-
<a>PresentationAvailability</a> object, and let <var>A</var> be
1698-
that object.
1709+
<a>PresentationAvailability</a> object constructed in the
1710+
<a>JavaScript realm</a> of <var>presentationRequest</var>, and let
1711+
<var>A</var> be that object.
16991712
</li>
17001713
<li>Create a tuple <em>(<var>A</var>,
17011714
<var>presentationUrls</var>)</em> and add it to the <a>set of
@@ -2670,7 +2683,8 @@ <h3>
26702683
and abort all remaining steps.
26712684
</li>
26722685
<li>Otherwise, let the <a>presentation controllers promise</a> be a
2673-
new <a>Promise</a>.
2686+
new <a>Promise</a> constructed in the <a>JavaScript realm</a> of this
2687+
<a>PresentationReceiver</a> object.
26742688
</li>
26752689
<li>Return the <a>presentation controllers promise</a>.
26762690
</li>
@@ -2880,7 +2894,9 @@ <h4>
28802894
<code>null</code>, run the following steps <a>in parallel</a>.
28812895
<ol>
28822896
<li>Let the <a>presentation controllers monitor</a> be a new
2883-
<a>PresentationConnectionList</a>.
2897+
<a>PresentationConnectionList</a> constructed in the
2898+
<a>JavaScript realm</a> of the <a>PresentationReceiver</a>
2899+
object of the <a>receiving browsing context</a>.
28842900
</li>
28852901
<li>Populate the <a>presentation controllers monitor</a> with
28862902
the <a>set of presentation controllers</a>.

0 commit comments

Comments
 (0)