mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibWeb: Make DOM::Event and all its subclasses GC-allocated
This commit is contained in:
parent
a4ddb0ef87
commit
7c3db526b0
Notes:
sideshowbarker
2024-07-17 07:28:23 +09:00
Author: https://github.com/awesomekling
Commit: 7c3db526b0
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
76 changed files with 892 additions and 565 deletions
|
@ -17,29 +17,21 @@ struct SubmitEventInit : public DOM::EventInit {
|
|||
};
|
||||
|
||||
class SubmitEvent final : public DOM::Event {
|
||||
JS_OBJECT(SubmitEvent, DOM::Event);
|
||||
|
||||
public:
|
||||
using WrapperType = Bindings::SubmitEventWrapper;
|
||||
static SubmitEvent* create(Bindings::WindowObject&, FlyString const& event_name, SubmitEventInit const& event_init);
|
||||
static SubmitEvent* create_with_global_object(Bindings::WindowObject&, FlyString const& event_name, SubmitEventInit const& event_init);
|
||||
|
||||
static NonnullRefPtr<SubmitEvent> create(FlyString const& event_name, SubmitEventInit const& event_init)
|
||||
{
|
||||
return adopt_ref(*new SubmitEvent(event_name, event_init));
|
||||
}
|
||||
static NonnullRefPtr<SubmitEvent> create_with_global_object(Bindings::WindowObject&, FlyString const& event_name, SubmitEventInit const& event_init)
|
||||
{
|
||||
return SubmitEvent::create(event_name, event_init);
|
||||
}
|
||||
virtual ~SubmitEvent() override;
|
||||
|
||||
virtual ~SubmitEvent() override = default;
|
||||
SubmitEvent(Bindings::WindowObject&, FlyString const& event_name, SubmitEventInit const& event_init);
|
||||
|
||||
SubmitEvent& impl() { return *this; }
|
||||
|
||||
RefPtr<HTMLElement> submitter() const { return m_submitter; }
|
||||
|
||||
private:
|
||||
SubmitEvent(FlyString const& event_name, SubmitEventInit const& event_init)
|
||||
: DOM::Event(event_name, event_init)
|
||||
, m_submitter(event_init.submitter)
|
||||
{
|
||||
}
|
||||
|
||||
RefPtr<HTMLElement> m_submitter;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue