mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
LibWeb: Make DOMRect, DOMRectReadOnly and DOMRectList GC-allocated
This commit is contained in:
parent
44415af428
commit
57db2529cf
11 changed files with 125 additions and 79 deletions
26
Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp
Normal file
26
Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Geometry/DOMRectReadOnly.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
namespace Web::Geometry {
|
||||
|
||||
JS::NonnullGCPtr<DOMRectReadOnly> DOMRectReadOnly::create_with_global_object(HTML::Window& window, double x, double y, double width, double height)
|
||||
{
|
||||
return *window.heap().allocate<DOMRectReadOnly>(window.realm(), window, x, y, width, height);
|
||||
}
|
||||
|
||||
DOMRectReadOnly::DOMRectReadOnly(HTML::Window& window, double x, double y, double width, double height)
|
||||
: PlatformObject(window.realm())
|
||||
, m_rect(x, y, width, height)
|
||||
{
|
||||
set_prototype(&window.cached_web_prototype("DOMRectReadOnly"));
|
||||
}
|
||||
|
||||
DOMRectReadOnly::~DOMRectReadOnly() = default;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue