commit 56e6646cb72b960ce30c7b2f6ae77ee884d44ce0 parent c4fe8d43e866af1f61ee8d290e58b3fde2b5ae8a Author: Adam Vandolder <avandolder@mozilla.com> Date: Wed, 26 Nov 2025 16:34:53 +0000 Bug 2002559 - navigation.entries is empty when entries and events are disabled. r=dom-core,farre Differential Revision: https://phabricator.services.mozilla.com/D274136 Diffstat:
| M | dom/navigation/Navigation.cpp | | | 4 | ++++ |
| D | testing/web-platform/meta/navigation-api/navigation-history-entry/after-detach.html.ini | | | 3 | --- |
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dom/navigation/Navigation.cpp b/dom/navigation/Navigation.cpp @@ -211,6 +211,10 @@ bool Navigation::IsAPIEnabled(JSContext* /* unused */, JSObject* /* unused */) { void Navigation::Entries( nsTArray<RefPtr<NavigationHistoryEntry>>& aResult) const { + if (HasEntriesAndEventsDisabled()) { + aResult.Clear(); + return; + } aResult = mEntries.Clone(); } diff --git a/testing/web-platform/meta/navigation-api/navigation-history-entry/after-detach.html.ini b/testing/web-platform/meta/navigation-api/navigation-history-entry/after-detach.html.ini @@ -1,3 +0,0 @@ -[after-detach.html] - [navigation.currentEntry/entries()/canGoBack/canGoForward after iframe removal] - expected: FAIL