1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:57:45 +00:00

LibWeb: Add BrowsingContext::container_document()

This is the "browsing context container document" from the spec.
This commit is contained in:
Andreas Kling 2021-09-09 02:10:05 +02:00
parent d1100dd6bc
commit 71d7c8a353
2 changed files with 17 additions and 0 deletions

View file

@ -348,4 +348,18 @@ bool BrowsingContext::decrement_cursor_position_offset()
return true;
}
DOM::Document* BrowsingContext::container_document()
{
if (auto* container = this->container())
return &container->document();
return nullptr;
}
DOM::Document const* BrowsingContext::container_document() const
{
if (auto* container = this->container())
return &container->document();
return nullptr;
}
}

View file

@ -91,6 +91,9 @@ public:
void set_frame_nesting_levels(HashMap<URL, size_t> frame_nesting_levels) { m_frame_nesting_levels = move(frame_nesting_levels); };
HashMap<URL, size_t> const& frame_nesting_levels() const { return m_frame_nesting_levels; }
DOM::Document* container_document();
DOM::Document const* container_document() const;
private:
explicit BrowsingContext(Page&, HTML::BrowsingContextContainer*, BrowsingContext& top_level_browsing_context);
explicit BrowsingContext(HTML::BrowsingContextContainer&, BrowsingContext& top_level_browsing_context);