2022-02-07 00:04:10 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
#include <LibWeb/HTML/Window.h>
|
2022-02-07 00:04:10 +01:00
|
|
|
#include <LibWeb/UIEvents/FocusEvent.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::UIEvents {
|
|
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
FocusEvent* FocusEvent::create_with_global_object(HTML::Window& window_object, FlyString const& event_name, FocusEventInit const& event_init)
|
2022-02-07 00:04:10 +01:00
|
|
|
{
|
2022-08-08 22:29:40 +02:00
|
|
|
return window_object.heap().allocate<FocusEvent>(window_object.realm(), window_object, event_name, event_init);
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
FocusEvent::FocusEvent(HTML::Window& window_object, FlyString const& event_name, FocusEventInit const& event_init)
|
2022-08-08 22:29:40 +02:00
|
|
|
: UIEvent(window_object, event_name)
|
|
|
|
|
{
|
2022-09-03 18:43:24 +02:00
|
|
|
set_prototype(&window_object.cached_web_prototype("FocusEvent"));
|
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
|
|
|
|
|
|
|
|
}
|