1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

LibWeb: Add Bindings::ScriptExecutionContext

This will be inherited by documents and workers, to provide a common
abstraction for script execution. (We don't have workers yet, but we
might as well make this little space for them now to simplify things
down the road.)
This commit is contained in:
Andreas Kling 2020-09-20 19:22:44 +02:00
parent 976e55e942
commit c6ae0c41d9
11 changed files with 100 additions and 8 deletions

View file

@ -35,6 +35,7 @@
#include <AK/WeakPtr.h>
#include <LibCore/Forward.h>
#include <LibJS/Forward.h>
#include <LibWeb/Bindings/ScriptExecutionContext.h>
#include <LibWeb/CSS/StyleResolver.h>
#include <LibWeb/CSS/StyleSheet.h>
#include <LibWeb/CSS/StyleSheetList.h>
@ -51,7 +52,8 @@ enum class QuirksMode {
class Document
: public ParentNode
, public NonElementParentNode<Document> {
, public NonElementParentNode<Document>
, public Bindings::ScriptExecutionContext {
public:
using WrapperType = Bindings::DocumentWrapper;
@ -131,7 +133,7 @@ public:
const String& source() const { return m_source; }
void set_source(const String& source) { m_source = source; }
JS::Interpreter& interpreter();
virtual JS::Interpreter& interpreter() override;
JS::Value run_javascript(const StringView&);