NavigationParams.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/Origin.h>
  13. #include <LibWeb/HTML/PolicyContainers.h>
  14. #include <LibWeb/HTML/SandboxingFlagSet.h>
  15. namespace Web::HTML {
  16. // https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigation-params
  17. struct NavigationParams {
  18. // a navigation id
  19. String id;
  20. // null or a request that started the navigation
  21. RefPtr<Fetch::Infrastructure::Request> request;
  22. // a response that ultimately was navigated to (potentially a network error)
  23. NonnullRefPtr<Fetch::Infrastructure::Response> response;
  24. // an origin to use for the new Document
  25. Origin origin;
  26. // a policy container to use for the new Document
  27. PolicyContainer policy_container;
  28. // a sandboxing flag set to impose on the new Document
  29. SandboxingFlagSet final_sandboxing_flag_set;
  30. // a cross-origin opener policy to use for the new Document
  31. CrossOriginOpenerPolicy cross_origin_opener_policy;
  32. // a cross-origin opener policy enforcement result, used for reporting and potentially for causing a browsing context group switch
  33. CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result;
  34. // null or an environment reserved for the new Document
  35. Optional<Environment> reserved_environment;
  36. // the browsing context to be navigated (or discarded, if a browsing context group switch occurs)
  37. NonnullRefPtr<HTML::BrowsingContext> browsing_context;
  38. // a history handling behavior
  39. HistoryHandlingBehavior history_handling { HistoryHandlingBehavior::Default };
  40. // a boolean
  41. bool has_cross_origin_redirects { false };
  42. // FIXME: an algorithm expecting a response
  43. void* process_response_end_of_body { nullptr };
  44. // FIXME: null or an algorithm accepting a Document, once it has been created
  45. void* commit_early_hints { nullptr };
  46. };
  47. }