mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 01:54:57 +00:00

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.
26 lines
1.1 KiB
C++
26 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/HTML/EventHandler.h>
|
|
#include <LibWeb/XHR/EventNames.h>
|
|
#include <LibWeb/XHR/XMLHttpRequestEventTarget.h>
|
|
|
|
namespace Web::XHR {
|
|
|
|
#undef __ENUMERATE
|
|
#define __ENUMERATE(attribute_name, event_name) \
|
|
void XMLHttpRequestEventTarget::set_##attribute_name(Bindings::CallbackType* value) \
|
|
{ \
|
|
set_event_handler_attribute(event_name, value); \
|
|
} \
|
|
Bindings::CallbackType* XMLHttpRequestEventTarget::attribute_name() \
|
|
{ \
|
|
return event_handler_attribute(event_name); \
|
|
}
|
|
ENUMERATE_XML_HTTP_REQUEST_EVENT_TARGET_EVENT_HANDLERS(__ENUMERATE)
|
|
#undef __ENUMERATE
|
|
|
|
}
|