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
Notes: sideshowbarker 2024-07-16 20:21:48 +09:00
5 changed files with 9 additions and 9 deletions

View file

@ -238,7 +238,7 @@ Optional<float> SVGGraphicsElement::stroke_width() const
CSSPixels viewport_width = 0;
CSSPixels viewport_height = 0;
if (auto* svg_svg_element = shadow_including_first_ancestor_of_type<SVGSVGElement>()) {
if (auto* svg_svg_layout_node = svg_svg_element->layout_node()) {
if (auto svg_svg_layout_node = svg_svg_element->layout_node()) {
viewport_width = svg_svg_layout_node->computed_values().width().to_px(*svg_svg_layout_node, 0);
viewport_height = svg_svg_layout_node->computed_values().height().to_px(*svg_svg_layout_node, 0);
}