From bb0d047cab9ef9719f022370348afa99062e92bc Mon Sep 17 00:00:00 2001 From: ldm0 Date: Fri, 17 Jul 2026 02:05:04 +0800 Subject: [PATCH] fix(import-maps): merge maps after module loading --- .../wpt-cross-current/failed-cases.txt | 2 - .../wpt-cross-current/passed-cases.txt | 2 + ...c_async_module_allows_late_importmap.html} | 4 +- ...applies_after_dynamic_module_prepare.html} | 4 +- ...module_allows_late_dynamic_importmap.html} | 4 +- moli-core/tests/scripts.rs | 21 +++--- moli-import-map/src/lib.rs | 12 +++- .../src/document_runtime/mutation_commands.rs | 2 +- .../script_scheduling/module_facade.rs | 10 +++ moli-renderer-v8/src/host/scripts.rs | 10 +-- moli-renderer-v8/src/host/scripts/runtime.rs | 17 +++-- moli-renderer-v8/src/host/scripts/tests.rs | 10 ++- moli-renderer-v8/src/host_bindings.rs | 2 +- .../context_host/main_document_lifecycle.rs | 36 ++++++++++- .../tests/browser_api/trusted_types.rs | 64 +++++++++++++++++++ moli-test-support/src/lib.rs | 12 ++-- moli-test-support/src/routes_core.rs | 13 ++-- moli-test-support/src/server_routes.rs | 12 ++-- 18 files changed, 181 insertions(+), 56 deletions(-) rename moli-core/tests/fixtures/runtime/{dynamic_async_module_closes_importmap_acquisition.html => dynamic_async_module_allows_late_importmap.html} (91%) rename moli-core/tests/fixtures/runtime/{parser_owned_importmap_blocked_after_dynamic_module_prepare.html => parser_owned_importmap_applies_after_dynamic_module_prepare.html} (86%) rename moli-core/tests/fixtures/runtime/{importmap_closed_by_parser_owned_module_before_late_dynamic_map.html => parser_owned_module_allows_late_dynamic_importmap.html} (89%) diff --git a/moli-benchmark/wpt-cross-current/failed-cases.txt b/moli-benchmark/wpt-cross-current/failed-cases.txt index 5c7e4bae2f..7ae61457b5 100644 --- a/moli-benchmark/wpt-cross-current/failed-cases.txt +++ b/moli-benchmark/wpt-cross-current/failed-cases.txt @@ -3704,8 +3704,6 @@ trusted-types/eval-function-constructor-untrusted-arguments-and-applying-default trusted-types/inheriting-csp-for-local-schemes.html trusted-types/modify-attributes-in-callback.html trusted-types/require-trusted-types-for-TypeError-belongs-to-the-global-object-realm.html -trusted-types/script-enforcement-006.html -trusted-types/script-enforcement-007.html trusted-types/script-enforcement-010.html trusted-types/script-enforcement-011.html trusted-types/set-attributes-require-trusted-types-default-policy.html diff --git a/moli-benchmark/wpt-cross-current/passed-cases.txt b/moli-benchmark/wpt-cross-current/passed-cases.txt index db0b58cfc7..be76967758 100644 --- a/moli-benchmark/wpt-cross-current/passed-cases.txt +++ b/moli-benchmark/wpt-cross-current/passed-cases.txt @@ -7869,6 +7869,8 @@ trusted-types/script-enforcement-002.html trusted-types/script-enforcement-003.html trusted-types/script-enforcement-004.html trusted-types/script-enforcement-005.html +trusted-types/script-enforcement-006.html +trusted-types/script-enforcement-007.html trusted-types/script-enforcement-012.html trusted-types/script-enforcement-013.html trusted-types/script-enforcement-014.html diff --git a/moli-core/tests/fixtures/runtime/dynamic_async_module_closes_importmap_acquisition.html b/moli-core/tests/fixtures/runtime/dynamic_async_module_allows_late_importmap.html similarity index 91% rename from moli-core/tests/fixtures/runtime/dynamic_async_module_closes_importmap_acquisition.html rename to moli-core/tests/fixtures/runtime/dynamic_async_module_allows_late_importmap.html index dc39b3a742..b4ec6db6ce 100644 --- a/moli-core/tests/fixtures/runtime/dynamic_async_module_closes_importmap_acquisition.html +++ b/moli-core/tests/fixtures/runtime/dynamic_async_module_allows_late_importmap.html @@ -2,9 +2,9 @@