From 0781bdb23e43412a3e591a9574bdee5c17364aa4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 4 Aug 2022 21:28:27 +0200 Subject: [PATCH] LibWeb: Add HTML::NavigationParams --- .../Libraries/LibWeb/HTML/NavigationParams.h | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Userland/Libraries/LibWeb/HTML/NavigationParams.h diff --git a/Userland/Libraries/LibWeb/HTML/NavigationParams.h b/Userland/Libraries/LibWeb/HTML/NavigationParams.h new file mode 100644 index 0000000000..98b8e0e7a7 --- /dev/null +++ b/Userland/Libraries/LibWeb/HTML/NavigationParams.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2022, Andreas Kling + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +namespace Web::HTML { + +// https://html.spec.whatwg.org/multipage/browsing-the-web.html#history-handling-behavior +enum class HistoryHandlingBehavior { + Default, + EntryUpdate, + Reload, + Replace, +}; + +// https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigation-params +struct NavigationParams { + // a navigation id + String id; + + // null or a request that started the navigation + OwnPtr request; + + // a response that ultimately was navigated to (potentially a network error) + NonnullOwnPtr response; + + // an origin to use for the new Document + Origin origin; + + // a policy container to use for the new Document + PolicyContainer policy_container; + + // a sandboxing flag set to impose on the new Document + SandboxingFlagSet final_sandboxing_flag_set; + + // a cross-origin opener policy to use for the new Document + CrossOriginOpenerPolicy cross_origin_opener_policy; + + // a cross-origin opener policy enforcement result, used for reporting and potentially for causing a browsing context group switch + CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result; + + // null or an environment reserved for the new Document + Optional reserved_environment; + + // the browsing context to be navigated (or discarded, if a browsing context group switch occurs) + NonnullRefPtr browsing_context; + + // a history handling behavior + HistoryHandlingBehavior history_handling { HistoryHandlingBehavior::Default }; + + // a boolean + bool has_cross_origin_redirects { false }; + + // FIXME: an algorithm expecting a response + void* process_response_end_of_body { nullptr }; + + // FIXME: null or an algorithm accepting a Document, once it has been created + void* commit_early_hints { nullptr }; +}; + +}