1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

LibWeb: Align NavigationParams and the creation AOs to the spec

And remove assorted spec FIXMEs along the way. Also align
populate_session_history_entry_document to the spec, with a bonus spec
bug to be filed.

This involves creating a new NonFetchSchemeNavigationParams spec, and
having the associated AOs take a Variant rather than Optional to
accomodate the fact that this extra struct could be returned by the
algorithm. We don't actually *do* anything with these params, but the
scaffolding is there now, with less TODOs.
This commit is contained in:
Andrew Kaster 2023-09-21 13:47:19 -06:00 committed by Andrew Kaster
parent f296382e1a
commit dc0f7c4c54
9 changed files with 400 additions and 125 deletions

View file

@ -23,11 +23,26 @@ struct NavigationParams {
// null or a navigation ID
Optional<String> id;
// the navigable to be navigated
JS::Handle<Navigable> navigable;
// null or a request that started the navigation
JS::GCPtr<Fetch::Infrastructure::Request> request;
// a response that ultimately was navigated to (potentially a network error)
JS::NonnullGCPtr<Fetch::Infrastructure::Response> response;
JS::GCPtr<Fetch::Infrastructure::Response> response;
// null or a fetch controller
JS::GCPtr<Fetch::Infrastructure::FetchController> fetch_controller { nullptr };
// null or an algorithm accepting a Document, once it has been created
Function<void(DOM::Document&)> commit_early_hints { nullptr };
// 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
Fetch::Infrastructure::Request::ReservedClientType reserved_environment;
// an origin to use for the new Document
Origin origin;
@ -41,32 +56,33 @@ struct NavigationParams {
// 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;
// FIXME: a NavigationTimingType used for creating the navigation timing entry for the new Document
// null or an environment reserved for the new Document
Optional<Environment> reserved_environment;
// a URL or null used to populate the new Document's about base URL
Optional<AK::URL> about_base_url;
};
// the browsing context to be navigated (or discarded, if a browsing context group switch occurs)
JS::Handle<HTML::BrowsingContext> browsing_context;
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#non-fetch-scheme-navigation-params
struct NonFetchSchemeNavigationParams {
// null or a navigation ID
Optional<String> id;
// the navigable to be navigated
JS::Handle<Navigable> navigable;
// a history handling behavior
HistoryHandlingBehavior history_handling { HistoryHandlingBehavior::Default };
// a URL
AK::URL url;
// a boolean
bool has_cross_origin_redirects { false };
// the target snapshot params's sandboxing flags present during navigation
SandboxingFlagSet target_snapshot_sandboxing_flags = {};
// FIXME: an algorithm expecting a response
void* process_response_end_of_body { nullptr };
// a copy of the source snapshot params's has transient activation boolean present during activation
bool source_snapshot_has_transient_activation = { false };
// null or a fetch controller
JS::GCPtr<Fetch::Infrastructure::FetchController> fetch_controller { nullptr };
// an origin possibly for use in a user-facing prompt to confirm the invocation of an external software package
Origin initiator_origin;
// FIXME: null or an algorithm accepting a Document, once it has been created
void* commit_early_hints { nullptr };
// FIXME: a NavigationTimingType used for creating the navigation timing entry for the new Document
};
}