LibWeb: Use GCPtr for Element::layout_node

This improves debuggability by converting a SIGSEGV into a
verification failed on a null dereference.
This commit is contained in:
Shannon Booth
2024-05-02 22:32:44 +12:00
committed by Andreas Kling
parent 67f659bb85
commit aede010096
5 changed files with 9 additions and 9 deletions

View File

@@ -2070,12 +2070,12 @@ void Element::for_each_attribute(Function<void(FlyString const&, String const&)>
});
}
Layout::NodeWithStyle* Element::layout_node()
JS::GCPtr<Layout::NodeWithStyle> Element::layout_node()
{
return static_cast<Layout::NodeWithStyle*>(Node::layout_node());
}
Layout::NodeWithStyle const* Element::layout_node() const
JS::GCPtr<Layout::NodeWithStyle const> Element::layout_node() const
{
return static_cast<Layout::NodeWithStyle const*>(Node::layout_node());
}