1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 07:15:08 +00:00
serenity/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.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

36 lines
985 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/DOM/Event.h>
namespace Web::HTML {
struct PageTransitionEventInit : public DOM::EventInit {
bool persisted { false };
};
class PageTransitionEvent final : public DOM::Event {
WEB_PLATFORM_OBJECT(PageTransitionEvent, DOM::Event);
public:
static PageTransitionEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init);
static PageTransitionEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init);
PageTransitionEvent(JS::Realm&, DeprecatedFlyString const& event_name, PageTransitionEventInit const& event_init);
virtual ~PageTransitionEvent() override;
bool persisted() const { return m_persisted; }
private:
virtual void initialize(JS::Realm&) override;
bool m_persisted { false };
};
}