mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibWeb: Give paintables their own pointer to the BrowsingContext
This commit is contained in:
parent
e67ac16862
commit
6b3af92262
Notes:
sideshowbarker
2024-07-17 00:49:59 +09:00
Author: https://github.com/awesomekling
Commit: 6b3af92262
Pull-request: https://github.com/SerenityOS/serenity/pull/20661
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