mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Use Document::realm() in HTMLScriptElement::prepare_script()
This commit is contained in:
parent
bcfb07bc30
commit
60d0f041b7
Notes:
sideshowbarker
2024-07-18 05:01:22 +09:00
Author: https://github.com/awesomekling
Commit: 60d0f041b7
1 changed files with 2 additions and 7 deletions
|
@ -300,11 +300,9 @@ void HTMLScriptElement::prepare_script()
|
|||
dbgln("HTMLScriptElement: Failed to load {}", url);
|
||||
return;
|
||||
}
|
||||
// FIXME: This is a hack to ensure that there's a global object.
|
||||
document().interpreter();
|
||||
|
||||
// FIXME: This is all ad-hoc and needs work.
|
||||
auto script = ClassicScript::create(url.to_string(), data, document().interpreter().realm(), AK::URL());
|
||||
auto script = ClassicScript::create(url.to_string(), data, document().realm(), AK::URL());
|
||||
|
||||
// When the chosen algorithm asynchronously completes, set the script's script to the result. At that time, the script is ready.
|
||||
m_script = script;
|
||||
|
@ -327,11 +325,8 @@ void HTMLScriptElement::prepare_script()
|
|||
// -> "classic"
|
||||
// 1. Let script be the result of creating a classic script using source text, settings object, base URL, and options.
|
||||
|
||||
// FIXME: This is a hack to ensure that there's a global object.
|
||||
document().interpreter();
|
||||
|
||||
// FIXME: Pass settings, base URL and options.
|
||||
auto script = ClassicScript::create(m_document->url().to_string(), source_text, document().interpreter().realm(), AK::URL());
|
||||
auto script = ClassicScript::create(m_document->url().to_string(), source_text, document().realm(), AK::URL());
|
||||
|
||||
// 2. Set the script's script to script.
|
||||
m_script = script;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue