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
|
|
|
|
|
2022-07-12 20:07:35 +02:00
|
|
|
#include <LibWeb/Geometry/DOMPoint.h>
|
2020-07-23 09:44:42 -07:00
|
|
|
#include <LibWeb/SVG/SVGGraphicsElement.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
|
|
|
|
2022-02-11 12:32:55 +00:00
|
|
|
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
|
2020-07-23 09:44:42 -07:00
|
|
|
class SVGGeometryElement : public SVGGraphicsElement {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(SVGGeometryElement, SVGGraphicsElement);
|
2020-10-02 20:57:28 +01:00
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
public:
|
2024-12-20 16:35:12 +01:00
|
|
|
virtual GC::Ptr<Layout::Node> create_layout_node(GC::Ref<CSS::ComputedProperties>) override;
|
2022-02-11 12:32:55 +00:00
|
|
|
|
2024-08-09 14:00:10 +02:00
|
|
|
virtual Gfx::Path get_path(CSSPixelSize viewport_size) = 0;
|
2022-02-11 12:32:55 +00:00
|
|
|
|
2022-07-12 20:07:35 +02:00
|
|
|
float get_total_length();
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<Geometry::DOMPoint> get_point_at_length(float distance);
|
2022-07-12 20:07:35 +02:00
|
|
|
|
2020-07-26 17:47:26 +02:00
|
|
|
protected:
|
2022-02-18 21:00:52 +01:00
|
|
|
SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name);
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2020-07-19 23:01:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|