2020-07-19 23:01:53 -07:00
|
|
|
/*
|
2021-04-22 16:53:07 -07:00
|
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
2020-07-19 23:01:53 -07:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-07-19 23:01:53 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibGfx/Bitmap.h>
|
2020-07-26 15:08:16 +02:00
|
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
2022-02-11 13:08:27 +00:00
|
|
|
#include <LibWeb/SVG/AttributeParser.h>
|
2020-07-23 09:44:42 -07:00
|
|
|
#include <LibWeb/SVG/SVGGeometryElement.h>
|
2020-07-19 23:01:53 -07:00
|
|
|
|
2020-07-23 09:44:42 -07:00
|
|
|
namespace Web::SVG {
|
2020-07-19 23:01:53 -07:00
|
|
|
|
2020-07-23 09:44:42 -07:00
|
|
|
class SVGPathElement final : public SVGGeometryElement {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(SVGPathElement, SVGGeometryElement);
|
2023-11-19 19:47:52 +01:00
|
|
|
JS_DECLARE_ALLOCATOR(SVGPathElement);
|
2020-10-02 20:57:28 +01:00
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
public:
|
2020-07-23 09:44:42 -07:00
|
|
|
virtual ~SVGPathElement() override = default;
|
2020-07-19 23:01:53 -07:00
|
|
|
|
2024-07-09 20:18:41 +01:00
|
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value) override;
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2024-08-08 10:22:03 +02:00
|
|
|
virtual Gfx::DeprecatedPath get_path(CSSPixelSize viewport_size) override;
|
2020-07-19 23:01:53 -07:00
|
|
|
|
|
|
|
private:
|
2022-08-28 13:42:07 +02:00
|
|
|
SVGPathElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2020-07-19 23:01:53 -07:00
|
|
|
Vector<PathInstruction> m_instructions;
|
|
|
|
};
|
|
|
|
|
2024-08-08 15:12:29 +02:00
|
|
|
[[nodiscard]] Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction>);
|
|
|
|
[[nodiscard]] Gfx::DeprecatedPath deprecated_path_from_path_instructions(ReadonlySpan<PathInstruction>);
|
2022-11-29 14:06:41 +01:00
|
|
|
|
2020-07-19 23:01:53 -07:00
|
|
|
}
|