summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/SVGSVGBox.h
blob: 4e91029664b7a1ed80ed717d101eca85c3024b5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibWeb/Layout/ReplacedBox.h>
#include <LibWeb/SVG/SVGSVGElement.h>

namespace Web::Layout {

class SVGSVGBox final : public ReplacedBox {
    JS_CELL(SVGSVGBox, ReplacedBox);

public:
    SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, NonnullRefPtr<CSS::StyleProperties>);
    virtual ~SVGSVGBox() override = default;

    SVG::SVGSVGElement& dom_node() { return verify_cast<SVG::SVGSVGElement>(ReplacedBox::dom_node()); }

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

    virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;

    virtual void prepare_for_replaced_layout() override;

private:
    virtual bool is_svg_svg_box() const final { return true; }
};

template<>
inline bool Node::fast_is<SVGSVGBox>() const { return is_svg_svg_box(); }

}