mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:17:46 +00:00
LibWeb: Use width & height to create fallback viewBox for SVG-as-image
When embedding an SVG in an img element, if the external SVG's root element has both width and height attributes, but no viewBox attribute, we now create a fallback viewBox with "0 0 width height". This appears to match the behavior of other browsers. Inspired by discussion on Mozilla's bug tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=614649
This commit is contained in:
parent
a0b4987e92
commit
9f24c1b34c
6 changed files with 66 additions and 2 deletions
|
@ -0,0 +1 @@
|
|||
<!doctype html><img src="svg-without-viewbox.svg" style="display: block; width: 50px;">
|
1
Tests/LibWeb/Layout/input/svg/svg-without-viewbox.svg
Normal file
1
Tests/LibWeb/Layout/input/svg/svg-without-viewbox.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg width="100" height="200" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100" height="200" fill="green" /></svg>
|
After Width: | Height: | Size: 129 B |
Loading…
Add table
Add a link
Reference in a new issue