mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-07 19:52:55 +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:
parent
0382933a0a
commit
da18551f10
Notes:
github-actions[bot]
2024-11-02 00:56:21 +00:00
Author: https://github.com/shannonbooth
Commit: da18551f10
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1955
Reviewed-by: https://github.com/ADKaster ✅
17 changed files with 164 additions and 155 deletions
|
@ -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)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue