mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 07:09:47 +00:00
LibWeb/SVG: Work around no layout node in SVGCircleElement::get_path
This is clearly not the correct fix, but instead of crashing let's log an error and bail. Works around a crash seen on both: * https://reddit.com * https://www.w3.org/TR/web-animations-1 (#879)
This commit is contained in:
parent
c85df78c4c
commit
b8adf193f5
Notes:
github-actions[bot]
2025-03-17 19:11:03 +00:00
Author: https://github.com/shannonbooth
Commit: b8adf193f5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3964
2 changed files with 11 additions and 0 deletions
|
@ -61,6 +61,11 @@ void SVGCircleElement::apply_presentational_hints(GC::Ref<CSS::CascadedPropertie
|
|||
Gfx::Path SVGCircleElement::get_path(CSSPixelSize viewport_size)
|
||||
{
|
||||
auto node = layout_node();
|
||||
if (!node) {
|
||||
dbgln("FIXME: Null layout node in SVGCircleElement::get_path");
|
||||
return {};
|
||||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue