summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-21 21:24:11 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-21 21:32:16 +0100
commit15cfde7233ff65a1c510b19ce905d2d6e6518e3b (patch)
treed9a924b848b7fd73d1ed56ae0ca4a1a260f25edf /Userland/Libraries/LibWeb/DOM
parent7f66a4e3ba143ce984f52b63eb0e9d71d70fa20b (diff)
downloadserenity-15cfde7233ff65a1c510b19ce905d2d6e6518e3b.zip
LibWeb: Expose the Window object as Document.defaultView
This should really be a WindowProxy? but since we don't have anything representing that concept yet, let's just expose the Window object directly so document.defaultView.foo works. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h2
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.idl2
2 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index f39588dd2d..63264eae05 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -214,6 +214,8 @@ public:
Window& window() { return *m_window; }
+ Window* default_view() { return m_window; }
+
const String& content_type() const { return m_content_type; }
void set_content_type(const String& content_type) { m_content_type = content_type; }
diff --git a/Userland/Libraries/LibWeb/DOM/Document.idl b/Userland/Libraries/LibWeb/DOM/Document.idl
index 469a7a557f..a25d882c7a 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.idl
+++ b/Userland/Libraries/LibWeb/DOM/Document.idl
@@ -9,6 +9,8 @@ interface Document : Node {
readonly attribute DOMString inputEncoding;
readonly attribute DOMString contentType;
+ readonly attribute Window? defaultView;
+
Element? getElementById(DOMString id);
ArrayFromVector getElementsByName(DOMString name);
ArrayFromVector getElementsByTagName(DOMString tagName);