summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-20 00:58:54 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-20 17:22:25 +0200
commit60d0f041b75b3099bc8437c2f7f80b943667a379 (patch)
treead35bd070f1a2b539fe941f50a13c2cb1bded0fc /Userland
parentbcfb07bc303e3f3a25318f6f76ab1f70db005dad (diff)
downloadserenity-60d0f041b75b3099bc8437c2f7f80b943667a379.zip
LibWeb: Use Document::realm() in HTMLScriptElement::prepare_script()
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
index 57be9a6745..7f49301239 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
@@ -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;