From 04cc837db9917d05eb70aab602e6f0fdd34fe1d4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 12 Jul 2022 20:07:35 +0200 Subject: LibWeb: Stub out two functions on SVGGeometryElement These two were called by Discord while loading: - float getTotalLength(); - DOMPoint getPointAtLength(float distance); --- Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp | 11 +++++++++++ Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h | 4 ++++ Userland/Libraries/LibWeb/SVG/SVGGeometryElement.idl | 4 ++++ 3 files changed, 19 insertions(+) (limited to 'Userland') diff --git a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp index 6a038af830..40c035ebed 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp @@ -19,4 +19,15 @@ RefPtr SVGGeometryElement::create_layout_node(NonnullRefPtr SVGGeometryElement::get_point_at_length(float distance) +{ + (void)distance; + return Geometry::DOMPoint::create(0, 0, 0, 0); +} + } diff --git a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h index 394f927863..dc52eb7d68 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h @@ -6,6 +6,7 @@ #pragma once +#include #include namespace Web::SVG { @@ -19,6 +20,9 @@ public: virtual Gfx::Path& get_path() = 0; + float get_total_length(); + NonnullRefPtr get_point_at_length(float distance); + protected: SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name); }; diff --git a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.idl b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.idl index 437cc278eb..047fddf84c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.idl +++ b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.idl @@ -1,5 +1,9 @@ +#import #import interface SVGGeometryElement : SVGGraphicsElement { + float getTotalLength(); + DOMPoint getPointAtLength(float distance); + }; -- cgit v1.2.3