script: Pass &mut JSContext to navigate (#43713)

Also move the related `navigate_to_fragment` method next to it.

Part of #40600

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2026-03-27 18:11:22 +01:00
committed by GitHub
parent 9dbe608558
commit f7876c3db8
9 changed files with 67 additions and 83 deletions

View File

@@ -1095,7 +1095,7 @@ impl HTMLFormElement {
// given the form element and the following steps:
let form = Trusted::new(self);
let window = Trusted::new(target);
let task = task!(navigate_to_form_planned_navigation: move || {
let task = task!(navigate_to_form_planned_navigation: move |cx| {
// 4.1 Set the form's planned navigation to null.
// Note: we implement the equivalent by incrementing the counter above,
// and checking it here.
@@ -1111,11 +1111,11 @@ impl HTMLFormElement {
// 4.2 Navigate targetNavigable to url
navigate(
cx,
&window.root(),
NavigationHistoryBehavior::Push,
false,
load_data,
CanGc::note(),
);
});