SVGGeometryElement.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. void SVGGeometryElement::initialize(JS::Realm& realm)
  15. {
  16. Base::initialize(realm);
  17. WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGeometryElement);
  18. }
  19. JS::GCPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
  20. {
  21. return heap().allocate_without_realm<Layout::SVGGeometryBox>(document(), *this, move(style));
  22. }
  23. float SVGGeometryElement::get_total_length()
  24. {
  25. return 0;
  26. }
  27. JS::NonnullGCPtr<Geometry::DOMPoint> SVGGeometryElement::get_point_at_length(float distance)
  28. {
  29. (void)distance;
  30. return Geometry::DOMPoint::construct_impl(realm(), 0, 0, 0, 0);
  31. }
  32. }