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

@@ -28,4 +28,13 @@ SessionHistoryEntry::SessionHistoryEntry()
{
}
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-document
JS::GCPtr<DOM::Document> SessionHistoryEntry::document() const
{
// To get a session history entry's document, return its document state's document.
if (!m_document_state)
return {};
return m_document_state->document();
}
}