Serenity Operating System
1/*
2 * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
10#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
11#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicy.h>
12#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicyEnforcementResult.h>
13#include <LibWeb/HTML/HistoryHandlingBehavior.h>
14#include <LibWeb/HTML/Origin.h>
15#include <LibWeb/HTML/PolicyContainers.h>
16#include <LibWeb/HTML/SandboxingFlagSet.h>
17
18namespace Web::HTML {
19
20// https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigation-params
21struct NavigationParams {
22 // a navigation id
23 DeprecatedString id;
24
25 // null or a request that started the navigation
26 JS::GCPtr<Fetch::Infrastructure::Request> request;
27
28 // a response that ultimately was navigated to (potentially a network error)
29 JS::NonnullGCPtr<Fetch::Infrastructure::Response> response;
30
31 // an origin to use for the new Document
32 Origin origin;
33
34 // a policy container to use for the new Document
35 PolicyContainer policy_container;
36
37 // a sandboxing flag set to impose on the new Document
38 SandboxingFlagSet final_sandboxing_flag_set;
39
40 // a cross-origin opener policy to use for the new Document
41 CrossOriginOpenerPolicy cross_origin_opener_policy;
42
43 // a cross-origin opener policy enforcement result, used for reporting and potentially for causing a browsing context group switch
44 CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result;
45
46 // null or an environment reserved for the new Document
47 Optional<Environment> reserved_environment;
48
49 // the browsing context to be navigated (or discarded, if a browsing context group switch occurs)
50 JS::Handle<HTML::BrowsingContext> browsing_context;
51
52 // a history handling behavior
53 HistoryHandlingBehavior history_handling { HistoryHandlingBehavior::Default };
54
55 // a boolean
56 bool has_cross_origin_redirects { false };
57
58 // FIXME: an algorithm expecting a response
59 void* process_response_end_of_body { nullptr };
60
61 // FIXME: null or an algorithm accepting a Document, once it has been created
62 void* commit_early_hints { nullptr };
63};
64
65}