ladybird/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h
Timothy Flynn 834202aeb9 LibWeb: Move setting of Web object prototypes to initialize()
This needs to happen before prototype/constructor intitialization can be
made lazy. Otherwise, GC could run during the C++ constructor and try to
collect the object currently being created.
2023-01-10 16:08:14 +01:00

32 lines
703 B
C++

/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/UIEvents/UIEvent.h>
namespace Web::UIEvents {
struct FocusEventInit : public UIEventInit {
JS::GCPtr<DOM::EventTarget> related_target;
};
class FocusEvent final : public UIEvent {
WEB_PLATFORM_OBJECT(FocusEvent, UIEvent);
public:
static FocusEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init);
virtual ~FocusEvent() override;
private:
FocusEvent(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const&);
virtual void initialize(JS::Realm&) override;
};
}