2022-04-11 17:59:03 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Simon Danner <danner.simon@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2022-10-01 02:16:16 +03:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2023-09-17 17:32:24 +03:00
|
|
|
#include <LibWeb/Layout/SVGBox.h>
|
2022-04-11 17:59:03 +03:00
|
|
|
#include <LibWeb/SVG/SVGDefsElement.h>
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
2023-11-19 21:47:52 +03:00
|
|
|
JS_DEFINE_ALLOCATOR(SVGDefsElement);
|
|
|
|
|
2022-04-11 17:59:03 +03:00
|
|
|
SVGDefsElement::SVGDefsElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
|
|
|
: SVGGraphicsElement(document, move(qualified_name))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SVGDefsElement::~SVGDefsElement()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-08-07 09:41:28 +03:00
|
|
|
void SVGDefsElement::initialize(JS::Realm& realm)
|
2023-01-10 14:28:20 +03:00
|
|
|
{
|
2023-08-07 09:41:28 +03:00
|
|
|
Base::initialize(realm);
|
2023-11-22 02:55:21 +03:00
|
|
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGDefsElementPrototype>(realm, "SVGDefsElement"_fly_string));
|
2023-01-10 14:28:20 +03:00
|
|
|
}
|
|
|
|
|
2023-09-17 17:32:24 +03:00
|
|
|
JS::GCPtr<Layout::Node> SVGDefsElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
2022-04-11 17:59:03 +03:00
|
|
|
{
|
2023-09-17 17:32:24 +03: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 17:59:03 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|