diff options
author | Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com> | 2023-04-14 22:27:52 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-04-15 14:05:00 +0200 |
commit | aa33a3381bd88a88941ef89df79e6679fd02b82e (patch) | |
tree | 75a5b1634741b9ac44f67594310f9cf6b31f6f07 | |
parent | 1df52ea94ca905d6d1df1913c123939feb0cc5de (diff) | |
download | serenity-aa33a3381bd88a88941ef89df79e6679fd02b82e.zip |
LibWeb: Add missing properties from latest spec in SessionHistoryEntry
Adds step and document_state properties. Both will be required for
further navigables spec implementation.
Co-authored-by: Andreas Kling <kling@serenityos.org>
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.h | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.cpp b/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.cpp index 7d12631ea5..846927ce1b 100644 --- a/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.cpp +++ b/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.cpp @@ -4,7 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> +#include <LibWeb/HTML/DocumentState.h> #include <LibWeb/HTML/SessionHistoryEntry.h> namespace Web::HTML { @@ -12,7 +13,7 @@ namespace Web::HTML { void SessionHistoryEntry::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); - visitor.visit(document); + visitor.visit(document_state); visitor.visit(original_source_browsing_context); } diff --git a/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.h b/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.h index 0935d38d82..bccec7c2f7 100644 --- a/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.h +++ b/Userland/Libraries/LibWeb/HTML/SessionHistoryEntry.h @@ -36,22 +36,30 @@ struct SessionHistoryEntry final : public JS::Cell { AK::URL url; // document, a Document or null + // FIXME: this property is not present in the spec anymore and should be gone after introducing navigables JS::GCPtr<DOM::Document> document; - // serialized state, which is serialized state or null, initially null - Optional<DeprecatedString> serialized_state; + // https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-document-state + JS::GCPtr<HTML::DocumentState> document_state; - // policy container, a policy container or null - Optional<PolicyContainer> policy_container; + // https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-serialized-state + // serialized state, which is serialized state, initially StructuredSerializeForStorage(null). + Optional<DeprecatedString> serialized_state; + // https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-scroll-restoration-mode // scroll restoration mode, a scroll restoration mode, initially "auto" ScrollRestorationMode scroll_restoration_mode { ScrollRestorationMode::Auto }; + // policy container, a policy container or null + Optional<PolicyContainer> policy_container; + + // https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-scroll-position // FIXME: scroll position data, which is scroll position data for the document's restorable scrollable regions // browsing context name, a browsing context name or null, initially null Optional<DeprecatedString> browsing_context_name; + // https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-other // FIXME: persisted user state, which is implementation-defined, initially null // NOTE: This is where we could remember the state of form controls, for example. |