mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
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:
parent
67f659bb85
commit
aede010096
Notes:
sideshowbarker
2024-07-16 20:21:48 +09:00
Author: https://github.com/shannonbooth
Commit: aede010096
Pull-request: https://github.com/SerenityOS/serenity/pull/24187
5 changed files with 9 additions and 9 deletions
|
@ -48,7 +48,7 @@ void SVGCircleElement::apply_presentational_hints(CSS::StyleProperties& style) c
|
|||
|
||||
Gfx::Path SVGCircleElement::get_path(CSSPixelSize viewport_size)
|
||||
{
|
||||
auto* node = layout_node();
|
||||
auto node = layout_node();
|
||||
auto cx = float(node->computed_values().cx().to_px(*node, viewport_size.width()));
|
||||
auto cy = float(node->computed_values().cy().to_px(*node, viewport_size.height()));
|
||||
// Percentages refer to the normalized diagonal of the current SVG viewport
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue