Automatic update from web-platform-tests
Revert "[CSS Modules] Update fetching strategy"
This reverts commit f3d832bb043a00e06a160104f60b4f3f0d17f1c0.
Reason for revert: the reverted CL introduced two regressions for CSS
module scripts fetched through a redirect. It moved CSSStyleSheet
creation from fetch completion to module map insertion time, where only
the request URL is known:
1. The module map entry is keyed on the request URL, but the lookup in
ModuleScriptLoader::NotifyFetchFinishedSuccess used the response URL,
so after a redirect the pre-created entry was not found and
CHECK(pre_created) was hit.
2. The sheet's parser context was built from the request URL, so
relative url() references resolved against the pre-redirect directory
rather than the response URL as the spec requires.
Both affect plain `import ... with { type: "css" }`, dynamic import(),
and modulepreload (not just shadowrootadoptedstylesheets) and the crash
masks the base URL bug in a shipping build. Since
shadowrootadoptedstylesheets is on hold, reverting is preferred over
carrying targeted fixes.
In addition to a revert, this change also adds two new test cases that
cover the scenarios listed above, as this is a gap in test coverage that
would have been discovered sooner had tests like these existed.
Bug: 448174611
Change-Id: I904703de1a51701a34a246932b02940eaf5ce3c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8217649
Reviewed-by: Dan Clark <daniec@microsoft.com>
Commit-Queue: Kurt Catti-Schmidt <kschmi@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1676076}
--
wpt-commits: 5a6dab17be629f7a412ff67fc176daf4a9364a67
wpt-pr: 61821