2023-05-31 00:50:12 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Preston Taylor <95388976+PrestonLTaylor@users.noreply.github.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2025-08-27 22:17:33 +01:00
|
|
|
#include <LibWeb/SVG/SVGFitToViewBox.h>
|
2023-05-31 00:50:12 +01:00
|
|
|
#include <LibWeb/SVG/SVGGraphicsElement.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
|
2024-01-27 16:23:22 +00:00
|
|
|
class SVGSymbolElement final : public SVGGraphicsElement
|
2025-08-27 22:17:33 +01:00
|
|
|
, public SVGFitToViewBox {
|
2023-05-31 00:50:12 +01:00
|
|
|
WEB_PLATFORM_OBJECT(SVGSymbolElement, SVGGraphicsElement);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(SVGSymbolElement);
|
2023-05-31 00:50:12 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual ~SVGSymbolElement() override = default;
|
|
|
|
|
|
2025-11-13 12:52:46 +00:00
|
|
|
virtual void adjust_computed_style(CSS::ComputedProperties&) override;
|
2023-05-31 00:50:12 +01:00
|
|
|
|
|
|
|
|
private:
|
2025-09-25 12:06:12 +02:00
|
|
|
virtual bool is_svg_symbol_element() const final { return true; }
|
|
|
|
|
|
2023-05-31 00:50:12 +01:00
|
|
|
SVGSymbolElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2024-07-20 18:32:53 +01:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
2023-05-31 00:50:12 +01:00
|
|
|
|
2024-12-20 16:35:12 +01:00
|
|
|
virtual GC::Ptr<Layout::Node> create_layout_node(GC::Ref<CSS::ComputedProperties>) override;
|
2023-08-19 19:42:31 +02:00
|
|
|
|
2023-05-31 00:50:12 +01:00
|
|
|
bool is_direct_child_of_use_shadow_tree() const;
|
2023-07-31 18:37:44 +02:00
|
|
|
|
2024-11-14 08:14:16 -05:00
|
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
|
2023-05-31 00:50:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
2025-09-25 12:06:12 +02:00
|
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
inline bool Node::fast_is<SVG::SVGSymbolElement>() const { return is_svg_symbol_element(); }
|
|
|
|
|
|
|
|
|
|
}
|