LibWeb: Add layout node and paintable for SVGForeignObjectElement

Introduces separate layout and paintable type for foreign element.
It is necessary to inherit SVGForeignObjectPaintable from SVGMaskable
in upcoming changes.
This commit is contained in:
Aliaksandr Kalenik 2024-04-25 20:21:12 +02:00 committed by Andreas Kling
commit 7d05fe84bc
Notes: sideshowbarker 2024-07-16 23:08:48 +09:00
6 changed files with 129 additions and 1 deletions

View file

@ -8,6 +8,7 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/SVGForeignObjectBox.h>
#include <LibWeb/SVG/AttributeNames.h>
#include <LibWeb/SVG/SVGAnimatedLength.h>
#include <LibWeb/SVG/SVGForeignObjectElement.h>
@ -47,7 +48,7 @@ void SVGForeignObjectElement::visit_edges(Cell::Visitor& visitor)
JS::GCPtr<Layout::Node> SVGForeignObjectElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
{
return heap().allocate_without_realm<Layout::BlockContainer>(document(), this, move(style));
return heap().allocate_without_realm<Layout::SVGForeignObjectBox>(document(), *this, move(style));
}
void SVGForeignObjectElement::apply_presentational_hints(CSS::StyleProperties& style) const