diff options
author | Andreas Kling <kling@serenityos.org> | 2022-08-04 20:13:52 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-05 12:42:46 +0200 |
commit | 2801ddfa76691d8e9ca7fd6030192dea89e9b528 (patch) | |
tree | c28fb9835c2257dabfbe6262823bce21b63ef879 /Userland/Libraries/LibWeb/HTML | |
parent | 8909ef5b90405c38a0b8b9a55e7069656f22b3dc (diff) | |
download | serenity-2801ddfa76691d8e9ca7fd6030192dea89e9b528.zip |
LibWeb: Implement (naive) version of HTMLIFrameElement.contentWindow
This should really return the WindowProxy, but since we don't have the
infrastructure set up just yet, just return the window object itself
for now.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
3 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp index 0b40fc808a..7842d9ffcc 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp @@ -103,4 +103,13 @@ const DOM::Document* BrowsingContextContainer::get_svg_document() const return nullptr; } +HTML::Window* BrowsingContextContainer::content_window() const +{ + // FIXME: This should return the WindowProxy + auto* document = content_document(); + if (!document) + return nullptr; + return const_cast<HTML::Window*>(&document->window()); +} + } diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h index 78b6071d9c..5cdc7ca497 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h @@ -21,6 +21,8 @@ public: const DOM::Document* content_document() const; DOM::Document const* content_document_without_origin_check() const; + HTML::Window* content_window() const; + DOM::Document const* get_svg_document() const; protected: diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl index 3ff48d9b1b..8c25b63df6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl @@ -13,6 +13,9 @@ interface HTMLIFrameElement : HTMLElement { readonly attribute Document? contentDocument; + // FIXME: Should return a WindowProxy? + readonly attribute Window? contentWindow; + [Reflect] attribute DOMString align; [Reflect] attribute DOMString scrolling; [Reflect=frameborder] attribute DOMString frameBorder; |