mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibWeb: Make DOMPoint and DOMPointReadOnly GC-allocated
This commit is contained in:
parent
a9cae56f8e
commit
44415af428
9 changed files with 78 additions and 43 deletions
29
Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp
Normal file
29
Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Geometry/DOMPointReadOnly.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
namespace Web::Geometry {
|
||||
|
||||
JS::NonnullGCPtr<DOMPointReadOnly> DOMPointReadOnly::create_with_global_object(HTML::Window& window, double x, double y, double z, double w)
|
||||
{
|
||||
return *window.heap().allocate<DOMPointReadOnly>(window.realm(), window, x, y, z, w);
|
||||
}
|
||||
|
||||
DOMPointReadOnly::DOMPointReadOnly(HTML::Window& window, double x, double y, double z, double w)
|
||||
: PlatformObject(window.realm())
|
||||
, m_x(x)
|
||||
, m_y(y)
|
||||
, m_z(z)
|
||||
, m_w(w)
|
||||
{
|
||||
set_prototype(&window.cached_web_prototype("DOMPointReadOnly"));
|
||||
}
|
||||
|
||||
DOMPointReadOnly::~DOMPointReadOnly() = default;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue