LibWeb: Support SRI for import maps

See:
- https://github.com/whatwg/html/commit/b2fdca1
This commit is contained in:
Jamie Mansfield
2024-06-01 11:25:58 +01:00
committed by Tim Ledbetter
parent 124779a376
commit bab086694a
6 changed files with 127 additions and 17 deletions

View File

@@ -416,6 +416,10 @@ void HTMLScriptElement::prepare_script()
}
// -> "module"
else if (m_script_type == 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 (!has_attribute(HTML::AttributeNames::integrity))
options.integrity_metadata = MUST(resolve_a_module_integrity_metadata(url, settings_object));
// Fetch an external module script graph given url, settings object, options, and onComplete.
fetch_external_module_script_graph(realm(), url, settings_object, options, on_complete);
}