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

LibWeb: Make Paintable visit its cached containing block pointer

This was *probably* already safe, but there's no harm in making sure
the cached pointer gets marked during GC.
This commit is contained in:
Andreas Kling 2023-01-11 14:36:27 +01:00
parent 6b4062ab61
commit 811b8a25c2
2 changed files with 3 additions and 1 deletions

View file

@ -14,6 +14,8 @@ void Paintable::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_layout_node);
if (m_containing_block.has_value())
visitor.visit(m_containing_block.value());
}
Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned)

View file

@ -141,7 +141,7 @@ protected:
private:
JS::NonnullGCPtr<Layout::Node> m_layout_node;
Optional<Layout::BlockContainer*> mutable m_containing_block;
Optional<JS::GCPtr<Layout::BlockContainer>> mutable m_containing_block;
};
inline DOM::Node* HitTestResult::dom_node()