LibWeb: Make NavigableContainerViewport always have a NavigableContainer

Let's not limit this to only corresponding to an HTMLIFrameElement.
This commit is contained in:
Andreas Kling 2024-11-26 12:01:21 +01:00 committed by Andreas Kling
parent 443a8539e9
commit 11d966f3ba
Notes: github-actions[bot] 2024-11-26 17:59:36 +00:00
2 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ namespace Web::Layout {
GC_DEFINE_ALLOCATOR(NavigableContainerViewport);
NavigableContainerViewport::NavigableContainerViewport(DOM::Document& document, DOM::Element& element, CSS::StyleProperties style)
NavigableContainerViewport::NavigableContainerViewport(DOM::Document& document, HTML::NavigableContainer& element, CSS::StyleProperties style)
: ReplacedBox(document, element, move(style))
{
}

View file

@ -6,7 +6,7 @@
#pragma once
#include <LibWeb/HTML/HTMLIFrameElement.h>
#include <LibWeb/HTML/NavigableContainer.h>
#include <LibWeb/Layout/ReplacedBox.h>
namespace Web::Layout {
@ -16,13 +16,13 @@ class NavigableContainerViewport final : public ReplacedBox {
GC_DECLARE_ALLOCATOR(NavigableContainerViewport);
public:
NavigableContainerViewport(DOM::Document&, DOM::Element&, CSS::StyleProperties);
NavigableContainerViewport(DOM::Document&, HTML::NavigableContainer&, CSS::StyleProperties);
virtual ~NavigableContainerViewport() override;
virtual void prepare_for_replaced_layout() override;
const HTML::HTMLIFrameElement& dom_node() const { return verify_cast<HTML::HTMLIFrameElement>(ReplacedBox::dom_node()); }
HTML::HTMLIFrameElement& dom_node() { return verify_cast<HTML::HTMLIFrameElement>(ReplacedBox::dom_node()); }
[[nodiscard]] HTML::NavigableContainer const& dom_node() const { return verify_cast<HTML::NavigableContainer>(ReplacedBox::dom_node()); }
[[nodiscard]] HTML::NavigableContainer& dom_node() { return verify_cast<HTML::NavigableContainer>(ReplacedBox::dom_node()); }
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;