LibWeb: Implement more steps in 'fetching a single module script'

By using fetch, the request now also follows redirects, which in the end
makes the 'Polyfilled Features' section on
https://github.github.com/browser-support/ load :^)
This commit is contained in:
Karol Kosek 2023-08-09 01:14:51 +02:00 committed by Tim Flynn
parent 6354f950fd
commit 7fa5dd7a92
Notes: sideshowbarker 2024-07-17 05:01:20 +09:00
3 changed files with 110 additions and 63 deletions

View file

@ -397,8 +397,7 @@ void HTMLScriptElement::prepare_script()
// -> "module"
else if (m_script_type == ScriptType::Module) {
// Fetch an external module script graph given url, settings object, options, and onComplete.
// FIXME: Pass options.
fetch_external_module_script_graph(url, settings_object, move(on_complete));
fetch_external_module_script_graph(realm(), url, settings_object, options, move(on_complete));
}
}
@ -424,7 +423,7 @@ void HTMLScriptElement::prepare_script()
// 2. Fetch an inline module script graph, given source text, base URL, settings object, options, and with the following steps given result:
// FIXME: Pass options
fetch_inline_module_script_graph(m_document->url().to_deprecated_string(), source_text, base_url, document().relevant_settings_object(), [this](auto result) {
fetch_inline_module_script_graph(realm(), m_document->url().to_deprecated_string(), source_text, base_url, document().relevant_settings_object(), [this](auto result) {
// 1. Mark as ready el given result.
if (!result)
mark_as_ready(ResultState::Null {});