DOMRectReadOnly.cpp 745 B

1234567891011121314151617181920212223242526
  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/DOMRectReadOnly.h>
  8. namespace Web::Geometry {
  9. JS::NonnullGCPtr<DOMRectReadOnly> DOMRectReadOnly::construct_impl(JS::Realm& realm, double x, double y, double width, double height)
  10. {
  11. return *realm.heap().allocate<DOMRectReadOnly>(realm, realm, x, y, width, height);
  12. }
  13. DOMRectReadOnly::DOMRectReadOnly(JS::Realm& realm, double x, double y, double width, double height)
  14. : PlatformObject(realm)
  15. , m_rect(x, y, width, height)
  16. {
  17. set_prototype(&Bindings::cached_web_prototype(realm, "DOMRectReadOnly"));
  18. }
  19. DOMRectReadOnly::~DOMRectReadOnly() = default;
  20. }