/src/serenity/Userland/Libraries/LibWeb/SVG/SVGPathElement.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <LibGfx/Bitmap.h> |
10 | | #include <LibWeb/HTML/HTMLElement.h> |
11 | | #include <LibWeb/SVG/AttributeParser.h> |
12 | | #include <LibWeb/SVG/SVGGeometryElement.h> |
13 | | |
14 | | namespace Web::SVG { |
15 | | |
16 | | class SVGPathElement final : public SVGGeometryElement { |
17 | | WEB_PLATFORM_OBJECT(SVGPathElement, SVGGeometryElement); |
18 | | JS_DECLARE_ALLOCATOR(SVGPathElement); |
19 | | |
20 | | public: |
21 | 0 | virtual ~SVGPathElement() override = default; |
22 | | |
23 | | virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value) override; |
24 | | |
25 | | virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; |
26 | | |
27 | | private: |
28 | | SVGPathElement(DOM::Document&, DOM::QualifiedName); |
29 | | |
30 | | virtual void initialize(JS::Realm&) override; |
31 | | |
32 | | Vector<PathInstruction> m_instructions; |
33 | | }; |
34 | | |
35 | | Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction>); |
36 | | |
37 | | } |