diff --git a/Tests/LibWeb/Layout/expected/css-namespace-tag-name-selector.txt b/Tests/LibWeb/Layout/expected/css-namespace-tag-name-selector.txt index 5008ccc680..645b56c2ec 100644 --- a/Tests/LibWeb/Layout/expected/css-namespace-tag-name-selector.txt +++ b/Tests/LibWeb/Layout/expected/css-namespace-tag-name-selector.txt @@ -9,7 +9,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline frag 2 from Box start: 0, length: 0, rect: [319,51 0x108] SVGSVGBox at (9,9) content-size 300x150 [SVG] children: inline InlineNode - SVGTextBox at (29,9) content-size 198.90625x80 children: inline + SVGTextBox at (29,25.015625) content-size 193.59375x67.578125 children: inline TextNode <#text> TextNode <#text> Box at (319,51) content-size 0x108 children: not-inline diff --git a/Tests/LibWeb/Layout/expected/flex/flex-column-item-with-natural-aspect-ratio-and-automatic-cross-size.txt b/Tests/LibWeb/Layout/expected/flex/flex-column-item-with-natural-aspect-ratio-and-automatic-cross-size.txt index c1ebffb6e5..e7f7a97794 100644 --- a/Tests/LibWeb/Layout/expected/flex/flex-column-item-with-natural-aspect-ratio-and-automatic-cross-size.txt +++ b/Tests/LibWeb/Layout/expected/flex/flex-column-item-with-natural-aspect-ratio-and-automatic-cross-size.txt @@ -8,4 +8,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x100] PaintableBox (Box) [0,0 800x100] SVGSVGPaintable (SVGSVGBox) [0,0 200x100] - SVGGeometryPaintable (SVGGeometryBox) [0,0 200x100] + SVGPathPaintable (SVGGeometryBox) [0,0 200x100] diff --git a/Tests/LibWeb/Layout/expected/flex/intrinsic-height-of-flex-container-with-svg-item-that-only-has-natural-aspect-ratio.txt b/Tests/LibWeb/Layout/expected/flex/intrinsic-height-of-flex-container-with-svg-item-that-only-has-natural-aspect-ratio.txt index 3f3508e559..53ec2567ba 100644 --- a/Tests/LibWeb/Layout/expected/flex/intrinsic-height-of-flex-container-with-svg-item-that-only-has-natural-aspect-ratio.txt +++ b/Tests/LibWeb/Layout/expected/flex/intrinsic-height-of-flex-container-with-svg-item-that-only-has-natural-aspect-ratio.txt @@ -8,4 +8,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x16] PaintableBox (Box) [8,8 784x0] SVGSVGPaintable (SVGSVGBox) [400,8 0x0] - SVGGeometryPaintable (SVGGeometryBox) [400,8 0x0] + SVGPathPaintable (SVGGeometryBox) [400,8 0x0] diff --git a/Tests/LibWeb/Layout/expected/svg-preserve-aspect-ratio.txt b/Tests/LibWeb/Layout/expected/svg-preserve-aspect-ratio.txt index 0b4873403c..c812ce40bf 100644 --- a/Tests/LibWeb/Layout/expected/svg-preserve-aspect-ratio.txt +++ b/Tests/LibWeb/Layout/expected/svg-preserve-aspect-ratio.txt @@ -108,39 +108,39 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x600] PaintableWithLines (BlockContainer) [8,8 784x257.46875] SVGSVGPaintable (SVGSVGBox) [8,83 102x52] - SVGGeometryPaintable (SVGGeometryBox) [34,84 50x50] + SVGPathPaintable (SVGGeometryBox) [34,84 50x50] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [118,83 102x52] - SVGGeometryPaintable (SVGGeometryBox) [119,84 50x50] + SVGPathPaintable (SVGGeometryBox) [119,84 50x50] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [228,83 102x52] - SVGGeometryPaintable (SVGGeometryBox) [279,84 50x50] + SVGPathPaintable (SVGGeometryBox) [279,84 50x50] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [338,83 102x52] - SVGGeometryPaintable (SVGGeometryBox) [339,84 100x100] + SVGPathPaintable (SVGGeometryBox) [339,84 100x100] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [448,83 102x52] - SVGGeometryPaintable (SVGGeometryBox) [449,59 100x100] + SVGPathPaintable (SVGGeometryBox) [449,59 100x100] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [558,83 102x52] - SVGGeometryPaintable (SVGGeometryBox) [559,34 100x100] + SVGPathPaintable (SVGGeometryBox) [559,34 100x100] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [668,8 52x127] - SVGGeometryPaintable (SVGGeometryBox) [669,9 50x50] + SVGPathPaintable (SVGGeometryBox) [669,9 50x50] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [728,8 52x127] - SVGGeometryPaintable (SVGGeometryBox) [729,46.5 50x50] + SVGPathPaintable (SVGGeometryBox) [729,46.5 50x50] SVGSVGPaintable (SVGSVGBox) [8,135 52x127] - SVGGeometryPaintable (SVGGeometryBox) [9,211 50x50] + SVGPathPaintable (SVGGeometryBox) [9,211 50x50] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [68,135 52x127] - SVGGeometryPaintable (SVGGeometryBox) [69,136 125x125] + SVGPathPaintable (SVGGeometryBox) [69,136 125x125] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [128,135 52x127] - SVGGeometryPaintable (SVGGeometryBox) [91.5,136 125x125] + SVGPathPaintable (SVGGeometryBox) [91.5,136 125x125] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [188,135 52x127] - SVGGeometryPaintable (SVGGeometryBox) [114,136 125x125] + SVGPathPaintable (SVGGeometryBox) [114,136 125x125] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [248,200 162x62] - SVGGeometryPaintable (SVGGeometryBox) [299,201 60x60] + SVGPathPaintable (SVGGeometryBox) [299,201 60x60] diff --git a/Tests/LibWeb/Layout/expected/svg-text-with-viewbox.txt b/Tests/LibWeb/Layout/expected/svg-text-with-viewbox.txt index b4bde816ff..82e0b45ac1 100644 --- a/Tests/LibWeb/Layout/expected/svg-text-with-viewbox.txt +++ b/Tests/LibWeb/Layout/expected/svg-text-with-viewbox.txt @@ -6,16 +6,16 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline SVGSVGBox at (8,8) content-size 784x261.328125 [SVG] children: inline TextNode <#text> TextNode <#text> - SVGTextBox at (73.34375,79.859375) content-size 50.265625x42.46875 children: inline + SVGTextBox at (73.34375,88.359375) content-size 48.109375x37.484375 children: inline TextNode <#text> TextNode <#text> - SVGTextBox at (138.6875,24.328125) content-size 153.703125x98 children: inline + SVGTextBox at (138.6875,43.953125) content-size 148.234375x79.71875 children: inline TextNode <#text> TextNode <#text> - SVGTextBox at (187.671875,145.1875) content-size 36.90625x42.46875 children: inline + SVGTextBox at (187.671875,153.703125) content-size 34.59375x34.703125 children: inline TextNode <#text> TextNode <#text> - SVGTextBox at (220.34375,57) content-size 526.609375x130.65625 children: inline + SVGTextBox at (220.34375,83.15625) content-size 519.34375x115.359375 children: inline TextNode <#text> TextNode <#text> TextNode <#text> @@ -24,7 +24,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x600] PaintableWithLines (BlockContainer) [8,8 784x261.328125] SVGSVGPaintable (SVGSVGBox) [8,8 784x261.328125] - SVGTextPaintable (SVGTextBox.small) [73.34375,79.859375 50.265625x42.46875] - SVGTextPaintable (SVGTextBox.heavy) [138.6875,24.328125 153.703125x98] - SVGTextPaintable (SVGTextBox.small) [187.671875,145.1875 36.90625x42.46875] - SVGTextPaintable (SVGTextBox.Rrrrr) [220.34375,57 526.609375x130.65625] + SVGPathPaintable (SVGTextBox.small) [73.34375,88.359375 48.109375x37.484375] + SVGPathPaintable (SVGTextBox.heavy) [138.6875,43.953125 148.234375x79.71875] + SVGPathPaintable (SVGTextBox.small) [187.671875,153.703125 34.59375x34.703125] + SVGPathPaintable (SVGTextBox.Rrrrr) [220.34375,83.15625 519.34375x115.359375] diff --git a/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt b/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt index e5b118e3a1..ba7dce4e37 100644 --- a/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt +++ b/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt @@ -100,33 +100,33 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x700] PaintableWithLines (BlockContainer) [50,50 700x600] SVGSVGPaintable (SVGSVGBox) [50,150 200x100] SVGGraphicsPaintable (SVGGraphicsBox) [45.6875,199.828125 118.78125x47.453125] - SVGGeometryPaintable (SVGGeometryBox) [45.6875,199.828125 118.78125x47.453125] + SVGPathPaintable (SVGGeometryBox) [45.6875,199.828125 118.78125x47.453125] SVGGraphicsPaintable (SVGGraphicsBox) [84.5,159.5 81x81] - SVGGeometryPaintable (SVGGeometryBox) [84.5,159.5 81x81] + SVGPathPaintable (SVGGeometryBox) [84.5,159.5 81x81] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [258,50 200x200] - SVGGeometryPaintable (SVGGeometryBox) [268,60 30x20] - SVGGeometryPaintable (SVGGeometryBox) [288,130 110x90] + SVGPathPaintable (SVGGeometryBox) [268,60 30x20] + SVGPathPaintable (SVGGeometryBox) [288,130 110x90] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [466,50 200x200] - SVGGeometryPaintable (SVGGeometryBox) [506,90 120x120] - SVGGeometryPaintable (SVGGeometryBox) [471.359375,90 189.28125x120] + SVGPathPaintable (SVGGeometryBox) [506,90 120x120] + SVGPathPaintable (SVGGeometryBox) [471.359375,90 189.28125x120] SVGSVGPaintable (SVGSVGBox) [50,250 200x200] - SVGGeometryPaintable (SVGGeometryBox) [120.59375,320.59375 58.828125x58.828125] - SVGGeometryPaintable (SVGGeometryBox) [52.4375,310.375 68.140625x68.140625] - SVGGeometryPaintable (SVGGeometryBox) [179.40625,321.484375 68.140625x68.140625] + SVGPathPaintable (SVGGeometryBox) [120.59375,320.59375 58.828125x58.828125] + SVGPathPaintable (SVGGeometryBox) [52.4375,310.375 68.140625x68.140625] + SVGPathPaintable (SVGGeometryBox) [179.40625,321.484375 68.140625x68.140625] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [258,250 200x200] - SVGGeometryPaintable (SVGGeometryBox) [278,270 160x160] - SVGGeometryPaintable (SVGGeometryBox) [338,270 40x160] - SVGGeometryPaintable (SVGGeometryBox) [278,330 160x40] - SVGGeometryPaintable (SVGGeometryBox) [338,330 40x40] + SVGPathPaintable (SVGGeometryBox) [278,270 160x160] + SVGPathPaintable (SVGGeometryBox) [338,270 40x160] + SVGPathPaintable (SVGGeometryBox) [278,330 160x40] + SVGPathPaintable (SVGGeometryBox) [338,330 40x40] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [466,250 200x200] - SVGGeometryPaintable (SVGGeometryBox) [506,290 120x120] - SVGGeometryPaintable (SVGGeometryBox) [506,255.359375 120x189.28125] + SVGPathPaintable (SVGGeometryBox) [506,290 120x120] + SVGPathPaintable (SVGGeometryBox) [506,255.359375 120x189.28125] SVGSVGPaintable (SVGSVGBox) [50,450 200x200] - SVGGeometryPaintable (SVGGeometryBox) [60,460 80x80] - SVGGeometryPaintable (SVGGeometryBox) [160,460 80x80] - SVGGeometryPaintable (SVGGeometryBox) [60,560 80x80] - SVGGeometryPaintable (SVGGeometryBox) [160,560 80x80] + SVGPathPaintable (SVGGeometryBox) [60,460 80x80] + SVGPathPaintable (SVGGeometryBox) [160,460 80x80] + SVGPathPaintable (SVGGeometryBox) [60,560 80x80] + SVGPathPaintable (SVGGeometryBox) [160,560 80x80] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-different-types-of-opacity.txt b/Tests/LibWeb/Layout/expected/svg/svg-different-types-of-opacity.txt index f0e0d0b516..77fc7b87d8 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-different-types-of-opacity.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-different-types-of-opacity.txt @@ -13,4 +13,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x800] PaintableWithLines (BlockContainer) [0,0 800x800] PaintableWithLines (BlockContainer) [8,8 784x784] SVGSVGPaintable (SVGSVGBox) [8,8 784x784] - SVGGeometryPaintable (SVGGeometryBox) [47.1875,47.1875 548.796875x548.796875] + SVGPathPaintable (SVGGeometryBox) [47.1875,47.1875 548.796875x548.796875] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-fill-with-bogus-url.txt b/Tests/LibWeb/Layout/expected/svg/svg-fill-with-bogus-url.txt index f801ae6981..1507c40481 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-fill-with-bogus-url.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-fill-with-bogus-url.txt @@ -10,4 +10,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x800] PaintableWithLines (BlockContainer) [0,0 800x800] PaintableWithLines (BlockContainer) [8,8 784x784] SVGSVGPaintable (SVGSVGBox) [8,8 784x784] - SVGGeometryPaintable (SVGGeometryBox) [8,8 784x784] + SVGPathPaintable (SVGGeometryBox) [8,8 784x784] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-g-with-opacity.txt b/Tests/LibWeb/Layout/expected/svg/svg-g-with-opacity.txt index 974cbb61f9..c6d8c44192 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-g-with-opacity.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-g-with-opacity.txt @@ -19,5 +19,5 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x800] PaintableWithLines (BlockContainer) [8,8 784x784] SVGSVGPaintable (SVGSVGBox) [8,8 784x784] SVGGraphicsPaintable (SVGGraphicsBox) [121.671875,121.671875 556.65625x556.65625] - SVGGeometryPaintable (SVGGeometryBox) [121.671875,121.671875 399.84375x399.84375] - SVGGeometryPaintable (SVGGeometryBox) [278.484375,278.484375 399.84375x399.84375] + SVGPathPaintable (SVGGeometryBox) [121.671875,121.671875 399.84375x399.84375] + SVGPathPaintable (SVGGeometryBox) [278.484375,278.484375 399.84375x399.84375] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt b/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt index 3e8185fabb..51f38ebc05 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt @@ -15,4 +15,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] SVGSVGPaintable (SVGSVGBox) [8,8 24x24] SVGGraphicsPaintable (SVGGraphicsBox) [8,8 24x24] SVGSVGPaintable (SVGSVGBox) [8,8 24x24] - SVGGeometryPaintable (SVGGeometryBox) [8,8 24x24] + SVGPathPaintable (SVGGeometryBox) [8,8 24x24] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-intrinsic-size-in-one-dimension.txt b/Tests/LibWeb/Layout/expected/svg/svg-intrinsic-size-in-one-dimension.txt index 01efac30da..c0cc06b47e 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-intrinsic-size-in-one-dimension.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-intrinsic-size-in-one-dimension.txt @@ -10,6 +10,6 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x170] PaintableWithLines (BlockContainer) [8,8 784x154] SVGSVGPaintable (SVGSVGBox) [8,8 102x52] - SVGGeometryPaintable (SVGGeometryBox) [21.5,21.5 75x25] + SVGPathPaintable (SVGGeometryBox) [21.5,21.5 75x25] SVGSVGPaintable (SVGSVGBox) [8,60 202x102] - SVGGeometryPaintable (SVGGeometryBox) [34,86 150x50] + SVGPathPaintable (SVGGeometryBox) [34,86 150x50] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-negative-elliptical-arg-number.txt b/Tests/LibWeb/Layout/expected/svg/svg-negative-elliptical-arg-number.txt index a25f3b9ef4..78212a296c 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-negative-elliptical-arg-number.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-negative-elliptical-arg-number.txt @@ -10,4 +10,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x116] PaintableWithLines (BlockContainer) [8,8 784x100] SVGSVGPaintable (SVGSVGBox) [8,8 100x100] - SVGGeometryPaintable (SVGGeometryBox) [8,10 100x48] + SVGPathPaintable (SVGGeometryBox) [8,10 100x48] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-path-with-implicit-lineto.txt b/Tests/LibWeb/Layout/expected/svg/svg-path-with-implicit-lineto.txt index 38970279e7..e93f7aa73b 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-path-with-implicit-lineto.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-path-with-implicit-lineto.txt @@ -10,4 +10,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x116] PaintableWithLines (BlockContainer) [8,8 784x100] SVGSVGPaintable (SVGSVGBox) [8,8 100x100] - SVGGeometryPaintable (SVGGeometryBox) [28,28 60x60] + SVGPathPaintable (SVGGeometryBox) [28,28 60x60] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-symbol-with-viewbox.txt b/Tests/LibWeb/Layout/expected/svg/svg-symbol-with-viewbox.txt index 11a1857ff3..8b2b2d5922 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-symbol-with-viewbox.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-symbol-with-viewbox.txt @@ -27,4 +27,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] SVGSVGPaintable (SVGSVGBox) [8,8 300x150] PaintableBox (Box) [8,8 0x0] PaintableBox (Box#braces) [8,8 0x0] - SVGGeometryPaintable (SVGGeometryBox) [92.375,26.75 131.25x112.15625] + SVGPathPaintable (SVGGeometryBox) [92.375,26.75 131.25x112.15625] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-with-css-variable-in-presentation-hint.txt b/Tests/LibWeb/Layout/expected/svg/svg-with-css-variable-in-presentation-hint.txt index 96c3571daa..933a05aec5 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-with-css-variable-in-presentation-hint.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-with-css-variable-in-presentation-hint.txt @@ -10,4 +10,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x118] PaintableWithLines (BlockContainer) [8,8 784x102] SVGSVGPaintable (SVGSVGBox) [8,8 102x102] - SVGGeometryPaintable (SVGGeometryBox) [29,29 60x60] + SVGPathPaintable (SVGGeometryBox) [29,29 60x60] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-with-display-block.txt b/Tests/LibWeb/Layout/expected/svg/svg-with-display-block.txt index 24143cec5c..7fe6f82d0c 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-with-display-block.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-with-display-block.txt @@ -8,4 +8,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x800] PaintableWithLines (BlockContainer) [0,0 800x800] PaintableWithLines (BlockContainer) [8,8 784x784] SVGSVGPaintable (SVGSVGBox) [8,8 784x784] - SVGGeometryPaintable (SVGGeometryBox) [8,8 784x784] + SVGPathPaintable (SVGGeometryBox) [8,8 784x784] diff --git a/Tests/LibWeb/Layout/expected/svg/svg-with-zero-intrinsic-size-and-no-viewbox.txt b/Tests/LibWeb/Layout/expected/svg/svg-with-zero-intrinsic-size-and-no-viewbox.txt index 46020a446a..6a82ee705a 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-with-zero-intrinsic-size-and-no-viewbox.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-with-zero-intrinsic-size-and-no-viewbox.txt @@ -26,4 +26,4 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] ImagePaintable (ImageBox) [8,21 0x0] TextPaintable (TextNode<#text>) SVGSVGPaintable (SVGSVGBox) [16,21 0x0] - SVGGeometryPaintable (SVGGeometryBox) [16,21 1x1] + SVGPathPaintable (SVGGeometryBox) [16,21 1x1] diff --git a/Tests/LibWeb/Layout/expected/svg/text-fill-none.txt b/Tests/LibWeb/Layout/expected/svg/text-fill-none.txt index bd127e4e9e..dbd39cc3cd 100644 --- a/Tests/LibWeb/Layout/expected/svg/text-fill-none.txt +++ b/Tests/LibWeb/Layout/expected/svg/text-fill-none.txt @@ -4,11 +4,11 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline line 0 width: 300, height: 150, bottom: 150, baseline: 150 frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 300x150] SVGSVGBox at (8,8) content-size 300x150 [SVG] children: not-inline - SVGTextBox at (8,-8) content-size 0x16 children: not-inline + SVGTextBox at (8,8) content-size 0x0 children: not-inline TextNode <#text> ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x600] PaintableWithLines (BlockContainer) [8,8 784x150] - SVGSVGPaintable (SVGSVGBox) [8,8 300x150] overflow: [8,-8 300x166] - SVGTextPaintable (SVGTextBox) [8,-8 0x16] + SVGSVGPaintable (SVGSVGBox) [8,8 300x150] + SVGPathPaintable (SVGTextBox) [8,8 0x0] diff --git a/Tests/LibWeb/Ref/reference/images/svg-text-effects-ref.png b/Tests/LibWeb/Ref/reference/images/svg-text-effects-ref.png new file mode 100644 index 0000000000..6b94197391 Binary files /dev/null and b/Tests/LibWeb/Ref/reference/images/svg-text-effects-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/svg-text-effects-ref.html b/Tests/LibWeb/Ref/reference/svg-text-effects-ref.html new file mode 100644 index 0000000000..24b8a82f0b --- /dev/null +++ b/Tests/LibWeb/Ref/reference/svg-text-effects-ref.html @@ -0,0 +1,15 @@ + + + diff --git a/Tests/LibWeb/Ref/svg-text-effects.html b/Tests/LibWeb/Ref/svg-text-effects.html new file mode 100644 index 0000000000..a656f34075 --- /dev/null +++ b/Tests/LibWeb/Ref/svg-text-effects.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + +There you go :^) +thakis + diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index 4a82b04ab9..7e714f4a46 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -491,11 +491,10 @@ set(SOURCES Painting/ProgressPaintable.cpp Painting/RadioButtonPaintable.cpp Painting/RecordingPainter.cpp - Painting/SVGGeometryPaintable.cpp + Painting/SVGPathPaintable.cpp Painting/SVGGraphicsPaintable.cpp Painting/SVGPaintable.cpp Painting/SVGSVGPaintable.cpp - Painting/SVGTextPaintable.cpp Painting/ShadowPainting.cpp Painting/StackingContext.cpp Painting/TableBordersPainting.cpp diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp index 98ed65a2eb..7c35847431 100644 --- a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include namespace Web::Layout { @@ -272,8 +272,8 @@ void LayoutState::commit(Box& root) svg_graphics_paintable.set_computed_transforms(*used_values.computed_svg_transforms()); } - if (used_values.computed_svg_path().has_value() && is(paintable_box)) { - auto& svg_geometry_paintable = static_cast(paintable_box); + if (used_values.computed_svg_path().has_value() && is(paintable_box)) { + auto& svg_geometry_paintable = static_cast(paintable_box); svg_geometry_paintable.set_computed_path(move(*used_values.computed_svg_path())); } } diff --git a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp index caf71c7c55..e7ba0590eb 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp @@ -196,27 +196,20 @@ void SVGFormattingContext::run(Box const& box, LayoutMode layout_mode, Available graphics_box_state.set_computed_svg_transforms(Painting::SVGGraphicsPaintable::ComputedTransforms(viewbox_transform, svg_transform)); auto to_css_pixels_transform = Gfx::AffineTransform {}.multiply(viewbox_transform).multiply(svg_transform); + Gfx::Path path; if (is(descendant)) { - auto path = static_cast(dom_node).get_path(); - auto path_bounding_box = to_css_pixels_transform.map(path.bounding_box()).to_type(); - // Stroke increases the path's size by stroke_width/2 per side. - CSSPixels stroke_width = CSSPixels::nearest_value_for(graphics_box.dom_node().visible_stroke_width() * viewbox_transform.x_scale()); - path_bounding_box.inflate(stroke_width, stroke_width); - graphics_box_state.set_content_offset(path_bounding_box.top_left()); - graphics_box_state.set_content_width(path_bounding_box.width()); - graphics_box_state.set_content_height(path_bounding_box.height()); - graphics_box_state.set_computed_svg_path(move(path)); + path = static_cast(dom_node).get_path(); } else if (is(descendant)) { auto& text_element = static_cast(dom_node); // FIXME: Support arbitrary path transforms for fonts. // FIMXE: This assumes transform->x_scale() == transform->y_scale(). - auto& scaled_font = graphics_box.scaled_font(to_css_pixels_transform.x_scale()); + auto& font = graphics_box.font(); auto text_contents = text_element.text_contents(); + Utf8View text_utf8 { text_contents }; + auto text_width = font.width(text_utf8); - auto text_offset = text_element.get_offset().transformed(to_css_pixels_transform).to_type(); - auto text_width = CSSPixels::nearest_value_for(scaled_font.width(Utf8View { text_contents })); - + auto text_offset = text_element.get_offset(); // https://svgwg.org/svg2-draft/text.html#TextAnchoringProperties switch (text_element.text_anchor().value_or(SVG::TextAnchor::Start)) { case SVG::TextAnchor::Start: @@ -240,11 +233,18 @@ void SVGFormattingContext::run(Box const& box, LayoutMode layout_mode, Available VERIFY_NOT_REACHED(); } - auto text_height = CSSPixels::nearest_value_for(scaled_font.pixel_size()); - graphics_box_state.set_content_offset(text_offset.translated(0, -text_height)); - graphics_box_state.set_content_width(text_width); - graphics_box_state.set_content_height(text_height); + path.move_to(text_offset); + path.text(text_utf8, font); } + + auto path_bounding_box = to_css_pixels_transform.map(path.bounding_box()).to_type(); + // Stroke increases the path's size by stroke_width/2 per side. + CSSPixels stroke_width = CSSPixels::nearest_value_for(graphics_box.dom_node().visible_stroke_width() * viewbox_transform.x_scale()); + path_bounding_box.inflate(stroke_width, stroke_width); + graphics_box_state.set_content_offset(path_bounding_box.top_left()); + graphics_box_state.set_content_width(path_bounding_box.width()); + graphics_box_state.set_content_height(path_bounding_box.height()); + graphics_box_state.set_computed_svg_path(move(path)); } else if (is(descendant)) { SVGFormattingContext nested_context(m_state, static_cast(descendant), this); nested_context.run(static_cast(descendant), layout_mode, available_space); diff --git a/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp b/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp index 88b0dc13ae..88b8212787 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGGeometryBox.cpp @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include @@ -19,7 +19,7 @@ SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& JS::GCPtr SVGGeometryBox::create_paintable() const { - return Painting::SVGGeometryPaintable::create(*this); + return Painting::SVGPathPaintable::create(*this); } } diff --git a/Userland/Libraries/LibWeb/Layout/SVGTextBox.cpp b/Userland/Libraries/LibWeb/Layout/SVGTextBox.cpp index a7257c89a5..a9c2bc1af5 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGTextBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGTextBox.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include namespace Web::Layout { @@ -17,7 +17,7 @@ SVGTextBox::SVGTextBox(DOM::Document& document, SVG::SVGTextPositioningElement& JS::GCPtr SVGTextBox::create_paintable() const { - return Painting::SVGTextPaintable::create(*this); + return Painting::SVGPathPaintable::create(*this); } } diff --git a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGPathPaintable.cpp similarity index 88% rename from Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp rename to Userland/Libraries/LibWeb/Painting/SVGPathPaintable.cpp index 979ef84df8..f9b28d02fb 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGPathPaintable.cpp @@ -6,27 +6,27 @@ */ #include -#include +#include #include namespace Web::Painting { -JS::NonnullGCPtr SVGGeometryPaintable::create(Layout::SVGGeometryBox const& layout_box) +JS::NonnullGCPtr SVGPathPaintable::create(Layout::SVGGraphicsBox const& layout_box) { - return layout_box.heap().allocate_without_realm(layout_box); + return layout_box.heap().allocate_without_realm(layout_box); } -SVGGeometryPaintable::SVGGeometryPaintable(Layout::SVGGeometryBox const& layout_box) +SVGPathPaintable::SVGPathPaintable(Layout::SVGGraphicsBox const& layout_box) : SVGGraphicsPaintable(layout_box) { } -Layout::SVGGeometryBox const& SVGGeometryPaintable::layout_box() const +Layout::SVGGraphicsBox const& SVGPathPaintable::layout_box() const { - return static_cast(layout_node()); + return static_cast(layout_node()); } -Optional SVGGeometryPaintable::hit_test(CSSPixelPoint position, HitTestType type) const +Optional SVGPathPaintable::hit_test(CSSPixelPoint position, HitTestType type) const { auto result = SVGGraphicsPaintable::hit_test(position, type); if (!result.has_value() || !computed_path().has_value()) @@ -49,7 +49,7 @@ static Gfx::Painter::WindingRule to_gfx_winding_rule(SVG::FillRule fill_rule) } } -void SVGGeometryPaintable::paint(PaintContext& context, PaintPhase phase) const +void SVGPathPaintable::paint(PaintContext& context, PaintPhase phase) const { if (!is_visible() || !computed_path().has_value()) return; diff --git a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.h b/Userland/Libraries/LibWeb/Painting/SVGPathPaintable.h similarity index 62% rename from Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.h rename to Userland/Libraries/LibWeb/Painting/SVGPathPaintable.h index 97831534bf..051e079e29 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/SVGPathPaintable.h @@ -6,22 +6,22 @@ #pragma once -#include +#include #include namespace Web::Painting { -class SVGGeometryPaintable final : public SVGGraphicsPaintable { - JS_CELL(SVGGeometryPaintable, SVGGraphicsPaintable); +class SVGPathPaintable final : public SVGGraphicsPaintable { + JS_CELL(SVGPathPaintable, SVGGraphicsPaintable); public: - static JS::NonnullGCPtr create(Layout::SVGGeometryBox const&); + static JS::NonnullGCPtr create(Layout::SVGGraphicsBox const&); virtual Optional hit_test(CSSPixelPoint, HitTestType) const override; virtual void paint(PaintContext&, PaintPhase) const override; - Layout::SVGGeometryBox const& layout_box() const; + Layout::SVGGraphicsBox const& layout_box() const; void set_computed_path(Gfx::Path path) { @@ -31,7 +31,7 @@ public: Optional const& computed_path() const { return m_computed_path; } protected: - SVGGeometryPaintable(Layout::SVGGeometryBox const&); + SVGPathPaintable(Layout::SVGGraphicsBox const&); Optional m_computed_path = {}; }; diff --git a/Userland/Libraries/LibWeb/Painting/SVGTextPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGTextPaintable.cpp deleted file mode 100644 index ac1c2f0b83..0000000000 --- a/Userland/Libraries/LibWeb/Painting/SVGTextPaintable.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2023, Aliaksandr Kalenik - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include -#include - -namespace Web::Painting { - -JS::NonnullGCPtr SVGTextPaintable::create(Layout::SVGTextBox const& layout_box) -{ - return layout_box.heap().allocate_without_realm(layout_box); -} - -SVGTextPaintable::SVGTextPaintable(Layout::SVGTextBox const& layout_box) - : SVGGraphicsPaintable(layout_box) -{ -} - -void SVGTextPaintable::paint(PaintContext& context, PaintPhase phase) const -{ - if (!is_visible()) - return; - - if (!layout_node().computed_values().fill().has_value()) - return; - - if (layout_node().computed_values().fill()->is_url()) { - dbgln("FIXME: Using url() as fill is not supported for svg text"); - return; - } - - SVGGraphicsPaintable::paint(context, phase); - - if (phase != PaintPhase::Foreground) - return; - - auto& painter = context.painter(); - auto const& dom_node = layout_box().dom_node(); - auto paint_transform = computed_transforms().svg_to_device_pixels_transform(context); - auto& scaled_font = layout_box().scaled_font(paint_transform.x_scale()); - auto text_rect = context.enclosing_device_rect(absolute_rect()).to_type(); - auto text_contents = dom_node.text_contents(); - - painter.draw_text_run(text_rect.bottom_left(), Utf8View { text_contents }, scaled_font, layout_node().computed_values().fill()->as_color(), text_rect); -} - -} diff --git a/Userland/Libraries/LibWeb/Painting/SVGTextPaintable.h b/Userland/Libraries/LibWeb/Painting/SVGTextPaintable.h deleted file mode 100644 index 7476722964..0000000000 --- a/Userland/Libraries/LibWeb/Painting/SVGTextPaintable.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023, Aliaksandr Kalenik - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#pragma once - -#include -#include - -namespace Web::Painting { - -class SVGTextPaintable final : public SVGGraphicsPaintable { - JS_CELL(SVGTextPaintable, SVGGraphicsPaintable); - -public: - static JS::NonnullGCPtr create(Layout::SVGTextBox const&); - - virtual void paint(PaintContext&, PaintPhase) const override; - - Layout::SVGTextBox const& layout_box() const - { - return static_cast(layout_node()); - } - -protected: - SVGTextPaintable(Layout::SVGTextBox const&); -}; - -}