LibWeb: Do not crash if "fill: none" is specified for svg text

This commit is contained in:
Aliaksandr Kalenik 2023-07-13 13:41:12 +02:00 committed by Andreas Kling
parent e2c5e31292
commit ca50da63e4
Notes: sideshowbarker 2024-07-17 08:35:21 +09:00
3 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,8 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x163 children: inline
line 0 width: 300, height: 163, bottom: 163, baseline: 13.53125
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,21 300x150]
SVGSVGBox <svg> at (8,21) content-size 300x150 [SVG] children: not-inline
SVGTextBox <text> at (8,21) content-size 0x0 children: not-inline
TextNode <#text>

View File

@ -0,0 +1 @@
<svg><text fill="none"></text></svg>

After

Width:  |  Height:  |  Size: 37 B

View File

@ -31,6 +31,9 @@ void SVGTextPaintable::paint(PaintContext& context, PaintPhase phase) const
if (!is_visible())
return;
if (!layout_node().computed_values().fill().has_value())
return;
SVGGraphicsPaintable::paint(context, phase);
if (phase != PaintPhase::Foreground)