2023-06-08 13:48:33 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Preston Taylor <PrestonLeeTaylor@proton.me>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2026-04-18 05:54:06 -03:00
|
|
|
#include <LibWeb/Bindings/SVGStyleElement.h>
|
2023-06-08 13:48:33 -03:00
|
|
|
#include <LibWeb/SVG/SVGStyleElement.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DEFINE_ALLOCATOR(SVGStyleElement);
|
2023-11-19 15:47:52 -03:00
|
|
|
|
2023-06-08 13:48:33 -03:00
|
|
|
SVGStyleElement::SVGStyleElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
|
|
|
|
: SVGElement(document, move(qualified_name))
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SVGStyleElement::~SVGStyleElement() = default;
|
|
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
void SVGStyleElement::initialize(JS::Realm& realm)
|
2023-06-08 13:48:33 -03:00
|
|
|
{
|
2024-03-16 09:13:08 -03:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGStyleElement);
|
2025-04-20 11:22:57 -03:00
|
|
|
Base::initialize(realm);
|
2023-06-08 13:48:33 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SVGStyleElement::visit_edges(Cell::Visitor& visitor)
|
|
|
|
|
{
|
|
|
|
|
Base::visit_edges(visitor);
|
2026-02-05 13:06:29 -03:00
|
|
|
visit_style_element_edges(visitor);
|
2023-06-08 13:48:33 -03:00
|
|
|
}
|
|
|
|
|
|
2026-03-18 09:36:27 -03:00
|
|
|
void SVGStyleElement::children_changed(ChildrenChangedMetadata const& metadata)
|
2023-06-08 13:48:33 -03:00
|
|
|
{
|
2025-01-26 09:16:33 -03:00
|
|
|
Base::children_changed(metadata);
|
2026-02-05 13:06:29 -03:00
|
|
|
update_a_style_block();
|
2023-06-08 13:48:33 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SVGStyleElement::inserted()
|
|
|
|
|
{
|
|
|
|
|
Base::inserted();
|
2026-04-15 18:56:07 -03:00
|
|
|
update_a_style_block();
|
2023-06-08 13:48:33 -03:00
|
|
|
}
|
|
|
|
|
|
2026-04-16 16:04:54 -03:00
|
|
|
void SVGStyleElement::removed_from(IsSubtreeRoot is_subtree_root, Node* old_ancestor, Node& old_root)
|
2023-06-08 13:48:33 -03:00
|
|
|
{
|
2026-04-16 16:04:54 -03:00
|
|
|
Base::removed_from(is_subtree_root, old_ancestor, old_root);
|
2026-04-15 18:56:07 -03:00
|
|
|
update_a_style_block();
|
2023-06-08 13:48:33 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|