Skip to content

Commit

Permalink
Update the navigation API when a same-document reload occurs
Browse files Browse the repository at this point in the history
When performing a same-document reload (i.e. a JS API reload intercepted by the navigation API), the navigation API entries need to be updated to reflect the new state.

Note that popstate and other traversal-related side effects do not occur.

Closes #10621.
  • Loading branch information
noamr authored Feb 20, 2025
1 parent 81fa58f commit 3a2a05d
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -96774,20 +96774,18 @@ interface <dfn interface>NavigationDestination</dfn> {
data-x="concept-NavigateEvent-classic-history-API-state">classic history API state</span> and
<i data-x="uhus-historyHandling">historyHandling</i> set to <var>navigationType</var>.</p>

<div class="note">
<p>If <var>navigationType</var> is "<code data-x="dom-NavigationType-reload">reload</code>",
then we are converting a <span>reload</span> into a "same-document reload", for which the
<span>URL and history update steps</span> are not appropriate. Navigation API-related stuff
still happens, such as updating the <span data-x="nav-active-history-entry">active session
history entry</span>'s <span data-x="she-navigation-api-state">navigation API state</span> if
this was caused by a call to <code data-x="dom-Navigation-reload">navigation.reload()</code>,
and all the <a href="#ongoing-navigation-tracking">ongoing navigation tracking</a>.</p>

<p>If <var>navigationType</var> is "<code
data-x="dom-NavigationType-traverse">traverse</code>", then this event firing is happening as
part of <span data-x="apply the traverse history step">the traversal process</span>, and that
process will take care of performing the appropriate session history entry updates.</p>
</div>
<li>
<p>Otherwise, if <var>navigationType</var> is "<code
data-x="dom-NavigationType-reload">reload</code>", then
<span>update the navigation API entries for a same-document navigation</span> given
<var>navigation</var>, <var>navigable</var>'s <span
data-x="nav-active-history-entry">active session history entry</span>, and "<code
data-x="dom-NavigationType-reload">reload</code>".</p>

<p class="note">If <var>navigationType</var> is "<code
data-x="dom-NavigationType-traverse">traverse</code>", then this event firing is happening as
part of <span data-x="apply the traverse history step">the traversal process</span>, and that
process will take care of performing the appropriate session history entry updates.</p>
</li>
</ol>
</li>
Expand Down

0 comments on commit 3a2a05d

Please sign in to comment.