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

LibWeb: Size SVG G container according to children

The SVG G container should have the same size as its children. This
fixes a bug when there was an opacity value on the G element, as in
StackingContext it would try and get a bitmap of the element which would
be empty due to it having no size.
This commit is contained in:
martinfalisse 2023-08-16 17:45:49 +02:00 committed by Andreas Kling
parent 258af0fb1b
commit f2047a5c32
5 changed files with 71 additions and 7 deletions

View file

@ -21,12 +21,12 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
frag 0 from SVGSVGBox start: 0, length: 0, rect: [50,450 200x200]
SVGSVGBox <svg> at (50,150) content-size 200x100 [SVG] children: inline
TextNode <#text>
SVGGraphicsBox <g> at (50,150) content-size 0x0 children: inline
SVGGraphicsBox <g> at (45.6875,199.828125) content-size 118.78125x47.453125 children: inline
TextNode <#text>
SVGGeometryBox <path> at (45.6875,199.828125) content-size 118.78125x47.453125 children: not-inline
TextNode <#text>
TextNode <#text>
SVGGraphicsBox <g> at (50,150) content-size 0x0 children: inline
SVGGraphicsBox <g> at (84.5,159.5) content-size 81x81 children: inline
TextNode <#text>
SVGGeometryBox <path> at (84.5,159.5) content-size 81x81 children: not-inline
TextNode <#text>
@ -99,9 +99,9 @@ PaintableWithLines (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x700]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x700]
PaintableWithLines (BlockContainer<BODY>) [50,50 700x600]
SVGSVGPaintable (SVGSVGBox<svg>) [50,150 200x100]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [50,150 0x0]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [45.6875,199.828125 118.78125x47.453125]
SVGGeometryPaintable (SVGGeometryBox<path>) [45.6875,199.828125 118.78125x47.453125]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [50,150 0x0]
SVGGraphicsPaintable (SVGGraphicsBox<g>) [84.5,159.5 81x81]
SVGGeometryPaintable (SVGGeometryBox<path>) [84.5,159.5 81x81]
TextPaintable (TextNode<#text>)
SVGSVGPaintable (SVGSVGBox<svg>) [258,50 200x200]