LibWeb: Test layout of standalone SVG document: main use case

SVG document with specified width and height attributes is layed out
with this width/height.
This commit is contained in:
Manuel Zahariev 2024-12-05 20:41:16 -08:00 committed by Sam Atkins
commit 5d77104c2f
Notes: github-actions[bot] 2024-12-13 15:03:56 +00:00
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,17 @@
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: not-inline
SVGSVGBox <svg> at (0,0) content-size 128x256 [SVG] children: inline
TextNode <#text>
TextNode <#text>
SVGGeometryBox <rect> at (0,0) content-size 128x256 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,0) content-size 128x256 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,0) content-size 128x256 children: not-inline
TextNode <#text>
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 128x256]
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 128x256]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,0 128x256]
SVGPathPaintable (SVGGeometryBox<path>) [0,0 128x256]

View file

@ -0,0 +1,7 @@
<svg viewBox="0 0 32 64" width="128" height="256" xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue</title>
<rect x="0" y="0" width="32" height="64" fill="blue"/>
<g fill="white">
<path d="M16 0 L32 32 L16 64 L0 32 Z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 272 B