1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

LibWeb: Move event listeners, handlers and callbacks to the GC heap

This patch moves the following things to being GC-allocated:
- Bindings::CallbackType
- HTML::EventHandler
- DOM::IDLEventListener
- DOM::DOMEventListener
- DOM::NodeFilter

Note that we only use PlatformObject for things that might be exposed
to web content. Anything that is only used internally inherits directly
from JS::Cell instead, making them a bit more lightweight.
This commit is contained in:
Andreas Kling 2022-08-08 14:12:01 +02:00
parent 967a3e5a45
commit 8cda70c892
57 changed files with 425 additions and 345 deletions

View file

@ -45,10 +45,10 @@ public:
virtual void unref_event_target() override { unref(); }
virtual JS::Object* create_wrapper(JS::Realm&) override;
void add_listener(RefPtr<DOM::IDLEventListener> listener);
void remove_listener(RefPtr<DOM::IDLEventListener> listener);
void add_listener(DOM::IDLEventListener*);
void remove_listener(DOM::IDLEventListener*);
void set_onchange(Optional<Bindings::CallbackType>);
void set_onchange(Bindings::CallbackType*);
Bindings::CallbackType* onchange();
private: