commit 7661725521e87c2388fa63c7bfeedc33034b3d90
parent aaf8cb5f422352982012cd9a31928414178f7097
Author: Adam Vandolder <avandolder@mozilla.com>
Date: Mon, 17 Nov 2025 16:57:10 +0000
Bug 1999668 - Allow currententrychange events to have null from fields. r=dom-core,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D272697
Diffstat:
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/dom/base/test/mochitest.toml b/dom/base/test/mochitest.toml
@@ -1313,6 +1313,8 @@ skip-if = [
["test_named_frames.html"]
+["test_navigate_window_open_aboutblank.html"]
+
["test_navigatorPrefOverride.html"]
["test_navigator_cookieEnabled.html"]
diff --git a/dom/base/test/test_navigate_window_open_aboutblank.html b/dom/base/test/test_navigate_window_open_aboutblank.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script src="/tests/SimpleTest/EventUtils.js"></script>
+<link rel="stylesheet" href="/tests/SimpleTest/test.css">
+<script>
+ SimpleTest.requestFlakyTimeout("Needed to wait for opened window to fully finish loading before navigating it.");
+
+ add_task(async function navigateWindowOpenedExplicitAboutBlank() {
+ let w = window.open("about:blank");
+
+ await new Promise(resolve => setTimeout(() => {
+ w.location = "about:blank#0";
+ ok(true, "setting location did not lead to a crash");
+ resolve();
+ }, 1000));
+ });
+</script>
diff --git a/dom/webidl/NavigationCurrentEntryChangeEvent.webidl b/dom/webidl/NavigationCurrentEntryChangeEvent.webidl
@@ -12,10 +12,12 @@ interface NavigationCurrentEntryChangeEvent : Event {
constructor(DOMString type, NavigationCurrentEntryChangeEventInit eventInitDict);
readonly attribute NavigationType? navigationType;
- readonly attribute NavigationHistoryEntry from;
+ // Allow `from` to be null, unlike the spec: see bug 1999668
+ readonly attribute NavigationHistoryEntry? from;
};
dictionary NavigationCurrentEntryChangeEventInit : EventInit {
NavigationType? navigationType = null;
- required NavigationHistoryEntry from;
+ // Allow `from` to be null, unlike the spec: see bug 1999668
+ required NavigationHistoryEntry? from;
};