mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:38:10 +00:00
LibWeb: Move passing of Web object prototypes out of constructors
This commit is contained in:
parent
834202aeb9
commit
af75493883
35 changed files with 157 additions and 23 deletions
|
@ -19,7 +19,7 @@ JS::NonnullGCPtr<HTMLCollection> HTMLCollection::create(ParentNode& root, Functi
|
|||
}
|
||||
|
||||
HTMLCollection::HTMLCollection(ParentNode& root, Function<bool(Element const&)> filter)
|
||||
: LegacyPlatformObject(Bindings::cached_web_prototype(root.realm(), "HTMLCollection"))
|
||||
: LegacyPlatformObject(root.realm())
|
||||
, m_root(root)
|
||||
, m_filter(move(filter))
|
||||
{
|
||||
|
@ -27,6 +27,12 @@ HTMLCollection::HTMLCollection(ParentNode& root, Function<bool(Element const&)>
|
|||
|
||||
HTMLCollection::~HTMLCollection() = default;
|
||||
|
||||
void HTMLCollection::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLCollectionPrototype>(realm, "HTMLCollection"));
|
||||
}
|
||||
|
||||
void HTMLCollection::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue