summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-01-11 14:36:27 +0100
committerAndreas Kling <kling@serenityos.org>2023-01-11 14:36:27 +0100
commit811b8a25c2e508a1a515e1ba275b6f9588a9b876 (patch)
tree3e405c0c3f3065da1c47f12b816e6a26e3fa0f77 /Userland/Libraries/LibWeb/Painting
parent6b4062ab61ea1e4720577bb82e1b48fc59771b7c (diff)
downloadserenity-811b8a25c2e508a1a515e1ba275b6f9588a9b876.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
-rw-r--r--Userland/Libraries/LibWeb/Painting/Paintable.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Painting/Paintable.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.cpp b/Userland/Libraries/LibWeb/Painting/Paintable.cpp
index 61ce2b96c9..59ececf2f8 100644
--- a/Userland/Libraries/LibWeb/Painting/Paintable.cpp
+++ b/Userland/Libraries/LibWeb/Painting/Paintable.cpp
@@ -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)
diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.h b/Userland/Libraries/LibWeb/Painting/Paintable.h
index 9214208313..026b77d27d 100644
--- a/Userland/Libraries/LibWeb/Painting/Paintable.h
+++ b/Userland/Libraries/LibWeb/Painting/Paintable.h
@@ -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()