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
commit af75493883
Notes: sideshowbarker 2024-07-17 01:51:06 +09:00
35 changed files with 157 additions and 23 deletions

View file

@ -20,11 +20,17 @@ JS::NonnullGCPtr<NamedNodeMap> NamedNodeMap::create(Element& element)
}
NamedNodeMap::NamedNodeMap(Element& element)
: Bindings::LegacyPlatformObject(Bindings::cached_web_prototype(element.realm(), "NamedNodeMap"))
: Bindings::LegacyPlatformObject(element.realm())
, m_element(element)
{
}
void NamedNodeMap::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::NamedNodeMapPrototype>(realm, "NamedNodeMap"));
}
void NamedNodeMap::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);