mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:47:44 +00:00
LibWeb: Use viewbox attribute in SVG symbol element
Previously when a viewBox was passed to a SVG symbol element it would not be taken into account when drawing the SVG.
This commit is contained in:
parent
9f73fc87a8
commit
e61fdd1dc6
9 changed files with 67 additions and 4 deletions
20
Tests/LibWeb/Layout/expected/svg/svg-symbol-with-viewbox.txt
Normal file
20
Tests/LibWeb/Layout/expected/svg/svg-symbol-with-viewbox.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
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 784x150 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
BlockContainer <div> at (8,8) content-size 784x150 children: inline
|
||||
line 0 width: 300, height: 150, bottom: 150, baseline: 150
|
||||
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 300x150]
|
||||
TextNode <#text>
|
||||
SVGSVGBox <svg> at (8,8) content-size 300x150 [SVG] children: inline
|
||||
TextNode <#text>
|
||||
InlineNode <use>
|
||||
InlineNode <symbol#braces>
|
||||
TextNode <#text>
|
||||
SVGGeometryBox <path> at (92.375,26.75) content-size 131.25x112.140625 children: inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
13
Tests/LibWeb/Layout/input/svg/svg-symbol-with-viewbox.html
Normal file
13
Tests/LibWeb/Layout/input/svg/svg-symbol-with-viewbox.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<body>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
||||
<symbol id="braces" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6zM13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6z">
|
||||
</path>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
<div>
|
||||
<svg>
|
||||
<use xlink:href="#braces"></use>
|
||||
</svg>
|
Loading…
Add table
Add a link
Reference in a new issue