| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
 | 
					
						
							|  |  |  | #include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
 | 
					
						
							|  |  |  | #include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicy.h>
 | 
					
						
							|  |  |  | #include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicyEnforcementResult.h>
 | 
					
						
							| 
									
										
										
										
											2022-09-19 16:28:11 +02:00
										 |  |  | #include <LibWeb/HTML/HistoryHandlingBehavior.h>
 | 
					
						
							| 
									
										
										
										
											2023-04-05 09:20:05 +03:00
										 |  |  | #include <LibWeb/HTML/Navigable.h>
 | 
					
						
							| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  | #include <LibWeb/HTML/Origin.h>
 | 
					
						
							|  |  |  | #include <LibWeb/HTML/PolicyContainers.h>
 | 
					
						
							|  |  |  | #include <LibWeb/HTML/SandboxingFlagSet.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::HTML { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigation-params
 | 
					
						
							|  |  |  | struct NavigationParams { | 
					
						
							| 
									
										
										
										
											2023-04-13 14:38:39 +03:00
										 |  |  |     // null or a navigation ID
 | 
					
						
							|  |  |  |     Optional<String> id; | 
					
						
							| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // null or a request that started the navigation
 | 
					
						
							| 
									
										
										
										
											2022-10-30 01:52:07 +00:00
										 |  |  |     JS::GCPtr<Fetch::Infrastructure::Request> request; | 
					
						
							| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // a response that ultimately was navigated to (potentially a network error)
 | 
					
						
							| 
									
										
										
										
											2022-10-30 01:52:07 +00:00
										 |  |  |     JS::NonnullGCPtr<Fetch::Infrastructure::Response> response; | 
					
						
							| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // 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<Environment> reserved_environment; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // the browsing context to be navigated (or discarded, if a browsing context group switch occurs)
 | 
					
						
							| 
									
										
										
										
											2022-10-17 11:06:50 +02:00
										 |  |  |     JS::Handle<HTML::BrowsingContext> browsing_context; | 
					
						
							| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-05 09:20:05 +03:00
										 |  |  |     // the navigable to be navigated
 | 
					
						
							|  |  |  |     JS::Handle<Navigable> navigable; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  |     // 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 }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-02 07:09:05 +03:00
										 |  |  |     // null or a fetch controller
 | 
					
						
							|  |  |  |     JS::GCPtr<Fetch::Infrastructure::FetchController> fetch_controller { nullptr }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-04 21:28:27 +02:00
										 |  |  |     // FIXME: null or an algorithm accepting a Document, once it has been created
 | 
					
						
							|  |  |  |     void* commit_early_hints { nullptr }; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |