SVGGeometryElement.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/Bindings/SVGGeometryElementPrototype.h>
  8. #include <LibWeb/Layout/SVGGeometryBox.h>
  9. #include <LibWeb/SVG/SVGGeometryElement.h>
  10. namespace Web::SVG {
  11. SVGGeometryElement::SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  12. : SVGGraphicsElement(document, move(qualified_name))
  13. {
  14. }
  15. void SVGGeometryElement::initialize(JS::Realm& realm)
  16. {
  17. Base::initialize(realm);
  18. WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGeometryElement);
  19. }
  20. JS::GCPtr<Layout::Node> SVGGeometryElement::create_layout_node(CSS::StyleProperties style)
  21. {
  22. return heap().allocate<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);
  32. }
  33. }