1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:47:35 +00:00

LibWeb: Move passing of Web object prototypes out of constructors

This commit is contained in:
Timothy Flynn 2023-01-10 06:56:59 -05:00 committed by Andreas Kling
parent 834202aeb9
commit af75493883
35 changed files with 157 additions and 23 deletions

View file

@ -20,13 +20,19 @@ JS::NonnullGCPtr<DOMRectList> DOMRectList::create(JS::Realm& realm, Vector<JS::H
}
DOMRectList::DOMRectList(JS::Realm& realm, Vector<JS::NonnullGCPtr<DOMRect>> rects)
: Bindings::LegacyPlatformObject(Bindings::cached_web_prototype(realm, "DOMRectList"))
: Bindings::LegacyPlatformObject(realm)
, m_rects(move(rects))
{
}
DOMRectList::~DOMRectList() = default;
void DOMRectList::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::DOMRectListPrototype>(realm, "DOMRectList"));
}
// https://drafts.fxtf.org/geometry-1/#dom-domrectlist-length
u32 DOMRectList::length() const
{