1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:07:44 +00:00

LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated

This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
This commit is contained in:
Andreas Kling 2022-08-28 13:42:07 +02:00
parent bb547ce1c4
commit 6f433c8656
445 changed files with 4797 additions and 4268 deletions

View file

@ -22,18 +22,16 @@ struct MouseEventInit : public EventModifierInit {
};
class MouseEvent final : public UIEvent {
JS_OBJECT(MouseEvent, UIEvent);
WEB_PLATFORM_OBJECT(MouseEvent, UIEvent);
public:
static MouseEvent* create(Bindings::WindowObject&, FlyString const& event_name, MouseEventInit const& event_init = {});
static MouseEvent* create_from_platform_event(Bindings::WindowObject&, FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y, unsigned mouse_button = 1);
static MouseEvent* create(HTML::Window&, FlyString const& event_name, MouseEventInit const& event_init = {});
static MouseEvent* create_from_platform_event(HTML::Window&, FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y, unsigned mouse_button = 1);
MouseEvent(Bindings::WindowObject&, FlyString const& event_name, MouseEventInit const& event_init);
MouseEvent(HTML::Window&, FlyString const& event_name, MouseEventInit const& event_init);
virtual ~MouseEvent() override;
MouseEvent& impl() { return *this; }
double offset_x() const { return m_offset_x; }
double offset_y() const { return m_offset_y; }