mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 20:17:41 +00:00
LibWeb: Remove outdated version of determine_the_origin()
This commit is contained in:
parent
7b91f79817
commit
1f2ed7effc
3 changed files with 3 additions and 34 deletions
|
@ -48,35 +48,6 @@ bool url_matches_about_blank(AK::URL const& url)
|
|||
&& url.host().has<Empty>();
|
||||
}
|
||||
|
||||
// FIXME: This is an outdated older version of "determining the origin" and should be removed.
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#determining-the-origin
|
||||
HTML::Origin determine_the_origin(BrowsingContext const& browsing_context, Optional<AK::URL> url, SandboxingFlagSet sandbox_flags, Optional<HTML::Origin> invocation_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)) {
|
||||
return HTML::Origin {};
|
||||
}
|
||||
|
||||
// 2. If url is null, then return a new opaque origin.
|
||||
if (!url.has_value()) {
|
||||
return HTML::Origin {};
|
||||
}
|
||||
|
||||
// 3. If invocationOrigin is non-null and url matches about:blank, then return invocationOrigin.
|
||||
if (invocation_origin.has_value() && url_matches_about_blank(*url)) {
|
||||
return invocation_origin.value();
|
||||
}
|
||||
|
||||
// 4. If url is about:srcdoc, then return the origin of browsingContext's container document.
|
||||
if (url == AK::URL("about:srcdoc")) {
|
||||
VERIFY(browsing_context.container_document());
|
||||
return browsing_context.container_document()->origin();
|
||||
}
|
||||
|
||||
// 5. Return url's origin.
|
||||
return URL::url_origin(*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<HTML::Origin> source_origin, Optional<HTML::Origin> container_origin)
|
||||
{
|
||||
|
|
|
@ -286,9 +286,6 @@ private:
|
|||
bool m_has_been_discarded { false };
|
||||
};
|
||||
|
||||
// FIXME: Remove this once everything is switched to the new overload.
|
||||
HTML::Origin determine_the_origin(BrowsingContext const& browsing_context, Optional<AK::URL> url, SandboxingFlagSet sandbox_flags, Optional<HTML::Origin> invocation_origin);
|
||||
|
||||
HTML::Origin determine_the_origin(AK::URL const& url, SandboxingFlagSet sandbox_flags, Optional<HTML::Origin> source_origin, Optional<HTML::Origin> container_origin);
|
||||
|
||||
SandboxingFlagSet determine_the_creation_sandboxing_flags(BrowsingContext const&, JS::GCPtr<DOM::Element> embedder);
|
||||
|
|
|
@ -306,7 +306,7 @@ void FrameLoader::resource_did_load()
|
|||
// (Part of https://html.spec.whatwg.org/#navigating-across-documents)
|
||||
// 3. Let responseOrigin be the result of determining the origin given browsingContext, resource's url, finalSandboxFlags, and incumbentNavigationOrigin.
|
||||
// FIXME: Pass incumbentNavigationOrigin
|
||||
auto response_origin = HTML::determine_the_origin(browsing_context(), url, final_sandboxing_flag_set, {});
|
||||
// auto response_origin = HTML::determine_the_origin(browsing_context(), url, final_sandboxing_flag_set, {});
|
||||
|
||||
auto& vm = Bindings::main_thread_vm();
|
||||
auto response = Fetch::Infrastructure::Response::create(vm);
|
||||
|
@ -315,7 +315,8 @@ void FrameLoader::resource_did_load()
|
|||
.id = {},
|
||||
.request = nullptr,
|
||||
.response = response,
|
||||
.origin = move(response_origin),
|
||||
.origin = {},
|
||||
// .origin = move(response_origin),
|
||||
.policy_container = HTML::PolicyContainer {},
|
||||
.final_sandboxing_flag_set = final_sandboxing_flag_set,
|
||||
.cross_origin_opener_policy = HTML::CrossOriginOpenerPolicy {},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue