mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +00:00
LibWeb: Start working on spec-aligned HTML scripting semantics
This patch adds HTML::Script and HTML::ClassicScript (subclass of the former.)
This commit is contained in:
parent
612a23d6fc
commit
0839442da5
Notes:
sideshowbarker
2024-07-18 04:22:18 +09:00
Author: https://github.com/awesomekling
Commit: 0839442da5
5 changed files with 105 additions and 0 deletions
29
Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h
Normal file
29
Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Script.h>
|
||||
#include <LibWeb/HTML/Scripting/Script.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#classic-script
|
||||
class ClassicScript final : public Script {
|
||||
public:
|
||||
~ClassicScript();
|
||||
static NonnullRefPtr<ClassicScript> create(URL base_url, RefPtr<JS::Script>);
|
||||
|
||||
JS::Script* script_record() { return m_script_record; }
|
||||
JS::Script const* script_record() const { return m_script_record; }
|
||||
|
||||
private:
|
||||
explicit ClassicScript(URL base_url, RefPtr<JS::Script>);
|
||||
|
||||
RefPtr<JS::Script> m_script_record;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue