mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:27:34 +00:00
LibWeb: Give Paintable its own pointer to the corresponding DOM node
Instead of going through the layout node's DOM pointer.
This commit is contained in:
parent
216bd513fa
commit
e67ac16862
3 changed files with 21 additions and 2 deletions
|
@ -14,11 +14,27 @@ namespace Web::Painting {
|
|||
void Paintable::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_dom_node);
|
||||
visitor.visit(m_layout_node);
|
||||
if (m_containing_block.has_value())
|
||||
visitor.visit(m_containing_block.value());
|
||||
}
|
||||
|
||||
void Paintable::set_dom_node(JS::GCPtr<DOM::Node> dom_node)
|
||||
{
|
||||
m_dom_node = dom_node;
|
||||
}
|
||||
|
||||
JS::GCPtr<DOM::Node> Paintable::dom_node()
|
||||
{
|
||||
return m_dom_node;
|
||||
}
|
||||
|
||||
JS::GCPtr<DOM::Node const> Paintable::dom_node() const
|
||||
{
|
||||
return m_dom_node;
|
||||
}
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue