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