mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:22:07 +00:00

Previously, we were handling viewBoxes/viewports in a slightly hacky way, asking graphics elements to figure out what viewBox to use during layout. This does not work in all cases, and can't allow for more complex SVGs where it is possible to have nested viewports. This commit makes the SVGFormattingContext keep track of the viewport/boxes, and it now lays out each viewport recursively, where each nested `<svg>` or `<symbol>` can establish a new viewport. This fixes some previous edge cases, and starts to allow nested viewports (there's still some issues to resolve there). Fixes #22931
26 lines
1.5 KiB
Text
26 lines
1.5 KiB
Text
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 784x200 children: inline
|
|
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 200x200] baseline: 200
|
|
SVGSVGBox <svg#a> at (8,8) content-size 200x200 [SVG] children: inline
|
|
TextNode <#text>
|
|
SVGSVGBox <svg#b> at (8,8) content-size 200x200 [SVG] children: inline
|
|
TextNode <#text>
|
|
SVGSVGBox <svg#c> at (8,8) content-size 266.671875x266.671875 [SVG] children: inline
|
|
TextNode <#text>
|
|
SVGGeometryBox <rect> at (34.671875,34.671875) content-size 266.671875x266.671875 children: not-inline
|
|
TextNode <#text>
|
|
SVGGeometryBox <rect> at (34.671875,34.671875) content-size 133.328125x133.328125 children: not-inline
|
|
TextNode <#text>
|
|
TextNode <#text>
|
|
TextNode <#text>
|
|
TextNode <#text>
|
|
|
|
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
|
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
|
PaintableWithLines (BlockContainer<BODY>) [8,8 784x200]
|
|
SVGSVGPaintable (SVGSVGBox<svg>#a) [8,8 200x200]
|
|
SVGSVGPaintable (SVGSVGBox<svg>#b) [8,8 200x200]
|
|
SVGSVGPaintable (SVGSVGBox<svg>#c) [8,8 266.671875x266.671875]
|
|
SVGPathPaintable (SVGGeometryBox<rect>) [34.671875,34.671875 266.671875x266.671875]
|
|
SVGPathPaintable (SVGGeometryBox<rect>) [34.671875,34.671875 133.328125x133.328125]
|