DOMPoint.cpp 852 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/Geometry/DOMPoint.h>
  8. #include <LibWeb/HTML/Window.h>
  9. namespace Web::Geometry {
  10. JS::NonnullGCPtr<DOMPoint> DOMPoint::construct_impl(JS::Realm& realm, double x, double y, double z, double w)
  11. {
  12. return *realm.heap().allocate<DOMPoint>(realm, realm, x, y, z, w);
  13. }
  14. JS::NonnullGCPtr<DOMPoint> DOMPoint::create_with_global_object(HTML::Window& window, double x, double y, double z, double w)
  15. {
  16. return construct_impl(window.realm(), x, y, z, w);
  17. }
  18. DOMPoint::DOMPoint(JS::Realm& realm, double x, double y, double z, double w)
  19. : DOMPointReadOnly(realm, x, y, z, w)
  20. {
  21. set_prototype(&Bindings::cached_web_prototype(realm, "DOMPoint"));
  22. }
  23. DOMPoint::~DOMPoint() = default;
  24. }