mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
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:
committed by
Andrew Kaster
parent
0382933a0a
commit
da18551f10
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user