2021-09-26 12:39:27 +02:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
|
2021-09-26 12:39:27 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-03-04 21:05:43 +01:00
|
|
|
#include <AK/FlyString.h>
|
2021-09-26 12:39:27 +02:00
|
|
|
#include <LibWeb/DOM/Event.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2021-10-01 19:05:28 +03:00
|
|
|
struct PageTransitionEventInit : public DOM::EventInit {
|
|
|
|
bool persisted { false };
|
|
|
|
};
|
|
|
|
|
2021-09-26 12:39:27 +02:00
|
|
|
class PageTransitionEvent final : public DOM::Event {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(PageTransitionEvent, DOM::Event);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(PageTransitionEvent);
|
2022-08-08 22:29:40 +02:00
|
|
|
|
2021-09-26 12:39:27 +02:00
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
[[nodiscard]] static GC::Ref<PageTransitionEvent> create(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const&);
|
|
|
|
static WebIDL::ExceptionOr<GC::Ref<PageTransitionEvent>> construct_impl(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const&);
|
2021-09-26 12:39:27 +02:00
|
|
|
|
2023-03-04 21:05:43 +01:00
|
|
|
PageTransitionEvent(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init);
|
2021-09-26 12:39:27 +02:00
|
|
|
|
2022-08-08 22:29:40 +02:00
|
|
|
virtual ~PageTransitionEvent() override;
|
2021-09-26 12:39:27 +02:00
|
|
|
|
2022-08-08 22:29:40 +02:00
|
|
|
bool persisted() const { return m_persisted; }
|
2021-09-26 12:39:27 +02:00
|
|
|
|
2022-08-08 22:29:40 +02:00
|
|
|
private:
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2021-09-26 12:39:27 +02:00
|
|
|
bool m_persisted { false };
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|