diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index bb77a9b04a..1dfa836833 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -49,7 +49,7 @@ bool url_matches_about_blank(AK::URL const& url) } // https://html.spec.whatwg.org/multipage/document-sequences.html#determining-the-origin -HTML::Origin determine_the_origin(AK::URL const& url, SandboxingFlagSet sandbox_flags, Optional source_origin, Optional container_origin) +HTML::Origin determine_the_origin(AK::URL const& url, SandboxingFlagSet sandbox_flags, Optional source_origin) { // 1. If sandboxFlags has its sandboxed origin browsing context flag set, then return a new opaque origin. if (has_flag(sandbox_flags, SandboxingFlagSet::SandboxedOrigin)) { @@ -61,11 +61,11 @@ HTML::Origin determine_the_origin(AK::URL const& url, SandboxingFlagSet sandbox_ // 3. If url is about:srcdoc, then: if (url == "about:srcdoc"sv) { - // 1. Assert: containerOrigin is non-null. - VERIFY(container_origin.has_value()); + // 1. Assert: sourceOrigin is non-null. + VERIFY(source_origin.has_value()); - // 2. Return containerOrigin. - return container_origin.release_value(); + // 2. Return sourceOrigin. + return source_origin.release_value(); } // 4. If url matches about:blank and sourceOrigin is non-null, then return sourceOrigin. @@ -134,8 +134,8 @@ WebIDL::ExceptionOr BrowsingContext // FIXME: 5. Let sandboxFlags be the result of determining the creation sandboxing flags given browsingContext and embedder. SandboxingFlagSet sandbox_flags = {}; - // 6. Let origin be the result of determining the origin given about:blank, sandboxFlags, creatorOrigin, and null. - auto origin = determine_the_origin(AK::URL("about:blank"sv), sandbox_flags, creator_origin, {}); + // 6. Let origin be the result of determining the origin given about:blank, sandboxFlags, and creatorOrigin. + auto origin = determine_the_origin(AK::URL("about:blank"sv), sandbox_flags, creator_origin); // FIXME: 7. Let permissionsPolicy be the result of creating a permissions policy given browsingContext and origin. [PERMISSIONSPOLICY] diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h index 3d743b15ea..0c8047f5a3 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -278,7 +278,7 @@ private: bool m_has_been_discarded { false }; }; -HTML::Origin determine_the_origin(AK::URL const& url, SandboxingFlagSet sandbox_flags, Optional source_origin, Optional container_origin); +HTML::Origin determine_the_origin(AK::URL const& url, SandboxingFlagSet sandbox_flags, Optional source_origin); SandboxingFlagSet determine_the_creation_sandboxing_flags(BrowsingContext const&, JS::GCPtr embedder); diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 7b36a98b0e..d2fbc63d6a 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -399,7 +399,7 @@ static WebIDL::ExceptionOr create_navigation_params_from_a_src response->set_body(TRY(Fetch::Infrastructure::byte_sequence_as_body(realm, document_resource.get().bytes()))); // 3. Let responseOrigin be the result of determining the origin given response's URL, targetSnapshotParams's sandboxing flags, null, and entry's document state's origin. - auto response_origin = determine_the_origin(*response->url(), SandboxingFlagSet {}, {}, entry->document_state->origin()); + auto response_origin = determine_the_origin(*response->url(), SandboxingFlagSet {}, entry->document_state->origin()); // 4. Let coop be a new cross-origin opener policy. CrossOriginOpenerPolicy coop; @@ -598,9 +598,8 @@ static WebIDL::ExceptionOr> create_navigation_params_ entry->document_state->set_resource(Empty {}); } - // 11. Set responseOrigin to the result of determining the origin given response's URL, finalSandboxFlags, - // entry's document state's initiator origin, and null. - response_origin = determine_the_origin(*response_holder->response()->url(), final_sandbox_flags, entry->document_state->initiator_origin(), {}); + // 11. Set responseOrigin to the result of determining the origin given response's URL, finalSandboxFlags, and entry's document state's initiator origin. + response_origin = determine_the_origin(*response_holder->response()->url(), final_sandbox_flags, entry->document_state->initiator_origin()); // 14. Set locationURL to response's location URL given currentURL's fragment. auto location_url = response_holder->response()->location_url(current_url.fragment());