NavigationParams.h 2.4 KB

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