mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +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:
parent
258af0fb1b
commit
f2047a5c32
5 changed files with 71 additions and 7 deletions
|
@ -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]
|
||||
|
|
23
Tests/LibWeb/Layout/expected/svg/svg-g-with-opacity.txt
Normal file
23
Tests/LibWeb/Layout/expected/svg/svg-g-with-opacity.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x800 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x784 children: inline
|
||||
line 0 width: 784, height: 784, bottom: 784, baseline: 784
|
||||
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 784x784]
|
||||
SVGSVGBox <svg> at (8,8) content-size 784x784 [SVG] children: inline
|
||||
TextNode <#text>
|
||||
SVGGraphicsBox <g> at (121.671875,121.671875) content-size 556.65625x556.65625 children: inline
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <circle> at (121.671875,121.671875) content-size 399.84375x399.84375 children: not-inline
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <circle> at (278.484375,278.484375) content-size 399.84375x399.84375 children: not-inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
|
||||
PaintableWithLines (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x800]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x800]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x784]
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [8,8 784x784]
|
||||
SVGGraphicsPaintable (SVGGraphicsBox<g>) [121.671875,121.671875 556.65625x556.65625]
|
||||
SVGGeometryPaintable (SVGGeometryBox<circle>) [121.671875,121.671875 399.84375x399.84375]
|
||||
SVGGeometryPaintable (SVGGeometryBox<circle>) [278.484375,278.484375 399.84375x399.84375]
|
|
@ -4,7 +4,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
|||
line 0 width: 24, height: 24, bottom: 24, baseline: 24
|
||||
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 24x24]
|
||||
SVGSVGBox <svg> at (8,8) content-size 24x24 [SVG] children: inline
|
||||
SVGGraphicsBox <g> at (8,8) content-size 0x0 children: inline
|
||||
SVGGraphicsBox <g> at (8,8) content-size 24x24 children: inline
|
||||
SVGSVGBox <svg> at (8,8) content-size 24x24 [SVG] children: not-inline
|
||||
SVGGeometryBox <rect> at (8,8) content-size 24x24 children: not-inline
|
||||
TextNode <#text>
|
||||
|
@ -13,6 +13,6 @@ PaintableWithLines (Viewport<#document>) [0,0 800x600]
|
|||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x40]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x24]
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [8,8 24x24]
|
||||
SVGGraphicsPaintable (SVGGraphicsBox<g>) [8,8 0x0]
|
||||
SVGGraphicsPaintable (SVGGraphicsBox<g>) [8,8 24x24]
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [8,8 24x24]
|
||||
SVGGeometryPaintable (SVGGeometryBox<rect>) [8,8 24x24]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue