1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibWeb: Add basic skeleton of HTML "session history" to BrowsingContext

This commit is contained in:
Andreas Kling 2022-08-01 16:34:56 +02:00
parent 29a4266367
commit c4a0b7057b
2 changed files with 61 additions and 1 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -16,6 +16,7 @@
#include <LibGfx/Size.h>
#include <LibWeb/DOM/Position.h>
#include <LibWeb/HTML/BrowsingContextContainer.h>
#include <LibWeb/HTML/SessionHistoryEntry.h>
#include <LibWeb/Loader/FrameLoader.h>
#include <LibWeb/Page/EventHandler.h>
#include <LibWeb/TreeNode.h>
@ -112,6 +113,9 @@ public:
String const& name() const { return m_name; }
void set_name(String const& name) { m_name = name; }
Vector<SessionHistoryEntry>& session_history() { return m_session_history; }
Vector<SessionHistoryEntry> const& session_history() const { return m_session_history; }
private:
explicit BrowsingContext(Page&, HTML::BrowsingContextContainer*);
@ -122,6 +126,9 @@ private:
FrameLoader m_loader;
Web::EventHandler m_event_handler;
// https://html.spec.whatwg.org/multipage/history.html#session-history
Vector<SessionHistoryEntry> m_session_history;
WeakPtr<HTML::BrowsingContextContainer> m_container;
RefPtr<DOM::Document> m_active_document;
Gfx::IntSize m_size;