mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 01:01:54 +00:00
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.)
This commit is contained in:
parent
73be7e227b
commit
1864b2b828
Notes:
sideshowbarker
2024-07-18 04:22:02 +09:00
Author: https://github.com/awesomekling
Commit: 1864b2b828
2 changed files with 30 additions and 12 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue