2023-08-23 15:34:02 -06:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
|
|
#include <LibWeb/HTML/NavigationType.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationtransition
|
|
|
|
class NavigationTransition : public Bindings::PlatformObject {
|
|
|
|
WEB_PLATFORM_OBJECT(NavigationTransition, Bindings::PlatformObject);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(NavigationTransition);
|
2023-08-23 15:34:02 -06:00
|
|
|
|
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
[[nodiscard]] static GC::Ref<NavigationTransition> create(JS::Realm&, Bindings::NavigationType, GC::Ref<NavigationHistoryEntry>, GC::Ref<WebIDL::Promise>);
|
2023-08-23 15:34:02 -06:00
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationtransition-navigationtype
|
|
|
|
Bindings::NavigationType navigation_type() const { return m_navigation_type; }
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationtransition-from
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<NavigationHistoryEntry> from() const { return m_from_entry; }
|
2023-08-23 15:34:02 -06:00
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationtransition-finished
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<WebIDL::Promise> finished() const { return m_finished_promise; }
|
2023-08-23 15:34:02 -06:00
|
|
|
|
|
|
|
virtual ~NavigationTransition() override;
|
|
|
|
|
|
|
|
private:
|
2024-11-15 04:01:23 +13:00
|
|
|
NavigationTransition(JS::Realm&, Bindings::NavigationType, GC::Ref<NavigationHistoryEntry>, GC::Ref<WebIDL::Promise>);
|
2023-08-23 15:34:02 -06:00
|
|
|
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
virtual void visit_edges(JS::Cell::Visitor&) override;
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-navigationtransition-navigationtype
|
|
|
|
Bindings::NavigationType m_navigation_type;
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-navigationtransition-from
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<NavigationHistoryEntry> m_from_entry;
|
2023-08-23 15:34:02 -06:00
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-navigationtransition-finished
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<WebIDL::Promise> m_finished_promise;
|
2023-08-23 15:34:02 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|