Skip to content

Commit

Permalink
Fix calls to InitializeHostDefinedRealm
Browse files Browse the repository at this point in the history
Fixes #3784.
  • Loading branch information
TimothyGu authored and domenic committed Jul 28, 2018
1 parent db6d0df commit 39c948b
Showing 1 changed file with 38 additions and 53 deletions.
91 changes: 38 additions & 53 deletions source
Expand Up @@ -76871,27 +76871,17 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<li><p>Let <var>browsingContext</var> be a new <span>browsing context</span>.</p></li>

<li>
<p>Call the JavaScript <span
data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract operation
with the following customizations:</p>
<p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
realm</span> with the following customizations:</p>

<ul>
<li><p>For the global object, create a new <code>Window</code> object
<var>window</var>.</p></li>
<li><p>For the global object, create a new <code>Window</code> object.</p></li>

<li><p>For the global <b>this</b> value, use <var>browsingContext</var>'s
<li><p>For the global <b>this</b> binding, use <var>browsingContext</var>'s
<code>WindowProxy</code> object.</li>
</ul>
</li>

<li>
<p>Let <var>realm execution context</var> be the <span>running JavaScript execution
context</span>.</p>

<p class="note">This is the <span>JavaScript execution context</span> created in the previous
step.</p>
</li>

<li><p><span>Set up a window environment settings object</span> with <var>realm execution
context</var>, and let <var>settingsObject</var> be the result.</p></li>

Expand Down Expand Up @@ -82246,26 +82236,17 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface

<ol>
<li>
<p>Call the JavaScript <span
data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract operation
with the following customizations:</p>
<p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
realm</span> with the following customizations:</p>

<ul>
<li><p>For the global object, create a new <code>Window</code> object.</p></li>

<li><p>For the global <b>this</b> value, use <var>browsingContext</var>'s
<li><p>For the global <b>this</b> binding, use <var>browsingContext</var>'s
<code>WindowProxy</code> object.</p></li>
</ul>
</li>

<li>
<p>Let <var>realm execution context</var> be the <span>running JavaScript execution
context</span>.</p>

<p class="note">This is the <span>JavaScript execution context</span> created in the previous
step.</p>
</li>

<li><p><span>Set up a window environment settings object</span> with <var>realm execution
context</var> and <var>reservedEnvironment</var>, if present.</p></li>
</ol>
Expand Down Expand Up @@ -87447,7 +87428,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
field of a <span>JavaScript realm</span>.</p>

<p class="note">In this specification, all <span data-x="JavaScript realm">JavaScript
realms</span> are <span data-x="js-InitializeHostDefinedRealm">initialized</span> with <span
realms</span> are <span data-x="creating a new JavaScript realm">created</span> with <span
data-x="global object">global objects</span> that are either <code>Window</code> or
<code>WorkerGlobalScope</code> objects.</p>

Expand All @@ -87465,7 +87446,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
Realm's global object</dfn>.</p></li>

<li><p>Each <span>global object</span> in this specification is created during the <span
data-x="js-InitializeHostDefinedRealm">initialization</span> of a corresponding <span>JavaScript
data-x="creating a new JavaScript realm">creation</span> of a corresponding <span>JavaScript
realm</span>, known as <dfn data-x="concept-global-object-realm" data-export="" data-lt="Realm"
data-dfn-for="global object">the global object's Realm</dfn>.</p></li>

Expand All @@ -87484,6 +87465,29 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
settings object">the environment settings object's global object</dfn>.</p></li>
</ul>

<p>To <dfn data-x="creating a new JavaScript realm">create a new JavaScript realm</dfn>,
optionally with instructions to create a global object or a global <b>this</b> binding (or both),
the following steps are taken:</p>

<ol>
<li><p>Perform <span data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm</span>()
with the provided customizations for creating the global object and the global <b>this</b>
binding.</p></li>

<li>
<p>Let <var>realm execution context</var> be the <span>running JavaScript execution
context</span>.</p>

<p class="note">This is the <span>JavaScript execution context</span> created in the previous
step.</p>
</li>

<li><p>Remove <var>realm execution context</var> from the <span>JavaScript execution context
stack</span>.</p></li>

<li><p>Return <var>realm execution context</var>.</p></li>
</ol>

<hr>

<p>When defining algorithm steps throughout this specification, it is often important to indicate
Expand Down Expand Up @@ -90623,30 +90627,21 @@ document.body.appendChild(frame)</code></pre>
<var>document</var>, without firing any mutation events.</p></li>

<li>
<p>Call the JavaScript <span
data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract operation
with the following customizations:</p>
<p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
realm</span> with the following customizations:</p>

<ul>
<li><p>For the global object, create a new <code>Window</code> object
<var>window</var>.</p></li>

<li><p>For the global <b>this</b> value, use <var>document</var>'s <span>browsing
<li><p>For the global <b>this</b> binding, use <var>document</var>'s <span>browsing
context</span>'s associated <code>WindowProxy</code>.</p></li>
</ul>

<p class="&#x0058;&#x0058;&#x0058;">This is not universally implemented and can perhaps be
removed; see <a href="https://github.com/whatwg/html/issues/1698">issue #1698</a>.</p>
</li>

<li>
<p>Let <var>realm execution context</var> be the <span>running JavaScript execution
context</span>.</p>

<p class="note">This is the <span>JavaScript execution context</span> created in the previous
step.</p>
</li>

<li><p><span>Set up a window environment settings object</span> with <var>realm execution
context</var>.</p></li>

Expand Down Expand Up @@ -97157,9 +97152,8 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
nested worker), then set <var>parent worker global scope</var> to <var>owner</var>.</p></li>

<li>
<p>Call the JavaScript <span
data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract
operation with the following customizations:</p>
<p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
realm</span> with the following customizations:</p>

<ul>
<li><p>For the global object, if <var>is shared</var> is true, create a new
Expand All @@ -97168,21 +97162,12 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
</ul>
</li>

<li>
<p>Let <var>realm execution context</var> be the <span>running JavaScript execution
context</span>.</p>

<p class="note">This is the <span>JavaScript execution context</span> created in the previous
step.</p>
</li>

<li>
<p>Let <var>worker global scope</var> be the <span data-x="concept-realm-global">global
object</span> of <var>realm execution context</var>'s Realm component.

<p class="note">This is the <code>DedicatedWorkerGlobalScope</code> or
<code>SharedWorkerGlobalScope</code> object created when calling <span
data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm</span>.</p>
<code>SharedWorkerGlobalScope</code> object created in the previous step.</p>
</li>

<li><p><span>Set up a worker environment settings object</span> with <var>realm execution
Expand Down

0 comments on commit 39c948b

Please sign in to comment.