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