1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

LibWeb: Don't infer SVG viewBox if width and/or height is zero

The fix here has two parts:
1. Don't use the fallback viewBox at all if we're not in SVG-as-image.
2. Don't make a fallback viewBox with zero width and/or height.

This fixes a crash on Bandcamp pages. Thanks Tim Flynn for reporting!
This commit is contained in:
Andreas Kling 2023-06-20 19:55:53 +02:00
parent ffd5b3da16
commit 0ec522ab54
4 changed files with 31 additions and 2 deletions

View file

@ -0,0 +1,4 @@
<img src="svg-with-zero-intrinsic-size-and-no-viewbox.svg">
<svg width=0 height=0>
<rect x=0 y=0 width=1 height=1 />
</svg>

View file

@ -0,0 +1,3 @@
<svg width=0 height=0>
<rect x=0 y=0 width=1 height=1 />
</svg>

After

Width:  |  Height:  |  Size: 68 B