Abort ongoing navigations when firing certain navigate events#11409
Merged
Conversation
In particular, when firing same-document (synchronous) push/replace navigate events, i.e., those originating from history.pushState()/replaceState(), or fragment navigations. This fixes an assertion failure, and better aligns with Chromium's behavior (although, it does so while avoiding a crash bug that Chromium has). Closes #11184.
farre
approved these changes
Jun 27, 2025
farre
left a comment
Contributor
There was a problem hiding this comment.
The only thing I saw needed a fix is the
this means it will signaled to the
phrasing. But that really doesn't need re-reviewing. Thanks!
| </ol> | ||
|
|
||
| <div class="note"> | ||
| <p>If there is an ongoing cross-document navigation, this means it will signaled to the |
|
|
||
| <ol> | ||
| <li> | ||
| <p>If <var>isSameDocument</var> is true:</p> |
Contributor
There was a problem hiding this comment.
Great that you saw that this was the case. Very happy to not add another boolean trap!
Contributor
|
And I absolutely thought that the notes were good, and needed. As for implementation bugs, we've already landed this (albeit using the extra boolean trap) in bug 1974197 and 1973716. I'll probably clean it up and make it align to spec verbatim, but that's not super important currently. |
zcorpan
approved these changes
Jun 27, 2025
6 tasks
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Aug 21, 2025
… DispatchNavigateEvent This updates the logic for aborting an existing navigation when preparing to fire a new navigate even to match the spec update in whatwg/html#11409. It also updates cleanup of the ongoing api method tracker to occur before firing navigatesuccess/navigateerror, so that we do not clobber a new api method tracker if a new navigation is started inside one of those events. Fixed: 419746417, 431135033, 428022635 Change-Id: Ieccbc56085b5763564f19e0b9f11903aeb6ae82c
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
Aug 21, 2025
… DispatchNavigateEvent This updates the logic for aborting an existing navigation when preparing to fire a new navigate even to match the spec update in whatwg/html#11409. It also updates cleanup of the ongoing api method tracker to occur before firing navigatesuccess/navigateerror, so that we do not clobber a new api method tracker if a new navigation is started inside one of those events. Fixed: 419746417, 431135033, 428022635 Change-Id: Ieccbc56085b5763564f19e0b9f11903aeb6ae82c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6622087 Commit-Queue: Nate Chapin <japhet@chromium.org> Auto-Submit: Nate Chapin <japhet@chromium.org> Reviewed-by: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1504655}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Aug 21, 2025
… DispatchNavigateEvent This updates the logic for aborting an existing navigation when preparing to fire a new navigate even to match the spec update in whatwg/html#11409. It also updates cleanup of the ongoing api method tracker to occur before firing navigatesuccess/navigateerror, so that we do not clobber a new api method tracker if a new navigation is started inside one of those events. Fixed: 419746417, 431135033, 428022635 Change-Id: Ieccbc56085b5763564f19e0b9f11903aeb6ae82c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6622087 Commit-Queue: Nate Chapin <japhet@chromium.org> Auto-Submit: Nate Chapin <japhet@chromium.org> Reviewed-by: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1504655}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Aug 21, 2025
… DispatchNavigateEvent This updates the logic for aborting an existing navigation when preparing to fire a new navigate even to match the spec update in whatwg/html#11409. It also updates cleanup of the ongoing api method tracker to occur before firing navigatesuccess/navigateerror, so that we do not clobber a new api method tracker if a new navigation is started inside one of those events. Fixed: 419746417, 431135033, 428022635 Change-Id: Ieccbc56085b5763564f19e0b9f11903aeb6ae82c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6622087 Commit-Queue: Nate Chapin <japhet@chromium.org> Auto-Submit: Nate Chapin <japhet@chromium.org> Reviewed-by: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1504655}
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Aug 28, 2025
…avigation starts a new one in DispatchNavigateEvent, a=testonly Automatic update from web-platform-tests Don't crash if cancelling the previous navigation starts a new one in DispatchNavigateEvent This updates the logic for aborting an existing navigation when preparing to fire a new navigate even to match the spec update in whatwg/html#11409. It also updates cleanup of the ongoing api method tracker to occur before firing navigatesuccess/navigateerror, so that we do not clobber a new api method tracker if a new navigation is started inside one of those events. Fixed: 419746417, 431135033, 428022635 Change-Id: Ieccbc56085b5763564f19e0b9f11903aeb6ae82c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6622087 Commit-Queue: Nate Chapin <japhet@chromium.org> Auto-Submit: Nate Chapin <japhet@chromium.org> Reviewed-by: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#1504655} -- wpt-commits: 6167b9d3c4edc5711b8971230579f3d12814aeb6 wpt-pr: 54449
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In particular, when firing same-document (synchronous) push/replace navigate events, i.e., those originating from history.pushState()/replaceState(), or fragment navigations.
This fixes an assertion failure, and better aligns with Chromium's behavior (although, it does so while avoiding a crash bug that Chromium has).
Closes #11184.
@farre please take a look! I especially welcome thoughts on the notes I added, to see if they're helpful.
(See WHATWG Working Mode: Changes for more details.)
/nav-history-apis.html ( diff )