2023-07-22 19:24:55 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2024-04-27 12:09:58 +12:00
|
|
|
#include <LibWeb/Bindings/SVGTextElementPrototype.h>
|
2023-07-22 19:24:55 +01:00
|
|
|
#include <LibWeb/Layout/SVGTextBox.h>
|
|
|
|
#include <LibWeb/SVG/SVGTextElement.h>
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DEFINE_ALLOCATOR(SVGTextElement);
|
2023-11-19 19:47:52 +01:00
|
|
|
|
2023-07-22 19:24:55 +01:00
|
|
|
SVGTextElement::SVGTextElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
|
|
|
: SVGTextPositioningElement(document, move(qualified_name))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void SVGTextElement::initialize(JS::Realm& realm)
|
2023-07-22 19:24:55 +01:00
|
|
|
{
|
2023-08-07 08:41:28 +02:00
|
|
|
Base::initialize(realm);
|
2024-03-16 13:13:08 +01:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextElement);
|
2023-07-22 19:24:55 +01:00
|
|
|
}
|
|
|
|
|
2024-12-20 11:32:17 +01:00
|
|
|
GC::Ptr<Layout::Node> SVGTextElement::create_layout_node(CSS::ComputedProperties style)
|
2023-07-22 19:24:55 +01:00
|
|
|
{
|
2024-11-14 06:13:46 +13:00
|
|
|
return heap().allocate<Layout::SVGTextBox>(document(), *this, move(style));
|
2023-07-22 19:24:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|