tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d48fd8072fbfacc5a6cb4ad24b33d5a3fdc8ae58
parent e159c0550b7654ae65c8f60399c3d0fbbdb67335
Author: Jan-Niklas Jaeschke <jjaschke@mozilla.com>
Date:   Fri, 12 Dec 2025 17:06:33 +0000

Bug 2005771 - Navigation API: Always clear the ongoing navigate event in `CommitNavigateEvent`. r=farre

This patch deliberately breaks pages being able to abort
cross-document navigations using `window.stop()` [0],
in favor of fixing several web compat issues and crashes on reddit.

[0]: https://github.com/whatwg/html/issues/11860

Differential Revision: https://phabricator.services.mozilla.com/D276235

Diffstat:
Mdom/navigation/Navigation.cpp | 1+
Atesting/web-platform/meta/navigation-api/navigate-event/signal-abort-window-stop.html.ini | 3+++
Dtesting/web-platform/meta/navigation-api/navigation-methods/return-value/back-204-205-download.html.ini | 9---------
Dtesting/web-platform/meta/navigation-api/ordering-and-transition/transition-cross-document.html.ini | 7-------
4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/dom/navigation/Navigation.cpp b/dom/navigation/Navigation.cpp @@ -1469,6 +1469,7 @@ struct NavigationWaitForAllScope final : public nsISupports, mNavigation->mOngoingAPIMethodTracker); // Step 11 mAPIMethodTracker->CleanUp(); + mNavigation->mOngoingNavigateEvent = nullptr; } else { // It needs to be ensured that the ongoing navigate event is cleared in // every code path (e.g. for download events), so that we don't keep diff --git a/testing/web-platform/meta/navigation-api/navigate-event/signal-abort-window-stop.html.ini b/testing/web-platform/meta/navigation-api/navigate-event/signal-abort-window-stop.html.ini @@ -0,0 +1,3 @@ +[signal-abort-window-stop.html] + [window.stop() signals event.signal] + expected: FAIL diff --git a/testing/web-platform/meta/navigation-api/navigation-methods/return-value/back-204-205-download.html.ini b/testing/web-platform/meta/navigation-api/navigation-methods/return-value/back-204-205-download.html.ini @@ -1,9 +0,0 @@ -[back-204-205-download.html] - [back() promises to 204s never settle] - expected: FAIL - - [back() promises to 205s never settle] - expected: FAIL - - [back() promises to Content-Disposition: attachment responses never settle] - expected: FAIL diff --git a/testing/web-platform/meta/navigation-api/ordering-and-transition/transition-cross-document.html.ini b/testing/web-platform/meta/navigation-api/ordering-and-transition/transition-cross-document.html.ini @@ -1,7 +0,0 @@ -[transition-cross-document.html] - expected: [OK, CRASH] - [cross-document reload() must leave transition null] - expected: FAIL - - [cross-document navigate() must leave transition null] - expected: FAIL