Automatic update from web-platform-tests [CSS Modules] Adding WPT's for Import Map statefulness For CSS Modules (https://github.com/whatwg/html/issues/10673), Domenic suggested offline to follow the static behaviors of Import Maps. Specifically that they can't be modified into classic scripts once the Already Started flag is set, that they don't update the underlying import map when innerText changes, and that import map scripts can be created dynamically as long as the Already Started flag has not been set. There are no WPT's specifically testing these behaviors, so this CL adds them. Bug: 449621064 Change-Id: I84ad6a03f4b2f9c5fa80e9d642fb14d7f303d2b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7004710 Reviewed-by: Shunya Shishido <sisidovski@chromium.org> Commit-Queue: Kurt Catti-Schmidt <kschmi@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1526624} -- wpt-commits: a5677a5cf5423c03a8126747688fe832e5356288 wpt-pr: 55291
28 lines
828 B
HTML
28 lines
828 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script type="importmap" id="importMap">
|
|
{
|
|
"imports": {
|
|
"./resources/log.js?pipe=sub&name=A": "./resources/log.js?pipe=sub&name=B"
|
|
}
|
|
}
|
|
</script>
|
|
<script>
|
|
const log = [];
|
|
|
|
promise_test(() => {
|
|
// Import maps are static. Changing their innerText does not change the import
|
|
// map entry.
|
|
const importMap = document.getElementById("importMap");
|
|
importMap.innerText = "";
|
|
|
|
// The following should succeed as if the above lines did nothing.
|
|
return import("./resources/log.js?pipe=sub&name=A")
|
|
.then(() => import("./resources/log.js?pipe=sub&name=B"))
|
|
.then(() => assert_array_equals(log, ["log:B"]))
|
|
},
|
|
"Module map's key is the URL after import map resolution");
|
|
</script>
|