From cf7e6e8b3e7310c826eeccdfd07d9522080a38b9 Mon Sep 17 00:00:00 2001 From: ldm0 Date: Wed, 9 Sep 2026 08:31:31 +0800 Subject: [PATCH] fix(document): initialize child navigation readiness --- moli-core/tests/scripts.rs | 3 + .../tests/scripts/child_error_insertion.rs | 9 +- moli-core/tests/scripts/child_readiness.rs | 86 +++++++++++++++++++ .../context_host/child_documents/commit.rs | 9 +- .../src/runtime/page_vm/tests/mod.rs | 6 +- 5 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 moli-core/tests/scripts/child_readiness.rs diff --git a/moli-core/tests/scripts.rs b/moli-core/tests/scripts.rs index 1b37ef655d..5e7f9cf08b 100644 --- a/moli-core/tests/scripts.rs +++ b/moli-core/tests/scripts.rs @@ -22,6 +22,9 @@ mod preparation_errors; #[path = "scripts/child_error_insertion.rs"] mod child_error_insertion; +#[path = "scripts/child_readiness.rs"] +mod child_readiness; + fn diagnostic_global<'a>( page: &'a moli_core::page::Page, name: &str, diff --git a/moli-core/tests/scripts/child_error_insertion.rs b/moli-core/tests/scripts/child_error_insertion.rs index a089a056a3..d9521bc783 100644 --- a/moli-core/tests/scripts/child_error_insertion.rs +++ b/moli-core/tests/scripts/child_error_insertion.rs @@ -28,7 +28,7 @@ async fn child_script_error_write_probe( parent.childErrorObserved({text: document.body.textContent, currentScriptIsNull: document.currentScript === null, tailMissing: document.getElementById('tail') === null, - eventType: event.type, + readyState: document.readyState, eventType: event.type, nestedRan: globalThis.nestedRan === true}); }`; frame.srcdoc = '