mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 13:19:47 +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:
@@ -11,14 +11,14 @@
|
||||
namespace Web::HTML {
|
||||
|
||||
#undef __ENUMERATE
|
||||
#define __ENUMERATE(attribute_name, event_name) \
|
||||
void WindowEventHandlers::set_##attribute_name(Optional<Bindings::CallbackType> value) \
|
||||
{ \
|
||||
window_event_handlers_to_event_target().set_event_handler_attribute(event_name, move(value)); \
|
||||
} \
|
||||
Bindings::CallbackType* WindowEventHandlers::attribute_name() \
|
||||
{ \
|
||||
return window_event_handlers_to_event_target().event_handler_attribute(event_name); \
|
||||
#define __ENUMERATE(attribute_name, event_name) \
|
||||
void WindowEventHandlers::set_##attribute_name(Bindings::CallbackType* value) \
|
||||
{ \
|
||||
window_event_handlers_to_event_target().set_event_handler_attribute(event_name, value); \
|
||||
} \
|
||||
Bindings::CallbackType* WindowEventHandlers::attribute_name() \
|
||||
{ \
|
||||
return window_event_handlers_to_event_target().event_handler_attribute(event_name); \
|
||||
}
|
||||
ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE)
|
||||
#undef __ENUMERATE
|
||||
|
||||
Reference in New Issue
Block a user