From 8e03f8cb4a13489469d12230b080eeab99035d3a Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 23 Aug 2023 11:08:05 -0600 Subject: [PATCH] LibWeb: Use window.navigation in NavigationHistoryEntry::index --- Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp b/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp index 4759d71363..40838e5c52 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp +++ b/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -100,9 +101,9 @@ i64 NavigationHistoryEntry::index() const if (!this_relevant_global_object.associated_document().is_fully_active()) return -1; - // FIXME 2. Return the result of getting the navigation API entry index of this's session history entry + // 2. Return the result of getting the navigation API entry index of this's session history entry // within this's relevant global object's navigation API. - return -1; + return this_relevant_global_object.navigation()->get_the_navigation_api_entry_index(*m_session_history_entry); } // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-samedocument