ladybird/Libraries/LibWeb/HTML/CustomElements/CustomElementDefinition.cpp
Andreas Kling ceefe7d858 LibWeb: Make CustomElementDefinition relationship with GC more sane
1. Stop using GC::Root in member variables, since that usually creates
   a realm leak.

2. Stop putting OrderedHashMap<FlyString, GC::Ptr> on the stack while
   setting these up, since that won't protect the objects from GC.
2024-12-27 10:02:58 +01:00

23 lines
600 B
C++

/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/HTML/CustomElements/CustomElementDefinition.h>
namespace Web::HTML {
void CustomElementDefinition::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_constructor);
visitor.visit(m_lifecycle_callbacks);
for (auto& entry : m_construction_stack) {
entry.visit(
[&](GC::Ref<DOM::Element>& element) { visitor.visit(element); },
[&](AlreadyConstructedCustomElementMarker&) {});
}
}
}