mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibWeb: Visit custom element's lifecycle callbacks
...instead of using JS::Handle which causes leaks when object holding the callback can be reached by visiting the callback's dependencies.
This commit is contained in:
parent
3d48c55e50
commit
3b4230e0b0
5 changed files with 26 additions and 5 deletions
|
@ -20,7 +20,7 @@ class CustomElementDefinition : public JS::Cell {
|
|||
JS_CELL(CustomElementDefinition, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(CustomElementDefinition);
|
||||
|
||||
using LifecycleCallbacksStorage = OrderedHashMap<FlyString, JS::Handle<WebIDL::CallbackType>>;
|
||||
using LifecycleCallbacksStorage = OrderedHashMap<FlyString, JS::GCPtr<WebIDL::CallbackType>>;
|
||||
using ConstructionStackStorage = Vector<Variant<JS::Handle<DOM::Element>, AlreadyConstructedCustomElementMarker>>;
|
||||
|
||||
static JS::NonnullGCPtr<CustomElementDefinition> create(JS::Realm& realm, String const& name, String const& local_name, WebIDL::CallbackType& constructor, Vector<String>&& observed_attributes, LifecycleCallbacksStorage&& lifecycle_callbacks, bool form_associated, bool disable_internals, bool disable_shadow)
|
||||
|
@ -60,6 +60,8 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-name
|
||||
// A name
|
||||
// A valid custom element name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue