LibWeb: Add SessionHistoryEntry::document()

No behaviour change intended.
This commit is contained in:
Aliaksandr Kalenik
2024-03-27 16:14:52 +01:00
committed by Andreas Kling
parent b590d1b48b
commit ce325a9912
7 changed files with 35 additions and 24 deletions

View File

@@ -59,7 +59,7 @@ WebIDL::ExceptionOr<Optional<String>> NavigationHistoryEntry::url() const
// 4. If she's document does not equal document, and she's document state's request referrer policy
// is "no-referrer" or "origin", then return null.
if ((she->document_state()->document() != &document)
if ((she->document() != &document)
&& (she->document_state()->request_referrer_policy() == ReferrerPolicy::ReferrerPolicy::NoReferrer
|| she->document_state()->request_referrer_policy() == ReferrerPolicy::ReferrerPolicy::Origin))
return OptionalNone {};
@@ -120,7 +120,7 @@ bool NavigationHistoryEntry::same_document() const
return false;
// 3. Return true if this's session history entry's document equals document, and false otherwise.
return m_session_history_entry->document_state()->document() == &document;
return m_session_history_entry->document() == &document;
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-getstate