/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::UIEvents { struct FocusEventInit : public UIEventInit { GC::Ptr related_target; }; class FocusEvent final : public UIEvent { WEB_PLATFORM_OBJECT(FocusEvent, UIEvent); GC_DECLARE_ALLOCATOR(FocusEvent); public: [[nodiscard]] static GC::Ref create(JS::Realm&, FlyString const& event_name, FocusEventInit const& = {}); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, FlyString const& event_name, FocusEventInit const& event_init); virtual ~FocusEvent() override; private: FocusEvent(JS::Realm&, FlyString const& event_name, FocusEventInit const&); virtual void initialize(JS::Realm&) override; }; }