@@ -76871,27 +76871,17 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
7687176871 <li><p>Let <var>browsingContext</var> be a new <span>browsing context</span>.</p></li>
7687276872
7687376873 <li>
76874- <p>Call the JavaScript <span
76875- data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract operation
76876- with the following customizations:</p>
76874+ <p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
76875+ realm</span> with the following customizations:</p>
7687776876
7687876877 <ul>
76879- <li><p>For the global object, create a new <code>Window</code> object
76880- <var>window</var>.</p></li>
76878+ <li><p>For the global object, create a new <code>Window</code> object.</p></li>
7688176879
76882- <li><p>For the global <b>this</b> value , use <var>browsingContext</var>'s
76880+ <li><p>For the global <b>this</b> binding , use <var>browsingContext</var>'s
7688376881 <code>WindowProxy</code> object.</li>
7688476882 </ul>
7688576883 </li>
7688676884
76887- <li>
76888- <p>Let <var>realm execution context</var> be the <span>running JavaScript execution
76889- context</span>.</p>
76890-
76891- <p class="note">This is the <span>JavaScript execution context</span> created in the previous
76892- step.</p>
76893- </li>
76894-
7689576885 <li><p><span>Set up a window environment settings object</span> with <var>realm execution
7689676886 context</var>, and let <var>settingsObject</var> be the result.</p></li>
7689776887
@@ -82246,26 +82236,17 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
8224682236
8224782237 <ol>
8224882238 <li>
82249- <p>Call the JavaScript <span
82250- data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract operation
82251- with the following customizations:</p>
82239+ <p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
82240+ realm</span> with the following customizations:</p>
8225282241
8225382242 <ul>
8225482243 <li><p>For the global object, create a new <code>Window</code> object.</p></li>
8225582244
82256- <li><p>For the global <b>this</b> value , use <var>browsingContext</var>'s
82245+ <li><p>For the global <b>this</b> binding , use <var>browsingContext</var>'s
8225782246 <code>WindowProxy</code> object.</p></li>
8225882247 </ul>
8225982248 </li>
8226082249
82261- <li>
82262- <p>Let <var>realm execution context</var> be the <span>running JavaScript execution
82263- context</span>.</p>
82264-
82265- <p class="note">This is the <span>JavaScript execution context</span> created in the previous
82266- step.</p>
82267- </li>
82268-
8226982250 <li><p><span>Set up a window environment settings object</span> with <var>realm execution
8227082251 context</var> and <var>reservedEnvironment</var>, if present.</p></li>
8227182252 </ol>
@@ -87447,7 +87428,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
8744787428 field of a <span>JavaScript realm</span>.</p>
8744887429
8744987430 <p class="note">In this specification, all <span data-x="JavaScript realm">JavaScript
87450- realms</span> are <span data-x="js-InitializeHostDefinedRealm">initialized </span> with <span
87431+ realms</span> are <span data-x="creating a new JavaScript realm">created </span> with <span
8745187432 data-x="global object">global objects</span> that are either <code>Window</code> or
8745287433 <code>WorkerGlobalScope</code> objects.</p>
8745387434
@@ -87465,7 +87446,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
8746587446 Realm's global object</dfn>.</p></li>
8746687447
8746787448 <li><p>Each <span>global object</span> in this specification is created during the <span
87468- data-x="js-InitializeHostDefinedRealm">initialization </span> of a corresponding <span>JavaScript
87449+ data-x="creating a new JavaScript realm">creation </span> of a corresponding <span>JavaScript
8746987450 realm</span>, known as <dfn data-x="concept-global-object-realm" data-export="" data-lt="Realm"
8747087451 data-dfn-for="global object">the global object's Realm</dfn>.</p></li>
8747187452
@@ -87484,6 +87465,29 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
8748487465 settings object">the environment settings object's global object</dfn>.</p></li>
8748587466 </ul>
8748687467
87468+ <p>To <dfn data-x="creating a new JavaScript realm">create a new JavaScript realm</dfn>,
87469+ optionally with instructions to create a global object or a global <b>this</b> binding (or both),
87470+ the following steps are taken:</p>
87471+
87472+ <ol>
87473+ <li><p>Perform <span data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm</span>()
87474+ with the provided customizations for creating the global object and the global <b>this</b>
87475+ binding.</p></li>
87476+
87477+ <li>
87478+ <p>Let <var>realm execution context</var> be the <span>running JavaScript execution
87479+ context</span>.</p>
87480+
87481+ <p class="note">This is the <span>JavaScript execution context</span> created in the previous
87482+ step.</p>
87483+ </li>
87484+
87485+ <li><p>Remove <var>realm execution context</var> from the <span>JavaScript execution context
87486+ stack</span>.</p></li>
87487+
87488+ <li><p>Return <var>realm execution context</var>.</p></li>
87489+ </ol>
87490+
8748787491 <hr>
8748887492
8748987493 <p>When defining algorithm steps throughout this specification, it is often important to indicate
@@ -90623,30 +90627,21 @@ document.body.appendChild(frame)</code></pre>
9062390627 <var>document</var>, without firing any mutation events.</p></li>
9062490628
9062590629 <li>
90626- <p>Call the JavaScript <span
90627- data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract operation
90628- with the following customizations:</p>
90630+ <p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
90631+ realm</span> with the following customizations:</p>
9062990632
9063090633 <ul>
9063190634 <li><p>For the global object, create a new <code>Window</code> object
9063290635 <var>window</var>.</p></li>
9063390636
90634- <li><p>For the global <b>this</b> value , use <var>document</var>'s <span>browsing
90637+ <li><p>For the global <b>this</b> binding , use <var>document</var>'s <span>browsing
9063590638 context</span>'s associated <code>WindowProxy</code>.</p></li>
9063690639 </ul>
9063790640
9063890641 <p class="XXX">This is not universally implemented and can perhaps be
9063990642 removed; see <a href="https://github.com/whatwg/html/issues/1698">issue #1698</a>.</p>
9064090643 </li>
9064190644
90642- <li>
90643- <p>Let <var>realm execution context</var> be the <span>running JavaScript execution
90644- context</span>.</p>
90645-
90646- <p class="note">This is the <span>JavaScript execution context</span> created in the previous
90647- step.</p>
90648- </li>
90649-
9065090645 <li><p><span>Set up a window environment settings object</span> with <var>realm execution
9065190646 context</var>.</p></li>
9065290647
@@ -97157,9 +97152,8 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
9715797152 nested worker), then set <var>parent worker global scope</var> to <var>owner</var>.</p></li>
9715897153
9715997154 <li>
97160- <p>Call the JavaScript <span
97161- data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm()</span> abstract
97162- operation with the following customizations:</p>
97155+ <p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
97156+ realm</span> with the following customizations:</p>
9716397157
9716497158 <ul>
9716597159 <li><p>For the global object, if <var>is shared</var> is true, create a new
@@ -97168,21 +97162,12 @@ interface <dfn>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope</span> {
9716897162 </ul>
9716997163 </li>
9717097164
97171- <li>
97172- <p>Let <var>realm execution context</var> be the <span>running JavaScript execution
97173- context</span>.</p>
97174-
97175- <p class="note">This is the <span>JavaScript execution context</span> created in the previous
97176- step.</p>
97177- </li>
97178-
9717997165 <li>
9718097166 <p>Let <var>worker global scope</var> be the <span data-x="concept-realm-global">global
9718197167 object</span> of <var>realm execution context</var>'s Realm component.
9718297168
9718397169 <p class="note">This is the <code>DedicatedWorkerGlobalScope</code> or
97184- <code>SharedWorkerGlobalScope</code> object created when calling <span
97185- data-x="js-InitializeHostDefinedRealm">InitializeHostDefinedRealm</span>.</p>
97170+ <code>SharedWorkerGlobalScope</code> object created in the previous step.</p>
9718697171 </li>
9718797172
9718897173 <li><p><span>Set up a worker environment settings object</span> with <var>realm execution
0 commit comments