1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +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:
MacDue 2023-08-31 08:58:41 +01:00 committed by Andrew Kaster
parent 90af21aef4
commit 720c27efbd
7 changed files with 38 additions and 6 deletions

View file

@ -34,6 +34,8 @@ public:
JS::GCPtr<SVGElement> instance_root() const;
JS::GCPtr<SVGElement> animated_instance_root() const;
virtual Gfx::AffineTransform element_transform() const override;
private:
SVGUseElement(DOM::Document&, DOM::QualifiedName);