mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +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)
|
Gfx::Path SVGCircleElement::get_path(CSSPixelSize viewport_size)
|
||||||
{
|
{
|
||||||
auto node = layout_node();
|
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 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()));
|
auto cy = float(node->computed_values().cy().to_px(*node, viewport_size.height()));
|
||||||
// Percentages refer to the normalized diagonal of the current SVG viewport
|
// Percentages refer to the normalized diagonal of the current SVG viewport
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
|
||||||
|
<g mask="url(#excludedEndPoints)"></g>
|
||||||
|
<mask id="excludedEndPoints">
|
||||||
|
<circle cx="50" cy="50" r="4" fill="black" stroke="black"/>
|
||||||
|
</mask>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 209 B |
Loading…
Add table
Add a link
Reference in a new issue