mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:37:35 +00:00
LibWeb: Give paintables their own pointer to the BrowsingContext
This commit is contained in:
parent
e67ac16862
commit
6b3af92262
2 changed files with 21 additions and 6 deletions
|
@ -11,11 +11,18 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
Paintable::Paintable(Layout::Node const& layout_node)
|
||||
: m_layout_node(layout_node)
|
||||
, m_browsing_context(const_cast<HTML::BrowsingContext&>(layout_node.browsing_context()))
|
||||
{
|
||||
}
|
||||
|
||||
void Paintable::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_dom_node);
|
||||
visitor.visit(m_layout_node);
|
||||
visitor.visit(m_browsing_context);
|
||||
if (m_containing_block.has_value())
|
||||
visitor.visit(m_containing_block.value());
|
||||
}
|
||||
|
@ -35,6 +42,16 @@ JS::GCPtr<DOM::Node const> Paintable::dom_node() const
|
|||
return m_dom_node;
|
||||
}
|
||||
|
||||
HTML::BrowsingContext const& Paintable::browsing_context() const
|
||||
{
|
||||
return m_browsing_context;
|
||||
}
|
||||
|
||||
HTML::BrowsingContext& Paintable::browsing_context()
|
||||
{
|
||||
return m_browsing_context;
|
||||
}
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue