diff --git a/moli-renderer-v8/src/script_vm/tests/browser_api/navigation/element_navigation.rs b/moli-renderer-v8/src/script_vm/tests/browser_api/navigation/element_navigation.rs index 0117404e9de..ad019f87a0d 100644 --- a/moli-renderer-v8/src/script_vm/tests/browser_api/navigation/element_navigation.rs +++ b/moli-renderer-v8/src/script_vm/tests/browser_api/navigation/element_navigation.rs @@ -1848,10 +1848,8 @@ async fn form_target_blank_preserves_source_referrer_and_relations() { globalThis.results = []; globalThis.channel = new BroadcastChannel("form-popup-relations"); channel.onmessage = event => results.push(event.data); - const html = document.createElement("html"); - const body = document.createElement("body"); - html.appendChild(body); - document.appendChild(html); + const html = document.documentElement || document.appendChild(document.createElement("html")); + const body = document.body || html.appendChild(document.createElement("body")); if ({child_document}) {{ globalThis.frame = document.createElement("iframe"); frame.src = {child_url:?}; @@ -1967,10 +1965,8 @@ async fn popup_navigation_applies_referrer_policy_and_link_overrides() { r#" globalThis.results = []; onmessage = event => results.push(event.data); - const html = document.createElement("html"); - const body = document.createElement("body"); - html.appendChild(body); - document.appendChild(html); + const html = document.documentElement || document.appendChild(document.createElement("html")); + const body = document.body || html.appendChild(document.createElement("body")); const element = document.createElement({tag:?}); element.target = "_blank"; element.rel = "opener"; diff --git a/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/frame_navigation_and_history.rs b/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/frame_navigation_and_history.rs index 423a6c5f38e..0370f377837 100644 --- a/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/frame_navigation_and_history.rs +++ b/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/frame_navigation_and_history.rs @@ -4158,7 +4158,7 @@ fn reattaching_iframe_does_not_resurrect_retired_window_relations() { #[test] fn explicit_about_blank_iframe_variants_reuse_initial_empty_document_synchronously() { - let mut vm = new_storage_test_vm("https://iframe-explicit-initial-blank.test/page.html"); + let mut vm = new_storage_html_test_vm("https://iframe-explicit-initial-blank.test/page.html"); let result = vm .eval( diff --git a/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/window_and_frame_surfaces.rs b/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/window_and_frame_surfaces.rs index 5a39907621b..297ab0f75e9 100644 --- a/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/window_and_frame_surfaces.rs +++ b/moli-renderer-v8/src/script_vm/tests/dom_elements/dom_surface/extracted/window_and_frame_surfaces.rs @@ -2263,7 +2263,7 @@ fn location_ancestor_origins_is_a_stable_document_list_with_a_detached_empty_lis #[test] fn location_ancestor_origins_snapshots_frame_referrer_policy_per_navigation() { - let mut vm = new_storage_test_vm("https://ancestor-policy.test/page.html"); + let mut vm = new_storage_html_test_vm("https://ancestor-policy.test/page.html"); let initial = vm .eval(