@@ -4143,6 +4143,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
4143
4143
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-fragment-navigated">WebDriver BiDi fragment navigated</dfn></li>
4144
4144
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-dom-content-loaded">WebDriver BiDi DOM content loaded</dfn></li>
4145
4145
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-load-complete">WebDriver BiDi load complete</dfn></li>
4146
+ <li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-page-show">WebDriver BiDi page show</dfn></li>
4147
+ <li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-pop-state">WebDriver BiDi pop state</dfn></li>
4146
4148
</ul>
4147
4149
</dd>
4148
4150
@@ -84893,16 +84895,23 @@ interface <dfn interface>History</dfn> {
84893
84895
84894
84896
<hr>
84895
84897
84896
- <p>To <dfn>traverse the history by a delta</dfn> given <var>delta</var> and <span>browsing
84897
- context</span> <var>source browsing context</var>, the user agent must append a <span
84898
- data-x="concept-task">task</span> to this <span>top-level browsing context</span>'s <span>session
84899
- history traversal queue</span>, the <span data-x="concept-task">task</span> consisting of running
84900
- the following steps:</p>
84898
+ <p>To <dfn>traverse the history by a delta</dfn> given <var>delta</var>, <span>browsing
84899
+ context</span> <var>source browsing context</var>, and an optional <span
84900
+ data-x="navigation-id">navigation id</span> <var>navigationId</var> (default null),
84901
+ the user agent must append a <span data-x="concept-task">task</span> to this <span>top-level
84902
+ browsing context</span>'s <span>session history traversal queue</span>, the <span
84903
+ data-x="concept-task">task</span> consisting of running the following steps:</p>
84901
84904
84902
84905
<ol>
84903
84906
<li><p>If the index of the <span>current entry of the joint session history</span> plus
84904
84907
<var>delta</var> is less than zero or greater than or equal to the number of items in the
84905
- <span>joint session history</span>, then return.</p>
84908
+ <span>joint session history</span>, invoke <span>WebDriver BiDi navigation failed</span>
84909
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span> whose <span
84910
+ data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84911
+ data-x="navigation-status-status">status</span> is "<code
84912
+ data-x="navigation-status-canceled">canceled</code>", and <span
84913
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84914
+ data-x="concept-request-url">url</span>, then return.</p></li>
84906
84915
84907
84916
<li><p>Let <var>specified entry</var> be the entry in the <span>joint session
84908
84917
history</span> whose index is the sum of <var>delta</var> and the index of the
@@ -84912,17 +84921,32 @@ interface <dfn interface>History</dfn> {
84912
84921
the <var>specified entry</var>.</p></li>
84913
84922
84914
84923
<li><p>If <var>source browsing context</var> is not <span>allowed to navigate</span>
84915
- <var>specified browsing context</var>, then return.</p></li>
84924
+ <var>specified browsing context</var>, then invoke <span>WebDriver BiDi navigation failed</span> with
84925
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span> whose <span
84926
+ data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84927
+ data-x="navigation-status-status">status</span> is "<code
84928
+ data-x="navigation-status-canceled">canceled</code>", and <span
84929
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84930
+ data-x="concept-request-url">url</span>, then return.</p></li>
84916
84931
84917
84932
<li><p>If the <var>specified browsing context</var>'s <span>active document</span>'s <span>unload
84918
- counter</span> is greater than 0, then return.</p></li>
84933
+ counter</span> is greater than 0, then invoke <span>WebDriver BiDi navigation failed</span> with
84934
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span> whose <span
84935
+ data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84936
+ data-x="navigation-status-status">status</span> is "<code
84937
+ data-x="navigation-status-canceled">canceled</code>", and <span
84938
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84939
+ data-x="concept-request-url">url</span>, then return.</p></li>
84919
84940
84920
84941
<li>
84921
84942
<p><span>Queue a global task</span> on the <span>history traversal task source</span> given
84922
84943
<var>specified browsing context</var>'s <span>active window</span> to perform the following
84923
84944
steps:</p>
84924
84945
84925
84946
<ol>
84947
+ <li><p>If <var>navigationId</var> is null, let <var>navigation id</var> be the result of
84948
+ <span>generating a random UUID</span>. <ref spec=UUID></p></li>
84949
+
84926
84950
<li><p>If there is an ongoing attempt to navigate <var>specified browsing context</var>
84927
84951
that has not yet <span data-x="concept-navigate-mature">matured</span> (i.e. it has not passed the
84928
84952
point of making its <code>Document</code> the <span>active document</span>), then cancel that
@@ -84936,7 +84960,13 @@ interface <dfn interface>History</dfn> {
84936
84960
<ol>
84937
84961
<li><p><span>Prompt to unload</span> the <span>active document</span> of the <var>specified
84938
84962
browsing context</var>. If the user <span>refused to allow the document to be
84939
- unloaded</span>, then return.</p></li>
84963
+ unloaded</span>, then invoke <span>WebDriver BiDi navigation failed</span> with
84964
+ with <var>source browsing context</var>, and a <span>WebDriver BiDi navigation status</span>
84965
+ whose <span data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
84966
+ data-x="navigation-status-status">status</span> is "<code
84967
+ data-x="navigation-status-canceled">canceled</code>", and <span
84968
+ data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
84969
+ data-x="concept-request-url">url</span>, then return.</p></li>
84940
84970
84941
84971
<li><p><span data-x="unload a document">Unload</span> the <span>active document</span> of the
84942
84972
<var>specified browsing context</var>.</p></li>
@@ -84945,7 +84975,8 @@ interface <dfn interface>History</dfn> {
84945
84975
84946
84976
<li><p><span>Traverse the history</span> of the <var>specified browsing context</var> to
84947
84977
the <var>specified entry</var> with <var><span>explicitHistoryNavigation</span></var> set to
84948
- true.</p>
84978
+ true, and <span data-x="traverse-history-navigationid">navigation id</span> set to
84979
+ <var>navigationId</var>.</p>
84949
84980
</ol>
84950
84981
</li>
84951
84982
</ol>
@@ -86524,8 +86555,6 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
86524
86555
context</span>'s <span>active window</span> has <span>transient activation</span>; otherwise
86525
86556
false.</p></li>
86526
86557
86527
- <li><p>Let <var>navigationStatus</var> be </li>
86528
-
86529
86558
<li><p>Invoke <span>WebDriver BiDi navigation started</span> with <var>browsingContext</var>, and
86530
86559
a new <span>WebDriver BiDi navigation status</span> whose <span
86531
86560
data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
@@ -87642,7 +87671,8 @@ new PaymentRequest(…); // Allowed to use
87642
87671
<li><p><span>Traverse the history</span> to <var>sessionHistory</var>'s <span>current
87643
87672
entry</span> with <var data-x="traverse-history-hh">historyHandling</var> set to
87644
87673
<var>navigationParams</var>'s <span data-x="navigation-params-hh">history
87645
- handling</span>.</p></li>
87674
+ handling</span>, and <span data-x="traverse-history-navigationid">navigation id</span>
87675
+ set to <var>navigationId</var>.</p></li>
87646
87676
</ol>
87647
87677
</dd>
87648
87678
@@ -87672,7 +87702,9 @@ new PaymentRequest(…); // Allowed to use
87672
87702
87673
87703
<li><p><span>Traverse the history</span> to <var>newEntry</var> with
87674
87704
<var data-x="traverse-history-hh">historyHandling</var> set to "<code
87675
- data-x="hh-replace">replace</code>".</p></li>
87705
+ data-x="hh-replace">replace</code>", and <span
87706
+ data-x="traverse-history-navigationid">navigation id</span> set to <var>navigationId</var>.
87707
+ </p></li>
87676
87708
</ol>
87677
87709
</dd>
87678
87710
@@ -87701,7 +87733,9 @@ new PaymentRequest(…); // Allowed to use
87701
87733
<li><p><span data-x="list append">Append</span> <var>newEntry</var> to
87702
87734
<var>sessionHistory</var>.</p></li>
87703
87735
87704
- <li><p><span>Traverse the history</span> to <var>newEntry</var>.</p></li>
87736
+ <li><p><span>Traverse the history</span> to <var>newEntry</var> with <span
87737
+ data-x="traverse-history-navigationid">navigation id</span> set to <var>navigationId</var>.
87738
+ </p></li>
87705
87739
</ol>
87706
87740
</dd>
87707
87741
</dl>
@@ -88094,18 +88128,11 @@ new PaymentRequest(…); // Allowed to use
88094
88128
mode</span>.</p></li>
88095
88129
88096
88130
<li><p><span>Traverse the history</span> to the new entry, with <var
88097
- data-x="traverse-history-hh">historyHandling</var> set to <var>historyHandling</var> and with
88098
- <var><span>nonBlockingEvents</span></var> set to true. This will <span>scroll to the
88099
- fragment</span> given in what is now the document's <span
88131
+ data-x="traverse-history-hh">historyHandling</var> set to <var>historyHandling</var>,
88132
+ <var><span>nonBlockingEvents</span></var> set to true, and <span
88133
+ data-x="traverse-history-navigationid">navigation id</span> set to <var>navigationId</var>.
88134
+ This will <span>scroll to the fragment</span> given in what is now the document's <span
88100
88135
data-x="concept-document-url">URL</span>.</p></li>
88101
-
88102
- <li><p><p>Invoke <span>WebDriver BiDi fragment navigated</span> with <var>browsingContext</var>,
88103
- and a new <span>WebDriver BiDi navigation status</span> whose <span
88104
- data-x="navigation-status-id">id</span> is <var>navigationId</var>, <span
88105
- data-x="navigation-status-url">url</span> is <var>resource</var>'s <span
88106
- data-x="concept-request-url">url</span>, and <span
88107
- data-x="navigation-status-status">status</span> is "<code
88108
- data-x="navigation-status-complete">complete</code>".</p></li>
88109
88136
</ol>
88110
88137
88111
88138
<p class="note">If the scrolling fails because the relevant <span data-x="concept-id">ID</span> has
@@ -88236,8 +88263,9 @@ new PaymentRequest(…); // Allowed to use
88236
88263
with an optional <span>history handling behavior</span> <dfn
88237
88264
data-x="traverse-history-hh"><var>historyHandling</var></dfn> (default "<code
88238
88265
data-x="hh-default">default</code>"), an optional boolean <dfn><var>nonBlockingEvents</var></dfn>
88239
- (default false), and an optional boolean <dfn><var>explicitHistoryNavigation</var></dfn> (default
88240
- false):</p>
88266
+ (default false), an optional boolean <dfn><var>explicitHistoryNavigation</var></dfn> (default
88267
+ false), optional <span data-x="navigation-id">navigation id</span>
88268
+ <dfn data-x="traverse-history-navigationid"><var>navigationId</var></dfn> (default null):</p>
88241
88269
88242
88270
<p class="note">This algorithm is not just invoked when <span data-x="traverse the history by a
88243
88271
delta">explicitly going back or forwards in the session history</span> — it is also invoked
@@ -88263,11 +88291,12 @@ new PaymentRequest(…); // Allowed to use
88263
88291
<li>
88264
88292
<p><span>Navigate</span><!--DONAV history traversal after eviction--> the <span>browsing
88265
88293
context</span> to <var>request</var> with <var data-x="navigation-hh">historyHandling</var>
88266
- set to "<code data-x="hh-entry-update">entry update</code>" and with <var
88294
+ set to "<code data-x="hh-entry-update">entry update</code>", with <var
88267
88295
data-x="navigation-historypolicycontainer">historyPolicyContainer</var> set to
88268
- <var>entry</var>'s <span data-x="she-policy-container">policy container</span>. The navigation
88269
- must be done using the same <span>source browsing context</span> as was used the first time
88270
- <var>entry</var> was created.</p>
88296
+ <var>entry</var>'s <span data-x="she-policy-container">policy container</span>, and with
88297
+ <span data-x="navigation-navigationid">navigation id</span> set to <var>navigationId</var>.
88298
+ The navigation must be done using the same <span>source browsing context</span> as was
88299
+ used the first time <var>entry</var> was created.</p>
88271
88300
88272
88301
<p class="note">The "<span>navigate</span>" algorithm reinvokes this "traverse" algorithm to
88273
88302
complete the traversal, at which point <var>entry</var>'s <span
@@ -88289,6 +88318,20 @@ new PaymentRequest(…); // Allowed to use
88289
88318
<li><p>Let <var>newDocument</var> be <var>entry</var>'s <span
88290
88319
data-x="she-document">document</span>.</p></li>
88291
88320
88321
+ <li><p>If <var>navigationId</var> is null:</p>
88322
+ <!-- In practice I think the only case that we use the navigation id in subsequent steps is
88323
+ when we have a page loaded from the bfcache, in which case document's navigation id is always null.
88324
+ We could just use null as the navigation id in that case, but it would mean a difference between
88325
+ a WebDriver-initiated history traversal from the bfcache and a UA initated history traversal. -->
88326
+ <ol>
88327
+ <li><p>If <var>newDocument</var>'s <span data-x="concept-document-navigation-id">navigation
88328
+ id</span> is not null, let <var>navigationId</var> be <var>newDocument</var>'s <span
88329
+ data-x="concept-document-navigation-id">navigation id</span>. Otherwise let
88330
+ <var>navigationId</var> be the result of <span>generating a random UUID</span>.
88331
+ <ref spec=UUID></p></li>
88332
+ </ol>
88333
+ </li>
88334
+
88292
88335
<li><p>If <var>newDocument</var> is different than the <span>current entry</span>'s <span
88293
88336
data-x="she-document">document</span>, or <var>historyHandling</var> is "<code
88294
88337
data-x="hh-entry-update">entry update</code>" or "<code data-x="hh-reload">reload</code>",
@@ -88378,6 +88421,14 @@ new PaymentRequest(…); // Allowed to use
88378
88421
<li><p><span>Fire a page transition event</span> named <code
88379
88422
data-x="event-pageshow">pageshow</code> at <var>newDocument</var>'s <span>relevant global
88380
88423
object</span> with true.</p></li>
88424
+
88425
+ <li><p>Invoke <span>WebDriver BiDi page show</span> with <var>newDocument</var>'s
88426
+ <span data-x="concept-document-bc">browsing context</span>, and a new <span>WebDriver BiDi
88427
+ navigation status</span> whose <span data-x="navigation-status-id">id</span> is the
88428
+ <var>navigationId</var>, <span data-x="navigation-status-status">status</span> is
88429
+ "<code data-x="navigation-status-complete">complete</code>", and <span
88430
+ data-x="navigation-status-url">url</span> is the <var>newDocument</var>'s <span
88431
+ data-x="concept-document-url">URL</span>.</p></li>
88381
88432
</ol>
88382
88433
88383
88434
<!-- an interesting thing to test would be to traverse back during onload, before the first
@@ -88450,19 +88501,44 @@ new PaymentRequest(…); // Allowed to use
88450
88501
object</span> to run the following steps instead.</p>
88451
88502
88452
88503
<ol>
88453
- <li><p>If <var>stateChanged</var> is true, then <span data-x="concept-event-fire">fire an
88454
- event</span> named <code data-x="event-popstate">popstate</code> at <var>newDocument</var>'s
88455
- <span>relevant global object</span>, using <code>PopStateEvent</code>, with the <code
88456
- data-x="dom-PopStateEvent-state">state</code> attribute initialized to <var>state</var>.</p></li>
88504
+ <li><p>If <var>stateChanged</var> is true:</p>
88505
+ <ol>
88506
+ <li><p><span data-x="concept-event-fire">Fire an event</span> named <code
88507
+ data-x="event-popstate">popstate</code> at <var>newDocument</var>'s
88508
+ <span>relevant global object</span>, using <code>PopStateEvent</code>, with the <code
88509
+ data-x="dom-PopStateEvent-state">state</code> attribute initialized to <var>state</var>.
88510
+ </p></li>
88511
+
88512
+ <li><p>Invoke <span>WebDriver BiDi pop state</span> with with <var>newDocument</var>'s
88513
+ <span data-x="concept-document-bc">browsing context</span>, and a new <span>WebDriver
88514
+ BiDi navigation status</span> whose <span data-x="navigation-status-id">id</span> is
88515
+ <var>navigationId</var>, <span data-x="navigation-status-url">url</span> is
88516
+ <var>resource</var>'s <span data-x="concept-request-url">url</span>, and <span
88517
+ data-x="navigation-status-status">status</span> is "<code
88518
+ data-x="navigation-status-complete">complete</code>".</p></li>
88519
+ </ol>
88520
+ </li>
88457
88521
88458
88522
<li><p><span>Restore persisted state</span> from <var>entry</var>.</p></li>
88459
88523
88460
- <li><p>If <var>hashChanged</var> is true, then <span data-x="concept-event-fire">fire an
88461
- event</span> named <code data-x="event-hashchange">hashchange</code> at the <span>browsing
88462
- context</span>'s <span>active window</span>, using <code>HashChangeEvent</code>, with the <code
88463
- data-x="dom-HashChangeEvent-oldURL">oldURL</code> attribute initialized to <var>oldURL</var>
88464
- and the <code data-x="dom-HashChangeEvent-newURL">newURL</code> attribute initialized to
88465
- <var>newURL</var>.</p></li>
88524
+ <li><p>If <var>hashChanged</var> is true:</p>
88525
+ <ol>
88526
+ <li><p><span data-x="concept-event-fire">Fire an event</span> named
88527
+ <code data-x="event-hashchange">hashchange</code> at the <span>browsing context</span>'s
88528
+ <span>active window</span>, using <code>HashChangeEvent</code>, with the <code
88529
+ data-x="dom-HashChangeEvent-oldURL">oldURL</code> attribute initialized to <var>oldURL</var>
88530
+ and the <code data-x="dom-HashChangeEvent-newURL">newURL</code> attribute initialized to
88531
+ <var>newURL</var>.</p></li>
88532
+
88533
+ <li><p>Invoke <span>WebDriver BiDi fragment navigated</span> with <var>newDocument</var>'s
88534
+ <span data-x="concept-document-bc">browsing context</span>, and a new <span>WebDriver
88535
+ BiDi navigation status</span> whose <span data-x="navigation-status-id">id</span> is
88536
+ <var>navigationId</var>, <span data-x="navigation-status-url">url</span> is
88537
+ <var>resource</var>'s <span data-x="concept-request-url">url</span>, and <span
88538
+ data-x="navigation-status-status">status</span> is "<code
88539
+ data-x="navigation-status-complete">complete</code>".</p></li>
88540
+ </ol>
88541
+ </li>
88466
88542
</ol>
88467
88543
</li>
88468
88544
</ol>
0 commit comments