1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00
serenity/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h
Andreas Kling 6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00

47 lines
1.2 KiB
C++

/*
* Copyright (c) 2020, Matthew Olsson <matthewcolsson@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGfx/Bitmap.h>
#include <LibWeb/SVG/SVGGraphicsElement.h>
#include <LibWeb/SVG/ViewBox.h>
namespace Web::SVG {
class SVGSVGElement final : public SVGGraphicsElement {
WEB_PLATFORM_OBJECT(SVGSVGElement, SVGGraphicsElement);
public:
virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
virtual bool requires_svg_container() const override { return false; }
virtual bool is_svg_container() const override { return true; }
Optional<ViewBox> const& view_box() const { return m_view_box; }
private:
SVGSVGElement(DOM::Document&, DOM::QualifiedName);
virtual bool is_svg_svg_element() const override { return true; }
virtual void parse_attribute(FlyString const& name, String const& value) override;
Optional<ViewBox> m_view_box;
};
}
namespace Web::DOM {
template<>
inline bool Node::fast_is<SVG::SVGSVGElement>() const { return is_svg_svg_element(); }
}
WRAPPER_HACK(SVGSVGElement, Web::SVG)