1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 21:37:34 +00:00

LibWeb: Stub out two functions on SVGGeometryElement

These two were called by Discord while loading:

- float getTotalLength();
- DOMPoint getPointAtLength(float distance);
This commit is contained in:
Andreas Kling 2022-07-12 20:07:35 +02:00
parent e883777a18
commit 04cc837db9
3 changed files with 19 additions and 0 deletions

View file

@ -19,4 +19,15 @@ RefPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::S
return adopt_ref(*new Layout::SVGGeometryBox(document(), *this, move(style)));
}
float SVGGeometryElement::get_total_length()
{
return 0;
}
NonnullRefPtr<Geometry::DOMPoint> SVGGeometryElement::get_point_at_length(float distance)
{
(void)distance;
return Geometry::DOMPoint::create(0, 0, 0, 0);
}
}

View file

@ -6,6 +6,7 @@
#pragma once
#include <LibWeb/Geometry/DOMPoint.h>
#include <LibWeb/SVG/SVGGraphicsElement.h>
namespace Web::SVG {
@ -19,6 +20,9 @@ public:
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);
};

View file

@ -1,5 +1,9 @@
#import <Geometry/DOMPoint.idl>
#import <SVG/SVGGraphicsElement.idl>
interface SVGGeometryElement : SVGGraphicsElement {
float getTotalLength();
DOMPoint getPointAtLength(float distance);
};