mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
LibWeb: Add NestedHistory in DocumentState
This commit is contained in:
parent
a0356a0302
commit
51d64bdaec
2 changed files with 15 additions and 1 deletions
|
@ -18,6 +18,11 @@ void DocumentState::visit_edges(Cell::Visitor& visitor)
|
||||||
{
|
{
|
||||||
Base::visit_edges(visitor);
|
Base::visit_edges(visitor);
|
||||||
visitor.visit(m_document);
|
visitor.visit(m_document);
|
||||||
|
for (auto& nested_history : m_nested_histories) {
|
||||||
|
for (auto& entry : nested_history.entries) {
|
||||||
|
visitor.visit(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,11 @@ class DocumentState final : public JS::Cell {
|
||||||
JS_CELL(DocumentState, JS::Cell);
|
JS_CELL(DocumentState, JS::Cell);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
struct NestedHistory {
|
||||||
|
String id;
|
||||||
|
Vector<JS::NonnullGCPtr<SessionHistoryEntry>> entries;
|
||||||
|
};
|
||||||
|
|
||||||
virtual ~DocumentState();
|
virtual ~DocumentState();
|
||||||
|
|
||||||
enum class Client {
|
enum class Client {
|
||||||
|
@ -49,6 +54,9 @@ public:
|
||||||
[[nodiscard]] Optional<HTML::Origin> origin() const { return m_origin; }
|
[[nodiscard]] Optional<HTML::Origin> origin() const { return m_origin; }
|
||||||
void set_origin(Optional<HTML::Origin> origin) { m_origin = move(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; }
|
[[nodiscard]] bool reload_pending() const { return m_reload_pending; }
|
||||||
void set_reload_pending(bool reload_pending) { m_reload_pending = 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
|
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-origin
|
||||||
Optional<HTML::Origin> m_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
|
// FIXME: https://html.spec.whatwg.org/multipage/browsing-the-web.html#document-state-resource
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue