mirror of
https://github.com/servo/servo
synced 2026-04-27 01:55:03 +02:00
script: implement resolve_a_module_integrity_metadata (#42604)
`ImportMap` _integrity_ entry was practically unused, since it is only needed for [resolving a module integrity metadata](https://html.spec.whatwg.org/multipage/#resolving-a-module-integrity-metadata). Now, we correctly initialize `ScriptFetchOptions` when loading a module's descendants. I slightly modified `nonimport-integrity.html` test to run `modulepreload` test cases at the end. Since we haven't an implementation for it, the test timeout, making the test cases that comes after them not run. Testing: More tests start passing Part of #37553 --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
@@ -756,7 +756,7 @@ impl HTMLScriptElement {
|
||||
};
|
||||
|
||||
// Step 29. Fetch options.
|
||||
let options = ScriptFetchOptions {
|
||||
let mut options = ScriptFetchOptions {
|
||||
cryptographic_nonce,
|
||||
integrity_metadata: integrity_metadata.to_owned(),
|
||||
parser_metadata,
|
||||
@@ -842,6 +842,14 @@ impl HTMLScriptElement {
|
||||
}
|
||||
},
|
||||
ScriptType::Module => {
|
||||
// If el does not have an integrity attribute, then set options's integrity metadata to
|
||||
// the result of resolving a module integrity metadata with url and settings object.
|
||||
if integrity_val.is_none() {
|
||||
options.integrity_metadata = global
|
||||
.import_map()
|
||||
.resolve_a_module_integrity_metadata(&url);
|
||||
}
|
||||
|
||||
// Step 31.11. Fetch an external module script graph.
|
||||
fetch_an_external_module_script(
|
||||
url.clone(),
|
||||
|
||||
Reference in New Issue
Block a user