
This is a monster patch that turns all EventTargets into GC-allocated PlatformObjects. Their C++ wrapper classes are removed, and the LibJS garbage collector is now responsible for their lifetimes. There's a fair amount of hacks and band-aids in this patch, and we'll have a lot of cleanup to do after this.
32 lines
823 B
C++
32 lines
823 B
C++
/*
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Geometry/DOMPoint.h>
|
|
#include <LibWeb/SVG/SVGGraphicsElement.h>
|
|
|
|
namespace Web::SVG {
|
|
|
|
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
|
|
class SVGGeometryElement : public SVGGraphicsElement {
|
|
WEB_PLATFORM_OBJECT(SVGGeometryElement, SVGGraphicsElement);
|
|
|
|
public:
|
|
virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
|
|
|
virtual Gfx::Path& get_path() = 0;
|
|
|
|
float get_total_length();
|
|
NonnullRefPtr<Geometry::DOMPoint> get_point_at_length(float distance);
|
|
|
|
protected:
|
|
SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name);
|
|
};
|
|
|
|
}
|
|
|
|
WRAPPER_HACK(SVGGeometryElement, Web::SVG)
|