2020-11-21 21:53:18 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-11-21 21:53:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibWeb/DOM/Event.h>
|
2021-10-01 18:46:37 +03:00
|
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
2020-11-21 21:53:18 +00:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2021-10-01 18:46:37 +03:00
|
|
|
struct SubmitEventInit : public DOM::EventInit {
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ptr<HTMLElement> submitter;
|
2021-10-01 18:46:37 +03:00
|
|
|
};
|
|
|
|
|
2020-11-21 21:53:18 +00:00
|
|
|
class SubmitEvent final : public DOM::Event {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(SubmitEvent, DOM::Event);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(SubmitEvent);
|
2022-08-08 22:29:40 +02:00
|
|
|
|
2020-11-21 21:53:18 +00:00
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
[[nodiscard]] static GC::Ref<SubmitEvent> create(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init);
|
|
|
|
static WebIDL::ExceptionOr<GC::Ref<SubmitEvent>> construct_impl(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init);
|
2022-08-08 22:29:40 +02:00
|
|
|
|
|
|
|
virtual ~SubmitEvent() override;
|
2020-11-21 21:53:18 +00:00
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ptr<HTMLElement> submitter() const { return m_submitter; }
|
2020-11-21 21:53:18 +00:00
|
|
|
|
|
|
|
private:
|
2023-03-05 10:58:45 +01:00
|
|
|
SubmitEvent(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init);
|
2022-09-25 16:38:21 -06:00
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2022-08-28 13:42:07 +02:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ptr<HTMLElement> m_submitter;
|
2020-11-21 21:53:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|