mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00:00
headless-browser: Run .svg
dump tests
Previously, the check for `.html` meant that `.svg` tests were excluded. This led to a few `.svg` with missing or bit-rotted expectations, which have now been added/updated.
This commit is contained in:
parent
012cb7f71e
commit
2ede299b4a
7 changed files with 54 additions and 29 deletions
|
@ -0,0 +1,28 @@
|
|||
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 784x17 children: inline
|
||||
frag 0 from ImageBox start: 0, length: 0, rect: [8,21 0x0] baseline: 0
|
||||
frag 1 from TextNode start: 0, length: 1, rect: [8,8 8x17] baseline: 13.296875
|
||||
" "
|
||||
frag 2 from SVGSVGBox start: 0, length: 0, rect: [16,21 0x0] baseline: 0
|
||||
ImageBox <img> at (8,21) content-size 0x0 children: not-inline
|
||||
(SVG-as-image isolated context)
|
||||
Viewport <#document> at (0,0) content-size 0x0 [BFC] children: inline
|
||||
SVGSVGBox <svg> at (0,0) content-size 0x0 [SVG] children: inline
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <rect> at (0,0) content-size 1x1 children: not-inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
SVGSVGBox <svg> at (16,21) content-size 0x0 [SVG] children: inline
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <rect> at (16,21) content-size 1x1 children: not-inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17]
|
||||
ImagePaintable (ImageBox<IMG>) [8,21 0x0]
|
||||
TextPaintable (TextNode<#text>)
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [16,21 0x0]
|
||||
SVGPathPaintable (SVGGeometryBox<rect>) [16,21 1x1]
|
9
Tests/LibWeb/Layout/expected/svg/rectangle.txt
Normal file
9
Tests/LibWeb/Layout/expected/svg/rectangle.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: inline
|
||||
SVGSVGBox <svg> at (0,0) content-size 800x600 [SVG] children: inline
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <rect> at (250,0) content-size 300x600 children: not-inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 800x600]
|
||||
SVGPathPaintable (SVGGeometryBox<rect>) [250,0 300x600]
|
|
@ -1,28 +1,9 @@
|
|||
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 784x17 children: inline
|
||||
frag 0 from ImageBox start: 0, length: 0, rect: [8,21 0x0] baseline: 0
|
||||
frag 1 from TextNode start: 0, length: 1, rect: [8,8 8x17] baseline: 13.296875
|
||||
" "
|
||||
frag 2 from SVGSVGBox start: 0, length: 0, rect: [16,21 0x0] baseline: 0
|
||||
ImageBox <img> at (8,21) content-size 0x0 children: not-inline
|
||||
(SVG-as-image isolated context)
|
||||
Viewport <#document> at (0,0) content-size 0x0 [BFC] children: inline
|
||||
SVGSVGBox <svg> at (0,0) content-size 0x0 [SVG] children: inline
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <rect> at (0,0) content-size 1x1 children: not-inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
SVGSVGBox <svg> at (16,21) content-size 0x0 [SVG] children: inline
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <rect> at (16,21) content-size 1x1 children: not-inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
Viewport <#document> at (0,0) content-size 800x600 children: inline
|
||||
InlineNode <svg>
|
||||
TextNode <#text>
|
||||
InlineNode <rect>
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17]
|
||||
ImagePaintable (ImageBox<IMG>) [8,21 0x0]
|
||||
TextPaintable (TextNode<#text>)
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [16,21 0x0]
|
||||
SVGPathPaintable (SVGGeometryBox<rect>) [16,21 1x1]
|
||||
InlinePaintable (InlineNode<svg>)
|
||||
InlinePaintable (InlineNode<rect>)
|
||||
|
|
7
Tests/LibWeb/Layout/expected/svg/svg-without-viewbox.txt
Normal file
7
Tests/LibWeb/Layout/expected/svg/svg-without-viewbox.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 [BFC] children: inline
|
||||
SVGSVGBox <svg> at (0,0) content-size 800x600 [SVG] children: not-inline
|
||||
SVGGeometryBox <rect> at (0,0) content-size 100x200 children: not-inline
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
SVGSVGPaintable (SVGSVGBox<svg>) [0,0 800x600]
|
||||
SVGPathPaintable (SVGGeometryBox<rect>) [0,0 100x200]
|
|
@ -1,3 +1,3 @@
|
|||
<svg width=0 height=0>
|
||||
<rect x=0 y=0 width=1 height=1 />
|
||||
<svg width="0" height="0">
|
||||
<rect x="0" y="0" width="1" height="1" />
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 80 B |
|
@ -490,7 +490,7 @@ static ErrorOr<void> collect_dump_tests(Vector<Test>& tests, StringView path, St
|
|||
TRY(collect_dump_tests(tests, path, TRY(String::formatted("{}/{}", trail, name)), mode));
|
||||
continue;
|
||||
}
|
||||
if (!name.ends_with(".html"sv))
|
||||
if (!name.ends_with(".html"sv) && !name.ends_with(".svg"sv))
|
||||
continue;
|
||||
auto basename = LexicalPath::title(name);
|
||||
auto expectation_path = TRY(String::formatted("{}/expected/{}/{}.txt", path, trail, basename));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue