LibWeb: Add {,de}serialization steps for DOMRect

This commit is contained in:
Kenneth Myhra 2024-03-10 09:43:00 +01:00 committed by Andreas Kling
parent 9f5fa4f4a0
commit 94c6389fc0
Notes: sideshowbarker 2024-07-17 02:39:10 +09:00
5 changed files with 23 additions and 0 deletions

View file

@ -22,6 +22,11 @@ JS::NonnullGCPtr<DOMRect> DOMRect::create(JS::Realm& realm, Gfx::FloatRect const
return realm.heap().allocate<DOMRect>(realm, realm, rect.x(), rect.y(), rect.width(), rect.height());
}
JS::NonnullGCPtr<DOMRect> DOMRect::create(JS::Realm& realm)
{
return realm.heap().allocate<DOMRect>(realm, realm);
}
// https://drafts.fxtf.org/geometry/#create-a-domrect-from-the-dictionary
JS::NonnullGCPtr<DOMRect> DOMRect::from_rect(JS::VM& vm, Geometry::DOMRectInit const& other)
{
@ -34,6 +39,11 @@ DOMRect::DOMRect(JS::Realm& realm, double x, double y, double width, double heig
{
}
DOMRect::DOMRect(JS::Realm& realm)
: DOMRectReadOnly(realm)
{
}
DOMRect::~DOMRect() = default;
void DOMRect::initialize(JS::Realm& realm)