summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-04-05 09:08:10 +0300
committerAndreas Kling <kling@serenityos.org>2023-04-28 18:11:44 +0200
commit51d64bdaeccec806aa25f47534670171422129fc (patch)
tree7e02bbb878eb165ec638ec1790c82c748caeace3 /Userland/Libraries
parenta0356a0302571774b5c22f581454869f4283a5e6 (diff)
downloadserenity-51d64bdaeccec806aa25f47534670171422129fc.zip
LibWeb: Add NestedHistory in DocumentState
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/HTML/DocumentState.cpp5
-rw-r--r--Userland/Libraries/LibWeb/HTML/DocumentState.h11
2 files changed, 15 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/DocumentState.cpp b/Userland/Libraries/LibWeb/HTML/DocumentState.cpp
index 760ce35c05..0bc1c586f4 100644
--- a/Userland/Libraries/LibWeb/HTML/DocumentState.cpp
+++ b/Userland/Libraries/LibWeb/HTML/DocumentState.cpp
@@ -18,6 +18,11 @@ void DocumentState::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_document);
+ for (auto& nested_history : m_nested_histories) {
+ for (auto& entry : nested_history.entries) {
+ visitor.visit(entry);
+ }
+ }
}
}
diff --git a/Userland/Libraries/LibWeb/HTML/DocumentState.h b/Userland/Libraries/LibWeb/HTML/DocumentState.h
index bff05961bf..ceda3244dd 100644
--- a/Userland/Libraries/LibWeb/HTML/DocumentState.h
+++ b/Userland/Libraries/LibWeb/HTML/DocumentState.h
@@ -21,6 +21,11 @@ class DocumentState final : public JS::Cell {
JS_CELL(DocumentState, JS::Cell);
public:
+ struct NestedHistory {
+ String id;
+ Vector<JS::NonnullGCPtr<SessionHistoryEntry>> entries;
+ };
+
virtual ~DocumentState();
enum class Client {
@@ -49,6 +54,9 @@ public:
[[nodiscard]] Optional<HTML::Origin> origin() const { return m_origin; }
void set_origin(Optional<HTML::Origin> origin) { m_origin = move(origin); }
+ [[nodiscard]] Vector<NestedHistory> const& nested_histories() const { return m_nested_histories; }
+ [[nodiscard]] Vector<NestedHistory>& nested_histories() { return m_nested_histories; }
+
[[nodiscard]] bool reload_pending() const { return m_reload_pending; }
void set_reload_pending(bool reload_pending) { m_reload_pending = reload_pending; }
@@ -81,7 +89,8 @@ private:
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-origin
Optional<HTML::Origin> m_origin;
- // FIXME: https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-nested-histories
+ // https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-nested-histories
+ Vector<NestedHistory> m_nested_histories;
// FIXME: https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-resource