summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-09 19:04:33 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-09 21:25:10 +0200
commit1864b2b82856b332e323cdf167708abee9667040 (patch)
tree1f3931d6be71cec9a4c438d8a40d9dd0b24b692a /Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h
parent73be7e227b4085964cd9f3a6ef00cd1f5cdf6fb8 (diff)
downloadserenity-1864b2b82856b332e323cdf167708abee9667040.zip
LibWeb: Make HTMLScriptElement create and run ClassicScripts
Before this patch, HTMLScriptElement would cache the full script source text in a String member, and parse that just-in-time via Document's run_javascript() helpers. We now follow the spec more closely and turn the incoming source text into a ClassicScript object ("the script's script" in the spec.)
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h
index 2157a2f894..cf09e27bbc 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -8,6 +8,7 @@
#include <AK/Function.h>
#include <LibWeb/HTML/HTMLElement.h>
+#include <LibWeb/HTML/Scripting/Script.h>
namespace Web::HTML {
@@ -61,8 +62,9 @@ private:
Function<void()> m_script_ready_callback;
- String m_source_text;
String m_script_filename;
+
+ RefPtr<Script> m_script;
};
}