1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

LibWeb: Make sure that SVG use and symbol elements get paintables

I'm about to make StackingContext traverse the paintable tree instead of
actually traversing the layout tree, and it turns out we were not
creating paintables for these SVG elements.

Also switch them to Layout::Box instead of the default InlineNode to
make the trees look a bit less weird. Ultimately, we should do something
specialized for these subtrees, but for now this'll do.
This commit is contained in:
Andreas Kling 2023-08-19 19:42:31 +02:00
parent 3d7c880a42
commit 1e0ea45fe5
6 changed files with 45 additions and 13 deletions

View file

@ -9,6 +9,7 @@
#include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/ShadowRoot.h>
#include <LibWeb/Layout/Box.h>
#include <LibWeb/Namespace.h>
#include <LibWeb/SVG/AttributeNames.h>
#include <LibWeb/SVG/SVGSVGElement.h>
@ -172,4 +173,9 @@ JS::GCPtr<SVGElement> SVGUseElement::animated_instance_root() const
return instance_root();
}
JS::GCPtr<Layout::Node> SVGUseElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
{
return heap().allocate_without_realm<Layout::Box>(document(), this, move(style));
}
}