/src/serenity/Userland/Libraries/LibWeb/HTML/NavigationCurrentEntryChangeEvent.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibJS/Heap/Heap.h> |
8 | | #include <LibJS/Runtime/Realm.h> |
9 | | #include <LibWeb/Bindings/Intrinsics.h> |
10 | | #include <LibWeb/Bindings/NavigationCurrentEntryChangeEventPrototype.h> |
11 | | #include <LibWeb/HTML/NavigationCurrentEntryChangeEvent.h> |
12 | | #include <LibWeb/HTML/NavigationHistoryEntry.h> |
13 | | |
14 | | namespace Web::HTML { |
15 | | |
16 | | JS_DEFINE_ALLOCATOR(NavigationCurrentEntryChangeEvent); |
17 | | |
18 | | JS::NonnullGCPtr<NavigationCurrentEntryChangeEvent> NavigationCurrentEntryChangeEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, NavigationCurrentEntryChangeEventInit const& event_init) |
19 | 0 | { |
20 | 0 | return realm.heap().allocate<NavigationCurrentEntryChangeEvent>(realm, realm, event_name, event_init); |
21 | 0 | } |
22 | | |
23 | | NavigationCurrentEntryChangeEvent::NavigationCurrentEntryChangeEvent(JS::Realm& realm, FlyString const& event_name, NavigationCurrentEntryChangeEventInit const& event_init) |
24 | 0 | : DOM::Event(realm, event_name, event_init) |
25 | 0 | , m_navigation_type(event_init.navigation_type) |
26 | 0 | , m_from(*event_init.from) |
27 | 0 | { |
28 | 0 | } |
29 | | |
30 | 0 | NavigationCurrentEntryChangeEvent::~NavigationCurrentEntryChangeEvent() = default; |
31 | | |
32 | | void NavigationCurrentEntryChangeEvent::initialize(JS::Realm& realm) |
33 | 0 | { |
34 | 0 | Base::initialize(realm); |
35 | 0 | WEB_SET_PROTOTYPE_FOR_INTERFACE(NavigationCurrentEntryChangeEvent); |
36 | 0 | } |
37 | | |
38 | | void NavigationCurrentEntryChangeEvent::visit_edges(JS::Cell::Visitor& visitor) |
39 | 0 | { |
40 | 0 | Base::visit_edges(visitor); |
41 | 0 | visitor.visit(m_from); |
42 | 0 | } |
43 | | |
44 | | } |