Serenity Operating System
1/*
2 * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include <LibWeb/Bindings/Intrinsics.h>
8#include <LibWeb/Layout/SVGGeometryBox.h>
9#include <LibWeb/SVG/SVGGeometryElement.h>
10
11namespace Web::SVG {
12
13SVGGeometryElement::SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name)
14 : SVGGraphicsElement(document, move(qualified_name))
15{
16}
17
18JS::ThrowCompletionOr<void> SVGGeometryElement::initialize(JS::Realm& realm)
19{
20 MUST_OR_THROW_OOM(Base::initialize(realm));
21 set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGGeometryElementPrototype>(realm, "SVGGeometryElement"));
22
23 return {};
24}
25
26JS::GCPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
27{
28 return heap().allocate_without_realm<Layout::SVGGeometryBox>(document(), *this, move(style));
29}
30
31float SVGGeometryElement::get_total_length()
32{
33 return 0;
34}
35
36JS::NonnullGCPtr<Geometry::DOMPoint> SVGGeometryElement::get_point_at_length(float distance)
37{
38 (void)distance;
39 return Geometry::DOMPoint::construct_impl(realm(), 0, 0, 0, 0).release_value_but_fixme_should_propagate_errors();
40}
41
42}