LibWeb: Support SRI for import maps

See:
- b2fdca1
This commit is contained in:
Jamie Mansfield 2024-06-01 11:25:58 +01:00 committed by Tim Ledbetter
parent 124779a376
commit bab086694a
Notes: github-actions[bot] 2024-08-14 20:07:19 +00:00
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);
}