Serenity Operating System
at master 38 lines 1.1 kB view raw
1/* 2 * Copyright (c) 2020, the SerenityOS developers. 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7#pragma once 8 9#include <LibWeb/DOM/Event.h> 10#include <LibWeb/HTML/HTMLElement.h> 11 12namespace Web::HTML { 13 14struct SubmitEventInit : public DOM::EventInit { 15 JS::GCPtr<HTMLElement> submitter; 16}; 17 18class SubmitEvent final : public DOM::Event { 19 WEB_PLATFORM_OBJECT(SubmitEvent, DOM::Event); 20 21public: 22 static WebIDL::ExceptionOr<JS::NonnullGCPtr<SubmitEvent>> create(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); 23 static WebIDL::ExceptionOr<JS::NonnullGCPtr<SubmitEvent>> construct_impl(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); 24 25 virtual ~SubmitEvent() override; 26 27 JS::GCPtr<HTMLElement> submitter() const { return m_submitter; } 28 29private: 30 SubmitEvent(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); 31 32 virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override; 33 virtual void visit_edges(Cell::Visitor&) override; 34 35 JS::GCPtr<HTMLElement> m_submitter; 36}; 37 38}