Skip to content

Conversation

@llannasatoll
Copy link

@llannasatoll llannasatoll commented Oct 8, 2025

This change adds an optimization to the navigate algorithm to ignore duplicate navigations.

As proposed in #11743, this prevents an ongoing navigation from being unnecessarily canceled by a new, identical navigation that is initiated in quick succession (e.g., from an accidental double-click).


/browsing-the-web.html ( diff )
/document-sequences.html ( diff )
/dom.html ( diff )

source Outdated
<var>userInvolvement</var>, and <var>historyHandling</var>;</p>
</li>
<li>
<p>the ongoing navigation's <span>active document</span>'s "navigation conditions potentially changed" flag is false,</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "navigation conditions potentially changed" flag should be a property of the "navigable" instead of on the active document, declared here. It should be associated with the ongoing navigation, which means we set it to false whenever we set the ongoing navigation is set / reset. Then in https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie mention that setting the cookie will set the flag to false, and add a note that other cookie-setting operations such as the Cookie Store API and setting non-HTTP only cookies via fetch can also set the flag to false.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! The "navigation conditions potentially changed" flag is now on navigable and is reset at the start of each navigation. Modifying document.cookie sets this flag to true, and the note about other cookie-setting operations has been added.

@llannasatoll llannasatoll force-pushed the ignore-duplicate-navigation branch from 27be0e6 to 4d255eb Compare November 17, 2025 05:05
@llannasatoll llannasatoll requested a review from rakina November 17, 2025 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants