SVGGeometryElement.cpp 1.2 KB

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