diff options
author | Linus Groh <mail@linusgroh.de> | 2021-02-17 22:52:21 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-17 23:45:07 +0100 |
commit | 0f1da7d40c2ba0724f1b4d461aa1780f19c24bbf (patch) | |
tree | aeb685edbff0a929e31e719d2362c7398d10593e /Userland/Libraries/LibWeb | |
parent | 8c7d1986b80857dc17c5cb4cb9d1ea44ecb39c50 (diff) | |
download | serenity-0f1da7d40c2ba0724f1b4d461aa1780f19c24bbf.zip |
LibWeb: Add constructor to Document IDL interface
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.h | 11 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.idl | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 0f19fefdfd..00a3d00892 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -36,6 +36,7 @@ #include <LibCore/Forward.h> #include <LibJS/Forward.h> #include <LibWeb/Bindings/ScriptExecutionContext.h> +#include <LibWeb/Bindings/WindowObject.h> #include <LibWeb/CSS/StyleResolver.h> #include <LibWeb/CSS/StyleSheet.h> #include <LibWeb/CSS/StyleSheetList.h> @@ -60,7 +61,15 @@ class Document public: using WrapperType = Bindings::DocumentWrapper; - static NonnullRefPtr<Document> create(const URL& url = "about:blank") { return adopt(*new Document(url)); } + static NonnullRefPtr<Document> create(const URL& url = "about:blank") + { + return adopt(*new Document(url)); + } + static NonnullRefPtr<Document> create_with_global_object(Bindings::WindowObject&) + { + return Document::create(); + } + virtual ~Document() override; bool should_invalidate_styles_on_attribute_changes() const { return m_should_invalidate_styles_on_attribute_changes; } diff --git a/Userland/Libraries/LibWeb/DOM/Document.idl b/Userland/Libraries/LibWeb/DOM/Document.idl index bd405a48bb..469a7a557f 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.idl +++ b/Userland/Libraries/LibWeb/DOM/Document.idl @@ -1,5 +1,7 @@ interface Document : Node { + constructor(); + readonly attribute DOMImplementation implementation; readonly attribute DOMString characterSet; |