2022-04-11 16:59:03 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Simon Danner <danner.simon@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2022-09-30 17:16:16 -06:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2023-09-17 15:32:24 +01:00
|
|
|
#include <LibWeb/Layout/SVGBox.h>
|
2022-04-11 16:59:03 +02:00
|
|
|
#include <LibWeb/SVG/SVGDefsElement.h>
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
2023-11-19 19:47:52 +01:00
|
|
|
JS_DEFINE_ALLOCATOR(SVGDefsElement);
|
|
|
|
|
2022-04-11 16:59:03 +02:00
|
|
|
SVGDefsElement::SVGDefsElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
|
|
|
: SVGGraphicsElement(document, move(qualified_name))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SVGDefsElement::~SVGDefsElement()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void SVGDefsElement::initialize(JS::Realm& realm)
|
2023-01-10 06:28:20 -05:00
|
|
|
{
|
2023-08-07 08:41:28 +02:00
|
|
|
Base::initialize(realm);
|
2023-01-10 06:28:20 -05:00
|
|
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGDefsElementPrototype>(realm, "SVGDefsElement"));
|
|
|
|
}
|
|
|
|
|
2023-09-17 15:32:24 +01:00
|
|
|
JS::GCPtr<Layout::Node> SVGDefsElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
2022-04-11 16:59:03 +02:00
|
|
|
{
|
2023-09-17 15:32:24 +01:00
|
|
|
// FIXME: We need this layout node so any <mask>s inside this element get layout computed.
|
|
|
|
return heap().allocate_without_realm<Layout::SVGBox>(document(), *this, move(style));
|
2022-04-11 16:59:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|