1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +00:00

LibWeb: Make Document::paintable() return a ViewportPaintable

This commit is contained in:
Andreas Kling 2023-08-19 09:29:04 +02:00
parent 8bb275f2ea
commit 25375bf1d5
10 changed files with 34 additions and 11 deletions

View file

@ -87,6 +87,7 @@
#include <LibWeb/Layout/Viewport.h>
#include <LibWeb/Namespace.h>
#include <LibWeb/Page/Page.h>
#include <LibWeb/Painting/ViewportPaintable.h>
#include <LibWeb/PermissionsPolicy/AutoplayAllowlist.h>
#include <LibWeb/SVG/SVGElement.h>
#include <LibWeb/SVG/SVGTitleElement.h>
@ -3396,4 +3397,14 @@ void Document::shared_declarative_refresh_steps(StringView input, JS::GCPtr<HTML
}
}
Painting::ViewportPaintable const* Document::paintable() const
{
return static_cast<Painting::ViewportPaintable const*>(Node::paintable());
}
Painting::ViewportPaintable* Document::paintable()
{
return static_cast<Painting::ViewportPaintable*>(Node::paintable());
}
}

View file

@ -210,6 +210,9 @@ public:
Layout::Viewport const* layout_node() const;
Layout::Viewport* layout_node();
Painting::ViewportPaintable const* paintable() const;
Painting::ViewportPaintable* paintable();
void schedule_style_update();
void schedule_layout_update();

View file

@ -1445,6 +1445,13 @@ Painting::Paintable const* Node::paintable() const
return layout_node()->paintable();
}
Painting::Paintable* Node::paintable()
{
if (!layout_node())
return nullptr;
return layout_node()->paintable();
}
Painting::PaintableBox const* Node::paintable_box() const
{
if (!layout_node())

View file

@ -185,6 +185,7 @@ public:
Painting::PaintableBox const* paintable_box() const;
Painting::PaintableBox* paintable_box();
Painting::Paintable const* paintable() const;
Painting::Paintable* paintable();
void set_layout_node(Badge<Layout::Node>, JS::NonnullGCPtr<Layout::Node>);
void detach_layout_node(Badge<Layout::TreeBuilder>);