@@ -76882,14 +76882,11 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
76882
76882
76883
76883
<p class="note">In general, there is a 1-to-1 mapping from the <code>Window</code> object to the
76884
76884
<code>Document</code> object, as long as the <code>Document</code> object has a <span
76885
- data-x="concept-document-bc">browsing context</span>. There are two exceptions. First, a
76885
+ data-x="concept-document-bc">browsing context</span>. There is one exceptions. A
76886
76886
<code>Window</code> can be reused for the presentation of a second <code>Document</code> in the
76887
76887
same <span>browsing context</span>, such that the mapping is then 1-to-2. This occurs when a
76888
76888
<span>browsing context</span> is <span data-x="navigate">navigated</span> from the initial
76889
76889
<code>about:blank</code> <code>Document</code> to another, with <span>replacement enabled</span>.
76890
- Second, a <code>Document</code> can end up being reused for several <code>Window</code> objects
76891
- when the <code data-x="dom-document-open">document.open(<var>type</var>,
76892
- <var>replace</var>)</code> method is used, such that the mapping is then many-to-1.</p>
76893
76890
76894
76891
<p class="note">A <code>Document</code> does not necessarily have a <span
76895
76892
data-x="concept-document-bc">browsing context</span> associated with it. In particular, data
@@ -76902,12 +76899,12 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
76902
76899
discarded">discarded</span>.</p>
76903
76900
76904
76901
<p>To <dfn>set the active document</dfn> of a <span>browsing context</span>
76905
- <var>browsingContext</var> to a <code>Document</code> object <var>document</var>, optionally with
76906
- a <code>Window</code> object <var>window</var>, run these steps:</p>
76902
+ <var>browsingContext</var> to a <code>Document</code> object <var>document</var>, run these
76903
+ steps:</p>
76907
76904
76908
76905
<ol>
76909
76906
<li>
76910
- <p>If <var>window</var> is not given, let <var>window</var> be <var>document</var>'s <span
76907
+ <p>Let <var>window</var> be <var>document</var>'s <span
76911
76908
data-x="concept-relevant-global">relevant global object</span>.</p>
76912
76909
76913
76910
<p class="XXX">Per this standard <var>document</var> can be created before
@@ -78819,7 +78816,7 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span
78819
78816
If the user <span>refused to allow the document to be unloaded</span>, then return.</p></li>
78820
78817
78821
78818
<li><p><span data-x="unload a document">Unload</span> <var>browsingContext</var>'s <span>active
78822
- document</span> with the <var>recycle</var> parameter set to false .</p></li>
78819
+ document</span>.</p></li>
78823
78820
78824
78821
<li><p>Remove <var>browsingContext</var> from the user interface (e.g., close or hide its tab in
78825
78822
a tabbed browser).</p></li>
@@ -80582,8 +80579,7 @@ interface <dfn>History</dfn> {
80582
80579
unloaded</span>, then return.</p></li>
80583
80580
80584
80581
<li><p><span data-x="unload a document">Unload</span> the <span>active document</span> of the
80585
- <var>specified browsing context</var> with the <var>recycle</var> parameter
80586
- set to false.</p></li>
80582
+ <var>specified browsing context</var>.</p></li>
80587
80583
80588
80584
</ol>
80589
80585
@@ -82565,7 +82561,7 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
82565
82561
<li>
82566
82562
82567
82563
<p><span data-x="unload a document">Unload</span> the <code>Document</code> object of the
82568
- <span>current entry</span>, with the <var>recycle</var> parameter set to false .</p>
82564
+ <span>current entry</span>.</p>
82569
82565
82570
82566
<p>If this instance of the <span data-x="navigate">navigation</span> algorithm is canceled while
82571
82567
this step is running the <span>unload a document</span> algorithm, then the <span>unload a
@@ -83494,7 +83490,6 @@ dictionary <dfn>PageTransitionEventInit</dfn> : <span>EventInit</span> {
83494
83490
<p>Things that can cause the page to be unsalvageable include:</p>
83495
83491
83496
83492
<ul class="brief">
83497
- <li><code data-x="dom-document-open">document.open(<var>type</var>, <var>replace</var>)</code>
83498
83493
<li>Listening for <code data-x="event-beforeunload">beforeunload</code> events
83499
83494
<li>Listening for <code data-x="event-unload">unload</code> events
83500
83495
<li>Having <code>iframe</code>s that are not salvageable
@@ -83612,12 +83607,7 @@ dictionary <dfn>PageTransitionEventInit</dfn> : <span>EventInit</span> {
83612
83607
</ol>
83613
83608
83614
83609
<p>To <dfn data-export="" data-x="unload a document" data-lt="unload a document">unload</dfn> a
83615
- <code>Document</code> <var>document</var>, given a boolean <var>recycle</var> and optionally a
83616
- <var>recursiveFlag</var>:</p>
83617
-
83618
- <p class="note">The <var>recycle</var> argument indicates whether the <code>Document</code> object
83619
- is going to be reused; it is set by the <code
83620
- data-x="dom-document-open">document.open(<var>type</var>, <var>replace</var>)</code> method.</p>
83610
+ <code>Document</code> <var>document</var>, optionally given a <var>recursiveFlag</var>:</p>
83621
83611
83622
83612
<ol>
83623
83613
<li><p>Increase the <span>event loop</span>'s <span>termination nesting level</span> by
@@ -83674,8 +83664,7 @@ dictionary <dfn>PageTransitionEventInit</dfn> : <span>EventInit</span> {
83674
83664
83675
83665
<ol>
83676
83666
<li><p><span data-x="unload a document">Unload</span> the <span>active document</span> of
83677
- <var>browsingContext</var> with the <var>recycle</var> parameter set to false, and the
83678
- <var>recursiveFlag</var> set.</p></li>
83667
+ <var>browsingContext</var> with the <var>recursiveFlag</var> set.</p></li>
83679
83668
83680
83669
<li><p>If the <i data-x="concept-document-salvageable">salvageable</i> state of the
83681
83670
<span>active document</span> of <var>browsingContext</var> is false, then set the
@@ -83684,9 +83673,8 @@ dictionary <dfn>PageTransitionEventInit</dfn> : <span>EventInit</span> {
83684
83673
</ol>
83685
83674
</li>
83686
83675
83687
- <li><p>If both <var>document</var>'s <i
83688
- data-x="concept-document-salvageable">salvageable</i> state and <var>recycle</var> are false,
83689
- then <span data-x="discard a document">discard</span><var>document</var>.</p></li>
83676
+ <li><p>If <var>document</var>'s <i data-x="concept-document-salvageable">salvageable</i> state
83677
+ is false, then <span data-x="discard a document">discard</span><var>document</var>.</p></li>
83690
83678
</ol>
83691
83679
</li>
83692
83680
@@ -91018,20 +91006,9 @@ document.body.appendChild(frame)</code></pre>
91018
91006
<code>about:blank</code> <code>Document</code> created when <var>document</var>'s <span>browsing
91019
91007
context</span> was <span data-x="creating a new browsing context">created</span>, and that
91020
91008
<code>Document</code> object has never had the <span>unload a document</span> algorithm invoked
91021
- on it (e.g., by a previous call to <code
91022
- data-x="dom-document-open">document.open(<var>type</var>, <var>replace</var>)</code>), then set
91023
- <var>replace</var> to true.</p>
91009
+ on it, then set <var>replace</var> to true.</p>
91024
91010
</li>
91025
91011
91026
- <li><p>Set <var>document</var>'s <i data-x="concept-document-salvageable">salvageable</i> state
91027
- to false.</p></li>
91028
-
91029
- <li><p><span>Prompt to unload</span> <var>document</var>. If the user <span>refused to allow the
91030
- document to be unloaded</span>, then return <var>document</var>.</p></li>
91031
-
91032
- <li><p><span data-x="unload a document">Unload</span> <var>document</var>, with the
91033
- <var>recycle</var> parameter set to true.</p></li>
91034
-
91035
91012
<li><p><span data-x="abort a document">Abort</span> <var>document</var>.</p></li>
91036
91013
91037
91014
<li><p>For each <span>shadow-including inclusive descendant</span> <var>node</var> of
@@ -91040,54 +91017,13 @@ document.body.appendChild(frame)</code></pre>
91040
91017
91041
91018
<li><p><span>Erase all event listeners and handlers</span> given <var>window</var>.</p></li>
91042
91019
91043
- <li><p>Remove any <span data-x="concept-task">tasks</span> associated with <var>document</var> in
91044
- any <span>task source</span>.</p></li>
91045
- <!-- removes callbacks that fired between this algorithm starting and the times and databases
91046
- being aborted in the "unload" step above -->
91047
-
91048
91020
<li><p><span data-x="concept-node-replace-all">Replace all</span> with null within
91049
91021
<var>document</var>, without firing any mutation events.</p></li>
91050
91022
91051
- <li>
91052
- <p>Let <var>realm execution context</var> be the result of <span>creating a new JavaScript
91053
- realm</span> with the following customizations:</p>
91054
-
91055
- <ul>
91056
- <li><p>For the global object, create a new <code>Window</code> object and set
91057
- <var>window</var> to it.</p></li>
91058
-
91059
- <li><p>For the global <b>this</b> binding, use <var>document</var>'s <span>browsing
91060
- context</span>'s associated <code>WindowProxy</code>.</p></li>
91061
- </ul>
91062
-
91063
- <p class="XXX">This is not universally implemented and can perhaps be
91064
- removed; see <a href="https://github.com/whatwg/html/issues/1698">issue #1698</a>.</p>
91065
- </li>
91066
-
91067
- <li><p><span>Set up a window environment settings object</span> with <var>realm execution
91068
- context</var>.</p></li>
91069
-
91070
- <li><p><span>Set the active document</span> of <var>document</var>'s <span>browsing
91071
- context</span> to <var>document</var> with <var>window</var>.</p></li>
91072
-
91073
- <li><p>Replace <var>document</var>'s singleton objects with new instances of those objects,
91074
- created in <var>window</var>'s <span data-x="concept-global-object-realm">Realm</span>. (This
91075
- includes in particular the <code>History</code>, <code>ApplicationCache</code>, and
91076
- <code>Navigator</code>, objects, the various <code>BarProp</code> objects, the two
91077
- <code>Storage</code> objects, the various <code>HTMLCollection</code> objects, and objects
91078
- defined by other specifications, like <code>Selection</code>. It also includes all the Web IDL
91079
- prototypes in the JavaScript binding, including <var>document</var>'s prototype.)</p></li>
91080
-
91081
- <!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Ciframe%20src%3D%22document%22%3E%3C%2Fiframe%3E%0A%3Cscript%3Eonload%20%3D%20function%20()%20%7B%20f%20%3D%20document.getElementsByTagName('iframe')%5B0%5D%3B%20d%20%3D%20f.contentWindow.document%3B%20%7D%3C%2Fscript%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22w(d.documentElement.innerHTML)%22%20value%3D%22dump%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write('%3Cscript%3Evar%20x%20%3D%20new%20XMLHttpRequest()%3Bx.open(%26quot%3BGET%26quot%3B%2C%20%26quot%3BGET%26quot%3B)%3Bx.onreadystatechange%3Dfunction()%20%7B%20alert(x.readyState)%3B%20%7D%3Bx.send(null)%3B%3C%2Fscript%3E')%3Bd.close()%3B%20setTimeout(function()%20%7B%20d.open()%3B%20d.write('%3Cp%3Etest%3C%2Fp%3E')%3B%20d.close()%20%7D%2C%200)%3B%22%20value%3D%22xhr%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.onclick%20%3D%20function()%20%7B%20w('click')%20%7D%22%20value%3D%22add%20click%20handler%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write('%3Cp%3Etest%3C%2Fp%3E')%3B%20d.close()%22%20value%3D%22replace%22%3E%0A%3Cinput%20type%3Dbutton%20onclick%3D%22d.open()%3B%20d.write('%3Cp%3E%3Cscript%3Ei%20%3D%200%3B%20setTimeout(%26quot%3Bparent.w(i%2B%2B)%26quot%3B%2C%202000)%3C%2Fscript%3E%3C%2Fp%3E')%3B%20d.close()%22%20value%3D%22replace%20with%20timer%22%3E -->
91082
- <!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A...%3Ciframe%3E%3C%2Fiframe%3E%0D%0A%3Cscript%3E%0D%0Aonload%20%3D%20function%20()%20%7B%0D%0A%20frames%5B0%5D.test%20%3D%201%0D%0A%20w(frames%5B0%5D.test)%3B%0D%0A%20var%20a%20%3D%20frames%5B0%5D.document.location.assign%3B%0D%0A%20w(a)%3B%0D%0A%20w(frames%5B0%5D.document.location.assign%20%3D%3D%3D%20a)%3B%0D%0A%20frames%5B0%5D.document.open()%3B%0D%0A%20frames%5B0%5D.document.write('%3Cscript%3Edocument.write(test)%3C%5C%2Fscript%3E')%3B%0D%0A%20frames%5B0%5D.document.close()%3B%0D%0A%20w(frames%5B0%5D.test)%3B%0D%0A%20w(frames%5B0%5D.document.location.assign%20%3D%3D%3D%20a)%3B%0D%0A%7D%0D%0A%3C%2Fscript%3E -->
91083
-
91084
91023
<li><p>If <var>document</var> is <span>ready for post-load tasks</span>, then set
91085
91024
<var>document</var>'s <span>reload override flag</span> and set <var>document</var>'s
91086
91025
<span>reload override buffer</span> to the empty string.</p></li>
91087
91026
91088
- <li><p>Set <var>document</var>'s <i data-x="concept-document-salvageable">salvageable</i> state
91089
- back to true.</p></li>
91090
-
91091
91027
<li><p>Change <var>document</var>'s <span data-x="concept-document-url">URL</span> to the
91092
91028
<span data-x="concept-document-url">URL</span> of the <span>responsible document</span> specified
91093
91029
by the <span>entry settings object</span>.</p></li>
@@ -91132,9 +91068,6 @@ document.body.appendChild(frame)</code></pre>
91132
91068
<var>replace</var>)</code> call. This new entry does not have a <code>Document</code> object, so
91133
91069
a new one will be created if the session history is traversed to that entry.</p></li>
91134
91070
91135
- <li><p>Set <var>document</var>'s <span>fired unload</span> flag to false. (It could have been set
91136
- to true during the <span data-x="unload a document">unload</span> step above.)</p></li>
91137
-
91138
91071
<li><p>Finally, set the <span>insertion point</span> to point at just before the end of the
91139
91072
<span>input stream</span> (which at this point will be empty).</p></li>
91140
91073
0 commit comments