mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
LibWeb: Ensure transform of SVG <use> updates with x and y attributes
Rather than modify the transform of the parent (which could change independently), this adds a new override element_transform() where element specific tranfroms can be applied. This will always stay in sync with the attributes. A ref test comparing a .svg and .html version of the same file is added as due to differences in attribute parsing order, the .svg version was previously drawn incorrectly. Fixes #20859
This commit is contained in:
parent
90af21aef4
commit
720c27efbd
7 changed files with 38 additions and 6 deletions
|
@ -17,5 +17,6 @@
|
|||
"svg-gradient-spreadMethod.html": "svg-gradient-spreadMethod-ref.html",
|
||||
"svg-radialGradient.html": "svg-radialGradient-ref.html",
|
||||
"svg-symbol.html": "svg-symbol-ref.html",
|
||||
"border-radius-shrink-zero-sized-box.html": "border-radius-shrink-zero-sized-box-ref.html"
|
||||
"border-radius-shrink-zero-sized-box.html": "border-radius-shrink-zero-sized-box-ref.html",
|
||||
"svg-file-matches-html-file.svg": "svg-file-matches-html-file.html"
|
||||
}
|
||||
|
|
13
Tests/LibWeb/Ref/svg-file-matches-html-file.html
Normal file
13
Tests/LibWeb/Ref/svg-file-matches-html-file.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<g id="10">
|
||||
<rect width="50" height="50" fill="#555555"></rect>
|
||||
</g>
|
||||
</defs>
|
||||
<use href="#10" x="25" y="25"></use>
|
||||
</svg>
|
8
Tests/LibWeb/Ref/svg-file-matches-html-file.svg
Normal file
8
Tests/LibWeb/Ref/svg-file-matches-html-file.svg
Normal file
|
@ -0,0 +1,8 @@
|
|||
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<g id="10">
|
||||
<rect width="50" height="50" fill="#555555"></rect>
|
||||
</g>
|
||||
</defs>
|
||||
<use href="#10" x="25" y="25"></use>
|
||||
</svg>
|
After Width: | Height: | Size: 214 B |
Loading…
Add table
Add a link
Reference in a new issue