@@ -4147,6 +4147,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
4147
4147
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-fragment-navigated">WebDriver BiDi fragment navigated</dfn></li>
4148
4148
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-dom-content-loaded">WebDriver BiDi DOM content loaded</dfn></li>
4149
4149
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-load-complete">WebDriver BiDi load complete</dfn></li>
4150
+ <li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-page-show">WebDriver BiDi page show</dfn></li>
4151
+ <li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-pop-state">WebDriver BiDi pop state</dfn></li>
4150
4152
</ul>
4151
4153
</dd>
4152
4154
@@ -84908,16 +84910,23 @@ interface <dfn interface>History</dfn> {
84908
84910
84909
84911
<hr>
84910
84912
84911
- <p>To <dfn>traverse the history by a delta</dfn> given <var>delta</var> and <span>browsing
84912
- context</span> <var>source browsing context</var>, the user agent must append a <span
84913
- data-x="concept-task">task</span> to this <span>top-level browsing context</span>'s <span>session
84914
- history traversal queue</span>, the <span data-x="concept-task">task</span> consisting of running
84915
- the following steps:</p>
84913
+ <p>To <dfn>traverse the history by a delta</dfn> given <var>delta</var>, <span>browsing
84914
+ context</span> <var>source browsing context</var>, and an optional <span
84915
+ data-x="navigation-id">navigation id</span> <var>navigationId</var> (default null),
84916
+ the user agent must append a <span data-x="concept-task">task</span> to this <span>top-level
84917
+ browsing context</span>'s <span>session history traversal queue</span>, the <span
84918
+ data-x="concept-task">task</span> consisting of running the following steps:</p>
84916
84919
84917
84920
<ol>
84918
84921
<li><p>If the index of the <span>current entry of the joint session history</span> plus
84919
84922
<var>delta</var> is less than zero or greater than or equal to the number of items in the
84920
- <span>joint session history</span>, then return.</p>
84923
+ <span>joint session history</span>, invoke <span>WebDriver BiDi navigation failed</span>
84924
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span> whose <span
84925
+ data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84926
+ data-x="navigation-status-status">status</span> is "<code
84927
+ data-x="navigation-status-canceled">canceled</code>", and <span
84928
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84929
+ data-x="concept-request-url">url</span>, then return.</p></li>
84921
84930
84922
84931
<li><p>Let <var>specified entry</var> be the entry in the <span>joint session
84923
84932
history</span> whose index is the sum of <var>delta</var> and the index of the
@@ -84927,17 +84936,32 @@ interface <dfn interface>History</dfn> {
84927
84936
the <var>specified entry</var>.</p></li>
84928
84937
84929
84938
<li><p>If <var>source browsing context</var> is not <span>allowed to navigate</span>
84930
- <var>specified browsing context</var>, then return.</p></li>
84939
+ <var>specified browsing context</var>, then invoke <span>WebDriver BiDi navigation failed</span> with
84940
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span> whose <span
84941
+ data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84942
+ data-x="navigation-status-status">status</span> is "<code
84943
+ data-x="navigation-status-canceled">canceled</code>", and <span
84944
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84945
+ data-x="concept-request-url">url</span>, then return.</p></li>
84931
84946
84932
84947
<li><p>If the <var>specified browsing context</var>'s <span>active document</span>'s <span>unload
84933
- counter</span> is greater than 0, then return.</p></li>
84948
+ counter</span> is greater than 0, then invoke <span>WebDriver BiDi navigation failed</span> with
84949
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span> whose <span
84950
+ data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84951
+ data-x="navigation-status-status">status</span> is "<code
84952
+ data-x="navigation-status-canceled">canceled</code>", and <span
84953
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84954
+ data-x="concept-request-url">url</span>, then return.</p></li>
84934
84955
84935
84956
<li>
84936
84957
<p><span>Queue a global task</span> on the <span>history traversal task source</span> given
84937
84958
<var>specified browsing context</var>'s <span>active window</span> to perform the following
84938
84959
steps:</p>
84939
84960
84940
84961
<ol>
84962
+ <li><p>If <var>navigationId</var> is null, let <var>navigation id</var> be the result of
84963
+ <span>generating a random UUID</span>. <ref spec=UUID></p></li>
84964
+
84941
84965
<li><p>If there is an ongoing attempt to navigate <var>specified browsing context</var>
84942
84966
that has not yet <span data-x="concept-navigate-mature">matured</span> (i.e. it has not passed the
84943
84967
point of making its <code>Document</code> the <span>active document</span>), then cancel that
@@ -84951,7 +84975,13 @@ interface <dfn interface>History</dfn> {
84951
84975
<ol>
84952
84976
<li><p><span>Prompt to unload</span> the <span>active document</span> of the <var>specified
84953
84977
browsing context</var>. If the user <span>refused to allow the document to be
84954
- unloaded</span>, then return.</p></li>
84978
+ unloaded</span>, then invoke <span>WebDriver BiDi navigation failed</span> with
84979
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span>
84980
+ whose <span data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84981
+ data-x="navigation-status-status">status</span> is "<code
84982
+ data-x="navigation-status-canceled">canceled</code>", and <span
84983
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84984
+ data-x="concept-request-url">url</span>, then return.</p></li>
84955
84985
84956
84986
<li><p><span data-x="unload a document">Unload</span> the <span>active document</span> of the
84957
84987
<var>specified browsing context</var>.</p></li>
@@ -84960,7 +84990,8 @@ interface <dfn interface>History</dfn> {
84960
84990
84961
84991
<li><p><span>Traverse the history</span> of the <var>specified browsing context</var> to
84962
84992
the <var>specified entry</var> with <var><span>explicitHistoryNavigation</span></var> set to
84963
- true.</p>
84993
+ true, and <span data-x="traverse-history-navigationid">navigation id</span> set to
84994
+ <var>navigationId</var>.</p>
84964
84995
</ol>
84965
84996
</li>
84966
84997
</ol>
@@ -86539,8 +86570,6 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
86539
86570
context</span>'s <span>active window</span> has <span>transient activation</span>; otherwise
86540
86571
false.</p></li>
86541
86572
86542
- <li><p>Let <var>navigationStatus</var> be </li>
86543
-
86544
86573
<li><p>Invoke <span>WebDriver BiDi navigation started</span> with <var>browsingContext</var>, and
86545
86574
a new <span>WebDriver BiDi navigation status</span> whose <span
86546
86575
data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
@@ -87659,7 +87688,8 @@ new PaymentRequest(…); // Allowed to use
87659
87688
<li><p><span>Traverse the history</span> to <var>sessionHistory</var>'s <span>current
87660
87689
entry</span> with <var data-x="traverse-history-hh">historyHandling</var> set to
87661
87690
<var>navigationParams</var>'s <span data-x="navigation-params-hh">history
87662
- handling</span>.</p></li>
87691
+ handling</span>, and <span data-x="traverse-history-navigationid">navigation id</span>
87692
+ set to <var>navigationId</var>.</p></li>
87663
87693
</ol>
87664
87694
</dd>
87665
87695
@@ -87689,7 +87719,9 @@ new PaymentRequest(…); // Allowed to use
87689
87719
87690
87720
<li><p><span>Traverse the history</span> to <var>newEntry</var> with
87691
87721
<var data-x="traverse-history-hh">historyHandling</var> set to "<code
87692
- data-x="hh-replace">replace</code>".</p></li>
87722
+ data-x="hh-replace">replace</code>", and <span
87723
+ data-x="traverse-history-navigationid">navigation id</span> set to <var>navigationId</var>.
87724
+ </p></li>
87693
87725
</ol>
87694
87726
</dd>
87695
87727
@@ -87718,7 +87750,9 @@ new PaymentRequest(…); // Allowed to use
87718
87750
<li><p><span data-x="list append">Append</span> <var>newEntry</var> to
87719
87751
<var>sessionHistory</var>.</p></li>
87720
87752
87721
- <li><p><span>Traverse the history</span> to <var>newEntry</var>.</p></li>
87753
+ <li><p><span>Traverse the history</span> to <var>newEntry</var> with <span
87754
+ data-x="traverse-history-navigationid">navigation id</span> set to <var>navigationId</var>.
87755
+ </p></li>
87722
87756
</ol>
87723
87757
</dd>
87724
87758
</dl>
@@ -88111,18 +88145,11 @@ new PaymentRequest(…); // Allowed to use
88111
88145
mode</span>.</p></li>
88112
88146
88113
88147
<li><p><span>Traverse the history</span> to the new entry, with <var
88114
- data-x="traverse-history-hh">historyHandling</var> set to <var>historyHandling</var> and with
88115
- <var><span>nonBlockingEvents</span></var> set to true. This will <span>scroll to the
88116
- fragment</span> given in what is now the document's <span
88148
+ data-x="traverse-history-hh">historyHandling</var> set to <var>historyHandling</var>,
88149
+ <var><span>nonBlockingEvents</span></var> set to true, and <span
88150
+ data-x="traverse-history-navigationid">navigation id</span> set to <var>navigationId</var>.
88151
+ This will <span>scroll to the fragment</span> given in what is now the document's <span
88117
88152
data-x="concept-document-url">URL</span>.</p></li>
88118
-
88119
- <li><p><p>Invoke <span>WebDriver BiDi fragment navigated</span> with <var>browsingContext</var>,
88120
- and a new <span>WebDriver BiDi navigation status</span> whose <span
88121
- data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
88122
- data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
88123
- data-x="concept-request-url">url</span>, and <span
88124
- data-x="navigation-status-status">status</span> is "<code
88125
- data-x="navigation-status-complete">complete</code>".</p></li>
88126
88153
</ol>
88127
88154
88128
88155
<p class="note">If the scrolling fails because the relevant <span data-x="concept-id">ID</span> has
@@ -88253,8 +88280,9 @@ new PaymentRequest(…); // Allowed to use
88253
88280
with an optional <span>history handling behavior</span> <dfn
88254
88281
data-x="traverse-history-hh"><var>historyHandling</var></dfn> (default "<code
88255
88282
data-x="hh-default">default</code>"), an optional boolean <dfn><var>nonBlockingEvents</var></dfn>
88256
- (default false), and an optional boolean <dfn><var>explicitHistoryNavigation</var></dfn> (default
88257
- false):</p>
88283
+ (default false), an optional boolean <dfn><var>explicitHistoryNavigation</var></dfn> (default
88284
+ false), optional <span data-x="navigation-id">navigation id</span>
88285
+ <dfn data-x="traverse-history-navigationid"><var>navigationId</var></dfn> (default null):</p>
88258
88286
88259
88287
<p class="note">This algorithm is not just invoked when <span data-x="traverse the history by a
88260
88288
delta">explicitly going back or forwards in the session history</span> — it is also invoked
@@ -88280,11 +88308,12 @@ new PaymentRequest(…); // Allowed to use
88280
88308
<li>
88281
88309
<p><span>Navigate</span><!--DONAV history traversal after eviction--> the <span>browsing
88282
88310
context</span> to <var>request</var> with <var data-x="navigation-hh">historyHandling</var>
88283
- set to "<code data-x="hh-entry-update">entry update</code>" and with <var
88311
+ set to "<code data-x="hh-entry-update">entry update</code>", with <var
88284
88312
data-x="navigation-historypolicycontainer">historyPolicyContainer</var> set to
88285
- <var>entry</var>'s <span data-x="she-policy-container">policy container</span>. The navigation
88286
- must be done using the same <span>source browsing context</span> as was used the first time
88287
- <var>entry</var> was created.</p>
88313
+ <var>entry</var>'s <span data-x="she-policy-container">policy container</span>, and with
88314
+ <span data-x="navigation-navigationid">navigation id</span> set to <var>navigationId</var>.
88315
+ The navigation must be done using the same <span>source browsing context</span> as was
88316
+ used the first time <var>entry</var> was created.</p>
88288
88317
88289
88318
<p class="note">The "<span>navigate</span>" algorithm reinvokes this "traverse" algorithm to
88290
88319
complete the traversal, at which point <var>entry</var>'s <span
@@ -88306,6 +88335,20 @@ new PaymentRequest(…); // Allowed to use
88306
88335
<li><p>Let <var>newDocument</var> be <var>entry</var>'s <span
88307
88336
data-x="she-document">document</span>.</p></li>
88308
88337
88338
+ <li><p>If <var>navigationId</var> is null:</p>
88339
+ <!-- In practice I think the only case that we use the navigation id in subsequent steps is
88340
+ when we have a page loaded from the bfcache, in which case document's navigation id is always null.
88341
+ We could just use null as the navigation id in that case, but it would mean a difference between
88342
+ a WebDriver-initiated history traversal from the bfcache and a UA initated history traversal. -->
88343
+ <ol>
88344
+ <li><p>If <var>newDocument</var>'s <span data-x="concept-document-navigation-id">navigation
88345
+ id</span> is not null, let <var>navigationId</var> be <var>newDocument</var>'s <span
88346
+ data-x="concept-document-navigation-id">navigation id</span>. Otherwise let
88347
+ <var>navigationId</var> be the result of <span>generating a random UUID</span>.
88348
+ <ref spec=UUID></p></li>
88349
+ </ol>
88350
+ </li>
88351
+
88309
88352
<li><p>If <var>newDocument</var> is different than the <span>current entry</span>'s <span
88310
88353
data-x="she-document">document</span>, or <var>historyHandling</var> is "<code
88311
88354
data-x="hh-entry-update">entry update</code>" or "<code data-x="hh-reload">reload</code>",
@@ -88395,6 +88438,14 @@ new PaymentRequest(…); // Allowed to use
88395
88438
<li><p><span>Fire a page transition event</span> named <code
88396
88439
data-x="event-pageshow">pageshow</code> at <var>newDocument</var>'s <span>relevant global
88397
88440
object</span> with true.</p></li>
88441
+
88442
+ <li><p>Invoke <span>WebDriver BiDi page show</span> with <var>newDocument</var>'s
88443
+ <span data-x="concept-document-bc">browsing context</span>, and a new <span>WebDriver BiDi
88444
+ navigation status</span> whose <span data-x="navigation-status-id">id</span> is the
88445
+ <var>navigationId</var>, <span data-x="navigation-status-status">status</span> is
88446
+ "<code data-x="navigation-status-complete">complete</code>", and <span
88447
+ data-x="navigation-status-url">url</span> is the <var>newDocument</var>'s <span
88448
+ data-x="concept-document-url">URL</span>.</p></li>
88398
88449
</ol>
88399
88450
88400
88451
<!-- an interesting thing to test would be to traverse back during onload, before the first
@@ -88467,19 +88518,44 @@ new PaymentRequest(…); // Allowed to use
88467
88518
object</span> to run the following steps instead.</p>
88468
88519
88469
88520
<ol>
88470
- <li><p>If <var>stateChanged</var> is true, then <span data-x="concept-event-fire">fire an
88471
- event</span> named <code data-x="event-popstate">popstate</code> at <var>newDocument</var>'s
88472
- <span>relevant global object</span>, using <code>PopStateEvent</code>, with the <code
88473
- data-x="dom-PopStateEvent-state">state</code> attribute initialized to <var>state</var>.</p></li>
88521
+ <li><p>If <var>stateChanged</var> is true:</p>
88522
+ <ol>
88523
+ <li><p><span data-x="concept-event-fire">Fire an event</span> named <code
88524
+ data-x="event-popstate">popstate</code> at <var>newDocument</var>'s
88525
+ <span>relevant global object</span>, using <code>PopStateEvent</code>, with the <code
88526
+ data-x="dom-PopStateEvent-state">state</code> attribute initialized to <var>state</var>.
88527
+ </p></li>
88528
+
88529
+ <li><p>Invoke <span>WebDriver BiDi pop state</span> with with <var>newDocument</var>'s
88530
+ <span data-x="concept-document-bc">browsing context</span>, and a new <span>WebDriver
88531
+ BiDi navigation status</span> whose <span data-x="navigation-status-id">id</span> is
88532
+ <var>navigationId</var>, <span data-x="navigation-status-url">url</span> is
88533
+ <var>resource</var>'s <span data-x="concept-request-url">url</span>, and <span
88534
+ data-x="navigation-status-status">status</span> is "<code
88535
+ data-x="navigation-status-complete">complete</code>".</p></li>
88536
+ </ol>
88537
+ </li>
88474
88538
88475
88539
<li><p><span>Restore persisted state</span> from <var>entry</var>.</p></li>
88476
88540
88477
- <li><p>If <var>hashChanged</var> is true, then <span data-x="concept-event-fire">fire an
88478
- event</span> named <code data-x="event-hashchange">hashchange</code> at the <span>browsing
88479
- context</span>'s <span>active window</span>, using <code>HashChangeEvent</code>, with the <code
88480
- data-x="dom-HashChangeEvent-oldURL">oldURL</code> attribute initialized to <var>oldURL</var>
88481
- and the <code data-x="dom-HashChangeEvent-newURL">newURL</code> attribute initialized to
88482
- <var>newURL</var>.</p></li>
88541
+ <li><p>If <var>hashChanged</var> is true:</p>
88542
+ <ol>
88543
+ <li><p><span data-x="concept-event-fire">Fire an event</span> named
88544
+ <code data-x="event-hashchange">hashchange</code> at the <span>browsing context</span>'s
88545
+ <span>active window</span>, using <code>HashChangeEvent</code>, with the <code
88546
+ data-x="dom-HashChangeEvent-oldURL">oldURL</code> attribute initialized to <var>oldURL</var>
88547
+ and the <code data-x="dom-HashChangeEvent-newURL">newURL</code> attribute initialized to
88548
+ <var>newURL</var>.</p></li>
88549
+
88550
+ <li><p>Invoke <span>WebDriver BiDi fragment navigated</span> with <var>newDocument</var>'s
88551
+ <span data-x="concept-document-bc">browsing context</span>, and a new <span>WebDriver
88552
+ BiDi navigation status</span> whose <span data-x="navigation-status-id">id</span> is
88553
+ <var>navigationId</var>, <span data-x="navigation-status-url">url</span> is
88554
+ <var>resource</var>'s <span data-x="concept-request-url">url</span>, and <span
88555
+ data-x="navigation-status-status">status</span> is "<code
88556
+ data-x="navigation-status-complete">complete</code>".</p></li>
88557
+ </ol>
88558
+ </li>
88483
88559
</ol>
88484
88560
</li>
88485
88561
</ol>
0 commit comments