/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace Web::HTML { WebIDL::ExceptionOr> SubmitEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init) { return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, event_name, event_init)); } WebIDL::ExceptionOr> SubmitEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init) { return create(realm, event_name, event_init); } SubmitEvent::SubmitEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, SubmitEventInit const& event_init) : DOM::Event(realm, event_name, event_init) , m_submitter(event_init.submitter) { } SubmitEvent::~SubmitEvent() = default; JS::ThrowCompletionOr SubmitEvent::initialize(JS::Realm& realm) { MUST_OR_THROW_OOM(Base::initialize(realm)); set_prototype(&Bindings::ensure_web_prototype(realm, "SubmitEvent")); return {}; } void SubmitEvent::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(m_submitter.ptr()); } }