@@ -85165,16 +85165,13 @@ new PaymentRequest(…); // Allowed to use
85165
85165
85166
85166
<p>Some of the sections below, to which the above algorithm defers in certain cases, require the
85167
85167
user agent to <dfn>update the session history with the new page</dfn>, given some <span>navigation
85168
- params</span> <var>navigationParams</var>. When a user agent is required to do this, it must
85169
- <span>queue a global task</span> on the <span>networking task source</span>, given the
85170
- <span>relevant global object</span> of the <code>Document</code> object of the <span>current
85171
- entry</span> (not the new one), to run the following steps:</p>
85168
+ params</span> <var>navigationParams</var> and a <code>Document</code> <var>newDocument</var>. When
85169
+ a user agent is required to do this, it must <span>queue a global task</span> on the
85170
+ <span>networking task source</span>, given the <span>relevant global object</span> of the
85171
+ <code>Document</code> object of the <span>current entry</span> (not the new one), to run the
85172
+ following steps:</p>
85172
85173
85173
85174
<ol>
85174
- <li><p>Let <var>newDocument</var> be <var>navigationParams</var>'s <span
85175
- data-x="navigation-params-browsing-context">browsing context</span>'s <span>active
85176
- document</span>.</p></li>
85177
-
85178
85175
<li>
85179
85176
<p><span data-x="unload a document">Unload</span> the <span
85180
85177
data-x="she-document">document</span> of the <span>current entry</span>.</p>
@@ -85190,38 +85187,76 @@ new PaymentRequest(…); // Allowed to use
85190
85187
<li>
85191
85188
<dl>
85192
85189
<dt>If <var>navigationParams</var>'s <span data-x="navigation-params-hh">history
85193
- handling</span> is "<code data-x="hh-reload">reload </code>" or "<code
85194
- data-x="hh-entry-update">entry update </code>"</dt>
85190
+ handling</span> is "<code data-x="hh-entry-update">entry update </code>" or "<code
85191
+ data-x="hh-reload">reload </code>"</dt>
85195
85192
85196
85193
<dd>
85197
85194
<ol>
85198
85195
<li><p>Replace the <span data-x="she-document">document</span> of the <span>current
85199
- entry</span>, and any other entries that reference the same <span
85196
+ entry</span>, and of any other entries that reference the same <span
85200
85197
data-x="she-document">document</span> as that entry, with <var>newDocument</var>.</p></li>
85201
85198
85202
- <li><p><span>Traverse the history</span> to the <span>current entry</span>.</p></li>
85199
+ <li><p><span>Traverse the history</span> to the <span>current entry</span> with <var
85200
+ data-x="traverse-history-hh">historyHandling</var> set to <var>navigationParams</var>'s <span
85201
+ data-x="navigation-params-hh">history handling</span>.</p></li>
85203
85202
</ol>
85204
85203
</dd>
85205
85204
85206
- <dt>If the navigation was initiated with a <span>URL</span> that <span
85207
- data-x="concept-url-equals">equals</span> <var>newDocument</var>'s <span
85208
- data-x="concept-document-url">URL</span></dt>
85205
+ <dt>Otherwise, if the navigation was initiated with a <span>URL</span> that <span
85206
+ data-x="concept-url-equals">equals</span> <var>navigationParams</var>'s <span
85207
+ data-x="navigation-params-browsing-context">browsing context</span>'s <span>active
85208
+ document</span>'s <span data-x="concept-document-url">URL</span></dt>
85209
85209
85210
85210
<dd>
85211
85211
<ol>
85212
- <li><p>Replace the <span>current entry</span> with a new <span>session history entry</span>
85213
- whose <span data-x="she-url">URL</span> is <var>newDocument</var>'s <span
85214
- data-x="concept-document-url">URL</span> and <span data-x="she-document">document</span> is
85215
- <var>newDocument</var>.</p></li>
85212
+ <li>
85213
+ <p>Let <var>newEntry</var> be a new <span>session history entry</span> whose <span
85214
+ data-x="she-url">URL</span> is <var>newDocument</var>'s <span
85215
+ data-x="concept-document-url">URL</span> and <span data-x="she-document">document</span> is
85216
+ <var>newDocument</var>.</p>
85217
+
85218
+ <p class="XXX">Some browsers copy over the serialized state of <span>current entry</span>,
85219
+ but this is inconsistent. See <a href="https://github.com/whatwg/html/issues/6213">issue
85220
+ #6213</a> for more discussion on this.</p>
85221
+ </li>
85222
+
85223
+ <li><p>Insert <var>newEntry</var> after the <span>current entry</span> in
85224
+ <var>navigationParams</var>'s <span data-x="navigation-params-browsing-context">browsing
85225
+ context</span>'s <span>session history</span>.</p></li>
85216
85226
85217
- <li><p><span>Traverse the history</span> to the <span>current entry</span>.</p></li>
85227
+ <li><p><span>Traverse the history</span> to <var>newEntry</var> with <var
85228
+ data-x="traverse-history-hh">historyHandling</var> set to "<code
85229
+ data-x="hh-replace">replace</code>".</p></li>
85230
+ </ol>
85231
+ </dd>
85232
+
85233
+ <dt>Otherwise, if <var>navigationParams</var>'s <span data-x="navigation-params-hh">history
85234
+ handling</span> is "<code data-x="hh-replace">replace</code>"</dt>
85235
+
85236
+ <dd>
85237
+ <ol>
85238
+ <li><p>Let <var>newEntry</var> be a new <span>session history entry</span> whose <span
85239
+ data-x="she-url">URL</span> is <var>newDocument</var>'s <span
85240
+ data-x="concept-document-url">URL</span> and <span data-x="she-document">document</span> is
85241
+ <var>newDocument</var>.</p></li>
85242
+
85243
+ <li><p>Insert <var>newEntry</var> after the <span>current entry</span> in
85244
+ <var>navigationParams</var>'s <span data-x="navigation-params-browsing-context">browsing
85245
+ context</span>'s <span>session history</span>.</p></li>
85246
+
85247
+ <li><p><span>Traverse the history</span> to <var>newEntry</var> with
85248
+ <var data-x="traverse-history-hh">historyHandling</var> set to "<code
85249
+ data-x="hh-replace">replace</code>".</p></li>
85218
85250
</ol>
85219
85251
</dd>
85220
85252
85221
85253
<dt>Otherwise</dt>
85222
85254
85223
85255
<dd>
85224
85256
<ol>
85257
+ <li><p>Assert: <var>navigationParams</var>'s <span data-x="navigation-params-hh">history
85258
+ handling</span> is "<code data-x="hh-default">default</code>".</p></li>
85259
+
85225
85260
<li>
85226
85261
<p>Remove all the entries in the <span>session history</span> after the <span>current
85227
85262
entry</span>. If the <span>current entry</span> is the last entry in the session history,
@@ -85236,9 +85271,7 @@ new PaymentRequest(…); // Allowed to use
85236
85271
data-x="concept-document-url">URL</span> and <span data-x="she-document">document</span> is
85237
85272
<var>newDocument</var>.</p></li>
85238
85273
85239
- <li><p><span>Traverse the history</span> to the new entry, with <var
85240
- data-x="traverse-history-hh">historyHandling</var> set to <var>navigationParams</var>'s <span
85241
- data-x="navigation-params-hh">history handling</span>.</p></li>
85274
+ <li><p><span>Traverse the history</span> to the new entry.</p></li>
85242
85275
</ol>
85243
85276
</dd>
85244
85277
</dl>
@@ -85311,7 +85344,8 @@ new PaymentRequest(…); // Allowed to use
85311
85344
85312
85345
<p>After creating the <code>Document</code> object, but before any script execution, certainly
85313
85346
before the parser <span data-x="stop parsing">stops</span>, the user agent must <span>update the
85314
- session history with the new page</span> given <var>navigationParams</var>.</p>
85347
+ session history with the new page</span> given <var>navigationParams</var> and the newly-created
85348
+ <code>Document</code>.</p>
85315
85349
85316
85350
85317
85351
@@ -85336,9 +85370,10 @@ new PaymentRequest(…); // Allowed to use
85336
85370
character encoding.</p>
85337
85371
85338
85372
<p>Then, with the newly created <code>Document</code>, the user agent must <span>update the
85339
- session history with the new page</span> given <var>navigationParams</var>. User agents may do
85340
- this before the complete document has been parsed (thus achieving <i>incremental rendering</i>),
85341
- and must do this before any scripts are to be executed.</p>
85373
+ session history with the new page</span> given <var>navigationParams</var> and the newly-created
85374
+ <code>Document</code>. User agents may do this before the complete document has been parsed (thus
85375
+ achieving <i>incremental rendering</i>), and must do this before any scripts are to be
85376
+ executed.</p>
85342
85377
85343
85378
<p>Error messages from the parse process (e.g., XML namespace well-formedness errors) may be
85344
85379
reported inline by mutating the <code>Document</code>.</p>
@@ -85385,7 +85420,7 @@ new PaymentRequest(…); // Allowed to use
85385
85420
85386
85421
<p>After creating the <code>Document</code> object, but potentially before the page has finished
85387
85422
parsing, the user agent must <span>update the session history with the new page</span> given
85388
- <var>navigationParams</var>.</p>
85423
+ <var>navigationParams</var> and the newly-created <code>Document</code> .</p>
85389
85424
85390
85425
<p>User agents may add content to the <code>head</code> element of the <code>Document</code>,
85391
85426
e.g., linking to a style sheet, providing script, or giving the document a <code>title</code>.</p>
@@ -85473,7 +85508,7 @@ new PaymentRequest(…); // Allowed to use
85473
85508
85474
85509
<p>After creating the <code>Document</code> object, but potentially before the page has finished
85475
85510
fully loading, the user agent must <span>update the session history with the new page</span> given
85476
- <var>navigationParams</var>.</p>
85511
+ <var>navigationParams</var> and the newly-created <code>Document</code> .</p>
85477
85512
85478
85513
<p>User agents may add content to the <code>head</code> element of the <code>Document</code>, or
85479
85514
attributes to the element <var>host element</var>, e.g., to link to a style sheet, to provide a
@@ -85518,7 +85553,7 @@ new PaymentRequest(…); // Allowed to use
85518
85553
85519
85554
<p>After creating the <code>Document</code> object, but potentially before the page has finished
85520
85555
fully loading, the user agent must <span>update the session history with the new page</span> given
85521
- <var>navigationParams</var>.</p>
85556
+ <var>navigationParams</var> and the newly-created <code>Document</code> .</p>
85522
85557
85523
85558
<p>User agents may add content to the <code>head</code> element of the <code>Document</code>, or
85524
85559
attributes to the <code>embed</code> element, e.g. to link to a style sheet or to give the
@@ -85574,7 +85609,7 @@ new PaymentRequest(…); // Allowed to use
85574
85609
85575
85610
<p>After creating the <code>Document</code> object, but potentially before the page has been
85576
85611
completely set up, the user agent must <span>update the session history with the new page</span>
85577
- given <var>navigationParams</var>.</p>
85612
+ given <var>navigationParams</var> and the newly-created <code>Document</code> .</p>
85578
85613
85579
85614
85580
85615
@@ -85754,16 +85789,16 @@ new PaymentRequest(…); // Allowed to use
85754
85789
<p>If <var>entry</var>'s <span data-x="she-document">document</span> is null, then:</p>
85755
85790
85756
85791
<ol>
85792
+ <li><p>Assert: <var>historyHandling</var> is "<code
85793
+ data-x="hh-default">default</code>".</p></li>
85794
+
85757
85795
<li><p>Let <var>request</var> be a new <span data-x="concept-request">request</span> whose
85758
85796
<span data-x="concept-request-url">url</span> is <var>entry</var>'s <span
85759
85797
data-x="she-url">URL</span>.</p></li>
85760
85798
85761
85799
<li><p>If <var>explicitHistoryNavigation</var> is true, then set <var>request</var>'s <span
85762
85800
data-x="concept-request-history-navigation-flag">history-navigation flag</span>.</p></li>
85763
85801
85764
- <li><p>Assert: <var>historyHandling</var> is not "<code
85765
- data-x="hh-replace">replace</code>".</p></li>
85766
-
85767
85802
<li>
85768
85803
<p><span>Navigate</span><!--DONAV history traversal after eviction--> the <span>browsing
85769
85804
context</span> to <var>request</var> with <var data-x="navigation-hh">historyHandling</var>
@@ -85796,7 +85831,9 @@ new PaymentRequest(…); // Allowed to use
85796
85831
data-x="she-document">document</span>.</p></li>
85797
85832
85798
85833
<li><p>If <var>newDocument</var> is different than the <span>current entry</span>'s <span
85799
- data-x="she-document">document</span>, then:</p>
85834
+ data-x="she-document">document</span>, or <var>historyHandling</var> is "<code
85835
+ data-x="hh-entry-update">entry update</code>" or "<code data-x="hh-reload">reload</code>",
85836
+ then:</p>
85800
85837
85801
85838
<ol>
85802
85839
<li><p>Remove any <span data-x="concept-task">tasks</span> queued by the <span>history traversal
0 commit comments