Skip to content

Truly independent web browser

1.1 KB
Raw Blame
/*
 * Copyright (c) 2025, Tim Ledbetter <[email protected]>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibWeb/SVG/SVGFitToViewBox.h>
#include <LibWeb/SVG/SVGGraphicsElement.h>

namespace Web::SVG {

class SVGViewElement final : public SVGGraphicsElement
    , public SVGFitToViewBox {
    WEB_WRAPPABLE(SVGViewElement, SVGGraphicsElement);
    GC_DECLARE_ALLOCATOR(SVGViewElement);

public:
    virtual SVGFitToViewBox const* fit_to_view_box() const override { return this; }

private:
    SVGViewElement(DOM::Document&, DOM::QualifiedName);

    virtual void initialize_element() override;
    virtual void visit_edges(Visitor&) override;

    virtual bool is_svg_view_element() const override { return true; }

    virtual void attribute_changed(Utf16FlyString const& name, Optional<Utf16String> const& old_value, Optional<Utf16String> const& value, Optional<Utf16FlyString> const& namespace_) override;
};

}

namespace Web::DOM {

template<>
inline bool Node::fast_is<SVG::SVGViewElement>() const { return is_svg_view_element(); }

}