LibWeb: Do not crash if "fill: none" is specified for svg text
This commit is contained in:
parent
e2c5e31292
commit
ca50da63e4
Notes:
sideshowbarker
2024-07-17 08:35:21 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/ca50da63e4 Pull-request: https://github.com/SerenityOS/serenity/pull/19993 Reviewed-by: https://github.com/awesomekling
3 changed files with 12 additions and 0 deletions
8
Tests/LibWeb/Layout/expected/svg/text-fill-none.txt
Normal file
8
Tests/LibWeb/Layout/expected/svg/text-fill-none.txt
Normal 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>
|
1
Tests/LibWeb/Layout/input/svg/text-fill-none.html
Normal file
1
Tests/LibWeb/Layout/input/svg/text-fill-none.html
Normal file
|
@ -0,0 +1 @@
|
|||
<svg><text fill="none"></text></svg>
|
After Width: | Height: | Size: 37 B |
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue