1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibWeb: Test layout of standalone SVG document: edge cases

Tests with different combinations of missing width, height
and viewBox.

All tests confirmed to work on Ladybird:
 - exactly the same as Chromium (131.0.6778.85)
 - almost the same as Firefox (129.0.2)
    - only difference: standalone-w.svg: same size, different alignment
This commit is contained in:
Manuel Zahariev 2024-12-05 20:44:44 -08:00 committed by Sam Atkins
parent 5d77104c2f
commit 5d85f3a5c8
Notes: github-actions[bot] 2024-12-13 15:03:48 +00:00
14 changed files with 181 additions and 0 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,18 @@
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 32x64 children: not-inline
TextNode <#text>
SVGGraphicsBox <g> at (0,0) content-size 32x64 children: inline
TextNode <#text>
SVGGeometryBox <path> at (0,0) content-size 32x64 children: not-inline
TextNode <#text>
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600]
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 128x256]
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 32x64]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [0,0 32x64]
SVGPathPaintable (SVGGeometryBox<path>) [0,0 32x64]

View file

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

View file

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

View file

@ -0,0 +1,7 @@
<svg viewBox="0 0 32 64" width="128" xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue; no height</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: 270 B

View file

@ -0,0 +1,7 @@
<svg width="128" xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue; no viewBox; no height</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: 262 B

View file

@ -0,0 +1,7 @@
<svg height="256" xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue; no viewBox; no width</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: 262 B

View file

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue; no viewBox; no width; no height</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: 260 B

View file

@ -0,0 +1,7 @@
<svg width="128" height="256" xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue; no viewBox</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: 264 B

View file

@ -0,0 +1,13 @@
<!--
This will display identical on Ladybird and Chromium (131.0.6778.85) (centered), but left-aligned on Firefox (129.0.2)
Guessing Firefox has it right; no reason why missing height should align center (see standalone.svg where all left align)
Suggestion: not a priority, since it works the same as chromium
Likely a result of settings in Default.css
-->
<svg viewBox="0 0 32 64" height="256" xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue; no width</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: 643 B

View file

@ -0,0 +1,7 @@
<svg viewBox="0 0 32 64" xmlns="http://www.w3.org/2000/svg">
<title>white diamond on blue; no width ; no height</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: 269 B