LibWeb: Change HTML::Script to hold a realm instead of settings object

This is part of a refactor needed for introduction of the shadow realm
proposal in the web platform.
This commit is contained in:
Shannon Booth 2024-10-25 16:27:26 +13:00 committed by Andrew Kaster
parent 0382933a0a
commit da18551f10
Notes: github-actions[bot] 2024-11-02 00:56:21 +00:00
17 changed files with 164 additions and 155 deletions

View file

@ -159,6 +159,7 @@ void HTMLScriptElement::execute_script()
}
// https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script
// https://whatpr.org/html/9893/scripting.html#prepare-a-script
void HTMLScriptElement::prepare_script()
{
// 1. If el's already started is true, then return.
@ -433,9 +434,9 @@ void HTMLScriptElement::prepare_script()
// 2. Switch on el's type:
// -> "classic"
if (m_script_type == ScriptType::Classic) {
// 1. Let script be the result of creating a classic script using source text, settings object, base URL, and options.
// 1. Let script be the result of creating a classic script using source text, settings object's realm, base URL, and options.
// FIXME: Pass options.
auto script = ClassicScript::create(m_document->url().to_byte_string(), source_text, settings_object, base_url, m_source_line_number);
auto script = ClassicScript::create(m_document->url().to_byte_string(), source_text, settings_object.realm(), base_url, m_source_line_number);
// 2. Mark as ready el given script.
mark_as_ready(Result(move(script)));