2022-02-07 00:04:10 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2024-04-27 12:09:58 +12:00
|
|
|
#include <LibWeb/Bindings/FocusEventPrototype.h>
|
2022-09-25 18:06:11 -06:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2022-02-07 00:04:10 +01:00
|
|
|
#include <LibWeb/UIEvents/FocusEvent.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::UIEvents {
|
|
|
|
|
|
2023-11-19 19:47:52 +01:00
|
|
|
JS_DEFINE_ALLOCATOR(FocusEvent);
|
|
|
|
|
|
2023-03-09 21:17:20 +01:00
|
|
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<FocusEvent>> FocusEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init)
|
2022-02-07 00:04:10 +01:00
|
|
|
{
|
2023-08-13 13:05:26 +02:00
|
|
|
return realm.heap().allocate<FocusEvent>(realm, realm, event_name, event_init);
|
2022-08-08 22:29:40 +02:00
|
|
|
}
|
|
|
|
|
|
2023-03-09 21:17:20 +01:00
|
|
|
FocusEvent::FocusEvent(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init)
|
2024-07-11 10:05:22 -04:00
|
|
|
: UIEvent(realm, event_name, event_init)
|
2022-08-08 22:29:40 +02:00
|
|
|
{
|
2022-02-07 00:04:10 +01:00
|
|
|
set_related_target(const_cast<DOM::EventTarget*>(event_init.related_target.ptr()));
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-14 13:21:51 -06:00
|
|
|
FocusEvent::~FocusEvent() = default;
|
2022-02-07 00:04:10 +01:00
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void FocusEvent::initialize(JS::Realm& realm)
|
2023-01-10 06:28:20 -05:00
|
|
|
{
|
2023-08-07 08:41:28 +02:00
|
|
|
Base::initialize(realm);
|
2024-03-16 13:13:08 +01:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(FocusEvent);
|
2023-01-10 06:28:20 -05:00
|
|
|
}
|
|
|
|
|
|
2022-02-07 00:04:10 +01:00
|
|
|
}
|