/src/serenity/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2021, Andreas Kling <kling@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <AK/FlyString.h> |
10 | | #include <LibWeb/DOM/Event.h> |
11 | | |
12 | | namespace Web::HTML { |
13 | | |
14 | | struct PageTransitionEventInit : public DOM::EventInit { |
15 | | bool persisted { false }; |
16 | | }; |
17 | | |
18 | | class PageTransitionEvent final : public DOM::Event { |
19 | | WEB_PLATFORM_OBJECT(PageTransitionEvent, DOM::Event); |
20 | | JS_DECLARE_ALLOCATOR(PageTransitionEvent); |
21 | | |
22 | | public: |
23 | | [[nodiscard]] static JS::NonnullGCPtr<PageTransitionEvent> create(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const&); |
24 | | static WebIDL::ExceptionOr<JS::NonnullGCPtr<PageTransitionEvent>> construct_impl(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const&); |
25 | | |
26 | | PageTransitionEvent(JS::Realm&, FlyString const& event_name, PageTransitionEventInit const& event_init); |
27 | | |
28 | | virtual ~PageTransitionEvent() override; |
29 | | |
30 | 0 | bool persisted() const { return m_persisted; } |
31 | | |
32 | | private: |
33 | | virtual void initialize(JS::Realm&) override; |
34 | | |
35 | | bool m_persisted { false }; |
36 | | }; |
37 | | |
38 | | } |