blob: 1329d868141e061a665e8a0b2f9656a805da4485 (
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
37
38
39
40
41
|
/*
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/DOM/Element.h>
namespace Web::SVG {
class SVGElement : public DOM::Element {
WEB_PLATFORM_OBJECT(SVGElement, DOM::Element);
public:
virtual bool requires_svg_container() const override { return true; }
HTML::DOMStringMap* dataset() { return m_dataset.ptr(); }
HTML::DOMStringMap const* dataset() const { return m_dataset.ptr(); }
protected:
SVGElement(DOM::Document&, DOM::QualifiedName);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
JS::GCPtr<HTML::DOMStringMap> m_dataset;
private:
virtual bool is_svg_element() const final { return true; }
};
}
namespace Web::DOM {
template<>
inline bool Node::fast_is<SVG::SVGElement>() const { return is_svg_element(); }
}
|