2021-09-26 06:39:27 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-03-04 15:05:43 -05:00
|
|
|
#include <AK/FlyString.h>
|
2021-09-26 06:39:27 -04:00
|
|
|
#include <LibWeb/DOM/Event.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2021-10-01 12:05:28 -04:00
|
|
|
struct PageTransitionEventInit : public DOM::EventInit {
|
|
|
|
bool persisted { false };
|
|
|
|
};
|
|
|
|
|
2021-09-26 06:39:27 -04:00
|
|
|
class PageTransitionEvent final : public DOM::Event {
|
2022-08-28 07:42:07 -04:00
|
|
|
WEB_PLATFORM_OBJECT(PageTransitionEvent, DOM::Event);
|
2022-08-08 16:29:40 -04:00
|
|
|
|
2021-09-26 06:39:27 -04:00
|
|
|
public:
|
2023-03-04 15:05:43 -05:00
|
|
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<PageTransitionEvent>> create(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init);
|
|
|
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<PageTransitionEvent>> construct_impl(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init);
|
2021-09-26 06:39:27 -04:00
|
|
|
|
2023-03-04 15:05:43 -05:00
|
|
|
PageTransitionEvent(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init);
|
2021-09-26 06:39:27 -04:00
|
|
|
|
2022-08-08 16:29:40 -04:00
|
|
|
virtual ~PageTransitionEvent() override;
|
2021-09-26 06:39:27 -04:00
|
|
|
|
2022-08-08 16:29:40 -04:00
|
|
|
bool persisted() const { return m_persisted; }
|
2021-09-26 06:39:27 -04:00
|
|
|
|
2022-08-08 16:29:40 -04:00
|
|
|
private:
|
2023-01-28 12:33:35 -05:00
|
|
|
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2021-09-26 06:39:27 -04:00
|
|
|
bool m_persisted { false };
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|