mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
LibWeb: Rename 'cross-origin opener policy' to 'opener policy'
This commit is contained in:
parent
51f82c1d93
commit
de31ea5852
Notes:
github-actions[bot]
2024-09-24 11:31:19 +00:00
Author: https://github.com/0xkon1 🔰
Commit: de31ea5852
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1399
Reviewed-by: https://github.com/AtkinsSJ ✅
11 changed files with 75 additions and 75 deletions
|
@ -142,8 +142,8 @@ JS_DEFINE_ALLOCATOR(Document);
|
|||
static JS::NonnullGCPtr<HTML::BrowsingContext> obtain_a_browsing_context_to_use_for_a_navigation_response(
|
||||
HTML::BrowsingContext& browsing_context,
|
||||
HTML::SandboxingFlagSet sandbox_flags,
|
||||
HTML::CrossOriginOpenerPolicy navigation_coop,
|
||||
HTML::CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result)
|
||||
HTML::OpenerPolicy navigation_coop,
|
||||
HTML::OpenerPolicyEnforcementResult coop_enforcement_result)
|
||||
{
|
||||
// 1. If browsingContext is not a top-level browsing context, return browsingContext.
|
||||
if (!browsing_context.is_top_level())
|
||||
|
@ -168,7 +168,7 @@ static JS::NonnullGCPtr<HTML::BrowsingContext> obtain_a_browsing_context_to_use_
|
|||
// 5. If sandboxFlags is not empty, then:
|
||||
if (!is_empty(sandbox_flags)) {
|
||||
// 1. Assert navigationCOOP's value is "unsafe-none".
|
||||
VERIFY(navigation_coop.value == HTML::CrossOriginOpenerPolicyValue::UnsafeNone);
|
||||
VERIFY(navigation_coop.value == HTML::OpenerPolicyValue::UnsafeNone);
|
||||
|
||||
// 2. Assert: newBrowsingContext's popup sandboxing flag set is empty.
|
||||
|
||||
|
@ -186,11 +186,11 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> Document::create_and_initialize(
|
|||
auto browsing_context = navigation_params.navigable->active_browsing_context();
|
||||
|
||||
// 2. Set browsingContext to the result of the obtaining a browsing context to use for a navigation response given browsingContext, navigationParams's final sandboxing flag set,
|
||||
// navigationParams's cross-origin opener policy, and navigationParams's COOP enforcement result.
|
||||
// navigationParams's opener policy, and navigationParams's COOP enforcement result.
|
||||
browsing_context = obtain_a_browsing_context_to_use_for_a_navigation_response(
|
||||
*browsing_context,
|
||||
navigation_params.final_sandboxing_flag_set,
|
||||
navigation_params.cross_origin_opener_policy,
|
||||
navigation_params.opener_policy,
|
||||
navigation_params.coop_enforcement_result);
|
||||
|
||||
// FIXME: 3. Let permissionsPolicy be the result of creating a permissions policy from a response
|
||||
|
@ -288,7 +288,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> Document::create_and_initialize(
|
|||
// policy container: navigationParams's policy container
|
||||
// FIXME: permissions policy: permissionsPolicy
|
||||
// active sandboxing flag set: navigationParams's final sandboxing flag set
|
||||
// FIXME: cross-origin opener policy: navigationParams's cross-origin opener policy
|
||||
// FIXME: opener policy: navigationParams's opener policy
|
||||
// FIXME: load timing info: loadTimingInfo
|
||||
// FIXME: was created via cross-origin redirects: navigationParams's response's has cross-origin redirects
|
||||
// during-loading navigation ID for WebDriver BiDi: navigationParams's id
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <LibWeb/DOM/NonElementParentNode.h>
|
||||
#include <LibWeb/DOM/ParentNode.h>
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicy.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/OpenerPolicy.h>
|
||||
#include <LibWeb/HTML/DocumentReadyState.h>
|
||||
#include <LibWeb/HTML/HTMLScriptElement.h>
|
||||
#include <LibWeb/HTML/History.h>
|
||||
|
@ -151,8 +151,8 @@ public:
|
|||
HTML::Origin origin() const;
|
||||
void set_origin(HTML::Origin const& origin);
|
||||
|
||||
HTML::CrossOriginOpenerPolicy const& cross_origin_opener_policy() const { return m_cross_origin_opener_policy; }
|
||||
void set_cross_origin_opener_policy(HTML::CrossOriginOpenerPolicy policy) { m_cross_origin_opener_policy = move(policy); }
|
||||
HTML::OpenerPolicy const& opener_policy() const { return m_opener_policy; }
|
||||
void set_opener_policy(HTML::OpenerPolicy policy) { m_opener_policy = move(policy); }
|
||||
|
||||
URL::URL parse_url(StringView) const;
|
||||
|
||||
|
@ -866,7 +866,7 @@ private:
|
|||
Optional<URL::URL> m_about_base_url;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-coop
|
||||
HTML::CrossOriginOpenerPolicy m_cross_origin_opener_policy;
|
||||
HTML::OpenerPolicy m_opener_policy;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dom.html#the-document's-referrer
|
||||
String m_referrer;
|
||||
|
|
|
@ -25,17 +25,17 @@ JS::NonnullGCPtr<DOM::Document> create_document_for_inline_content(JS::GCPtr<HTM
|
|||
// 1. Let origin be a new opaque origin.
|
||||
HTML::Origin origin {};
|
||||
|
||||
// 2. Let coop be a new cross-origin opener policy.
|
||||
auto coop = HTML::CrossOriginOpenerPolicy {};
|
||||
// 2. Let coop be a new opener policy.
|
||||
auto coop = HTML::OpenerPolicy {};
|
||||
|
||||
// 3. Let coopEnforcementResult be a new cross-origin opener policy enforcement result with
|
||||
// 3. Let coopEnforcementResult be a new opener policy enforcement result with
|
||||
// url: response's URL
|
||||
// origin: origin
|
||||
// cross-origin opener policy: coop
|
||||
HTML::CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result {
|
||||
// opener policy: coop
|
||||
HTML::OpenerPolicyEnforcementResult coop_enforcement_result {
|
||||
.url = URL::URL("about:error"), // AD-HOC
|
||||
.origin = origin,
|
||||
.cross_origin_opener_policy = coop
|
||||
.opener_policy = coop
|
||||
};
|
||||
|
||||
// 4. Let navigationParams be a new navigation params with
|
||||
|
@ -50,7 +50,7 @@ JS::NonnullGCPtr<DOM::Document> create_document_for_inline_content(JS::GCPtr<HTM
|
|||
// reserved environment: null
|
||||
// policy container: a new policy container
|
||||
// final sandboxing flag set: an empty set
|
||||
// cross-origin opener policy: coop
|
||||
// opener policy: coop
|
||||
// FIXME: navigation timing type: navTimingType
|
||||
// about base URL: null
|
||||
auto response = Fetch::Infrastructure::Response::create(vm);
|
||||
|
@ -67,7 +67,7 @@ JS::NonnullGCPtr<DOM::Document> create_document_for_inline_content(JS::GCPtr<HTM
|
|||
navigation_params->origin = move(origin);
|
||||
navigation_params->policy_container = HTML::PolicyContainer {};
|
||||
navigation_params->final_sandboxing_flag_set = HTML::SandboxingFlagSet {};
|
||||
navigation_params->cross_origin_opener_policy = move(coop);
|
||||
navigation_params->opener_policy = move(coop);
|
||||
navigation_params->about_base_url = {};
|
||||
|
||||
// 5. Let document be the result of creating and initializing a Document object given "html", "text/html", and navigationParams.
|
||||
|
|
|
@ -522,8 +522,8 @@ enum class AllowMultipleFiles;
|
|||
enum class MediaSeekMode;
|
||||
enum class SandboxingFlagSet;
|
||||
|
||||
struct CrossOriginOpenerPolicy;
|
||||
struct CrossOriginOpenerPolicyEnforcementResult;
|
||||
struct OpenerPolicy;
|
||||
struct OpenerPolicyEnforcementResult;
|
||||
struct Environment;
|
||||
struct EnvironmentSettingsObject;
|
||||
struct NavigationParams;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <LibWeb/DOMURL/DOMURL.h>
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/HTML/BrowsingContextGroup.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicy.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/OpenerPolicy.h>
|
||||
#include <LibWeb/HTML/DocumentState.h>
|
||||
#include <LibWeb/HTML/HTMLAnchorElement.h>
|
||||
#include <LibWeb/HTML/HTMLDocument.h>
|
||||
|
@ -259,10 +259,10 @@ WebIDL::ExceptionOr<BrowsingContext::BrowsingContextAndDocument> BrowsingContext
|
|||
|
||||
// 3. If creator's origin is same origin with creator's relevant settings object's top-level origin,
|
||||
if (creator->origin().is_same_origin(creator->relevant_settings_object().top_level_origin)) {
|
||||
// then set document's cross-origin opener policy to creator's browsing context's top-level browsing context's active document's cross-origin opener policy.
|
||||
// then set document's opener policy to creator's browsing context's top-level browsing context's active document's opener policy.
|
||||
VERIFY(creator->browsing_context());
|
||||
VERIFY(creator->browsing_context()->top_level_browsing_context()->active_document());
|
||||
document->set_cross_origin_opener_policy(creator->browsing_context()->top_level_browsing_context()->active_document()->cross_origin_opener_policy());
|
||||
document->set_opener_policy(creator->browsing_context()->top_level_browsing_context()->active_document()->opener_policy());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policy-value
|
||||
enum class CrossOriginOpenerPolicyValue {
|
||||
enum class OpenerPolicyValue {
|
||||
UnsafeNone,
|
||||
SameOriginAllowPopups,
|
||||
SameOrigin,
|
||||
|
@ -19,15 +19,15 @@ enum class CrossOriginOpenerPolicyValue {
|
|||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policy
|
||||
struct CrossOriginOpenerPolicy {
|
||||
// A value, which is a cross-origin opener policy value, initially "unsafe-none".
|
||||
CrossOriginOpenerPolicyValue value { CrossOriginOpenerPolicyValue::UnsafeNone };
|
||||
struct OpenerPolicy {
|
||||
// A value, which is an opener policy value, initially "unsafe-none".
|
||||
OpenerPolicyValue value { OpenerPolicyValue::UnsafeNone };
|
||||
|
||||
// A reporting endpoint, which is string or null, initially null.
|
||||
Optional<String> reporting_endpoint;
|
||||
|
||||
// A report-only value, which is a cross-origin opener policy value, initially "unsafe-none".
|
||||
CrossOriginOpenerPolicyValue report_only_value { CrossOriginOpenerPolicyValue::UnsafeNone };
|
||||
// A report-only value, which is an opener policy value, initially "unsafe-none".
|
||||
OpenerPolicyValue report_only_value { OpenerPolicyValue::UnsafeNone };
|
||||
|
||||
// A report-only reporting endpoint, which is a string or null, initially null.
|
||||
Optional<String> report_only_reporting_endpoint;
|
|
@ -7,13 +7,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicy.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/OpenerPolicy.h>
|
||||
#include <LibWeb/HTML/Origin.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#coop-enforcement-result
|
||||
struct CrossOriginOpenerPolicyEnforcementResult {
|
||||
struct OpenerPolicyEnforcementResult {
|
||||
// A boolean needs a browsing context group switch, initially false.
|
||||
bool needs_a_browsing_context_group_switch { false };
|
||||
|
||||
|
@ -26,8 +26,8 @@ struct CrossOriginOpenerPolicyEnforcementResult {
|
|||
// An origin origin.
|
||||
Origin origin;
|
||||
|
||||
// A cross-origin opener policy cross-origin opener policy.
|
||||
CrossOriginOpenerPolicy cross_origin_opener_policy;
|
||||
// An opener policy.
|
||||
OpenerPolicy opener_policy;
|
||||
|
||||
// A boolean current context is navigation source.
|
||||
bool current_context_is_navigation_source { false };
|
|
@ -84,7 +84,7 @@ void check_if_access_between_two_browsing_contexts_should_be_reported(
|
|||
if (accessed->is_ancestor_of(*accessor.top_level_browsing_context()->opener_browsing_context()))
|
||||
accessor_accessed_relationship = AccessorAccessedRelationship::AccessorIsOpener;
|
||||
|
||||
// 12. Queue violation reports for accesses, given accessorAccessedRelationship, accessorTopDocument's cross-origin opener policy, accessedTopDocument's cross-origin opener policy, accessor's active document's URL, accessed's active document's URL, accessor's top-level browsing context's initial URL, accessed's top-level browsing context's initial URL, accessor's active document's origin, accessed's active document's origin, accessor's top-level browsing context's opener origin at creation, accessed's top-level browsing context's opener origin at creation, accessorTopDocument's referrer, accessedTopDocument's referrer, propertyKey, and environment.
|
||||
// 12. Queue violation reports for accesses, given accessorAccessedRelationship, accessorTopDocument's opener policy, accessedTopDocument's opener policy, accessor's active document's URL, accessed's active document's URL, accessor's top-level browsing context's initial URL, accessed's top-level browsing context's initial URL, accessor's active document's origin, accessed's active document's origin, accessor's top-level browsing context's opener origin at creation, accessed's top-level browsing context's opener origin at creation, accessorTopDocument's referrer, accessedTopDocument's referrer, propertyKey, and environment.
|
||||
(void)environment;
|
||||
(void)accessor_accessed_relationship;
|
||||
}
|
||||
|
|
|
@ -401,9 +401,9 @@ Navigable::ChosenNavigable Navigable::choose_a_navigable(StringView name, Tokeni
|
|||
// 2. Let currentDocument be currentNavigable's active document.
|
||||
auto current_document = active_document();
|
||||
|
||||
// 3. If currentDocument's cross-origin opener policy's value is "same-origin" or "same-origin-plus-COEP",
|
||||
// 3. If currentDocument's opener policy's value is "same-origin" or "same-origin-plus-COEP",
|
||||
// and currentDocument's origin is not same origin with currentDocument's relevant settings object's top-level origin, then:
|
||||
if ((current_document->cross_origin_opener_policy().value == CrossOriginOpenerPolicyValue::SameOrigin || current_document->cross_origin_opener_policy().value == CrossOriginOpenerPolicyValue::SameOriginPlusCOEP)
|
||||
if ((current_document->opener_policy().value == OpenerPolicyValue::SameOrigin || current_document->opener_policy().value == OpenerPolicyValue::SameOriginPlusCOEP)
|
||||
&& !current_document->origin().is_same_origin(relevant_settings_object(*current_document).top_level_origin)) {
|
||||
|
||||
// 1. Set noopener to true.
|
||||
|
@ -415,7 +415,7 @@ Navigable::ChosenNavigable Navigable::choose_a_navigable(StringView name, Tokeni
|
|||
// 3. Set windowType to "new with no opener".
|
||||
window_type = WindowType::NewWithNoOpener;
|
||||
}
|
||||
// NOTE: In the presence of a cross-origin opener policy,
|
||||
// NOTE: In the presence of an opener policy,
|
||||
// nested documents that are cross-origin with their top-level browsing context's active document always set noopener to true.
|
||||
|
||||
// 4. Let chosen be null.
|
||||
|
@ -550,11 +550,11 @@ static PolicyContainer determine_navigation_params_policy_container(URL::URL con
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#obtain-coop
|
||||
static CrossOriginOpenerPolicy obtain_a_cross_origin_opener_policy(JS::NonnullGCPtr<Fetch::Infrastructure::Response>, Fetch::Infrastructure::Request::ReservedClientType const& reserved_client)
|
||||
static OpenerPolicy obtain_an_opener_policy(JS::NonnullGCPtr<Fetch::Infrastructure::Response>, Fetch::Infrastructure::Request::ReservedClientType const& reserved_client)
|
||||
{
|
||||
|
||||
// 1. Let policy be a new cross-origin opener policy.
|
||||
CrossOriginOpenerPolicy policy = {};
|
||||
// 1. Let policy be a new opener policy.
|
||||
OpenerPolicy policy = {};
|
||||
|
||||
// AD-HOC: We don't yet setup environments in all cases
|
||||
if (!reserved_client)
|
||||
|
@ -611,17 +611,17 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<NavigationParams>> create_navigation
|
|||
// 3. Let responseOrigin be the result of determining the origin given response's URL, targetSnapshotParams's sandboxing flags, and entry's document state's origin.
|
||||
auto response_origin = determine_the_origin(*response->url(), target_snapshot_params.sandboxing_flags, entry->document_state()->origin());
|
||||
|
||||
// 4. Let coop be a new cross-origin opener policy.
|
||||
CrossOriginOpenerPolicy coop = {};
|
||||
// 4. Let coop be a new opener policy.
|
||||
OpenerPolicy coop = {};
|
||||
|
||||
// 5. Let coopEnforcementResult be a new cross-origin opener policy enforcement result with
|
||||
// 5. Let coopEnforcementResult be a new opener policy enforcement result with
|
||||
// url: response's URL
|
||||
// origin: responseOrigin
|
||||
// cross-origin opener policy: coop
|
||||
CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result {
|
||||
// opener policy: coop
|
||||
OpenerPolicyEnforcementResult coop_enforcement_result {
|
||||
.url = *response->url(),
|
||||
.origin = response_origin,
|
||||
.cross_origin_opener_policy = coop
|
||||
.opener_policy = coop
|
||||
};
|
||||
|
||||
// 6. Let policyContainer be the result of determining navigation params policy container given response's URL,
|
||||
|
@ -649,7 +649,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<NavigationParams>> create_navigation
|
|||
// origin: responseOrigin
|
||||
// policy container: policyContainer
|
||||
// final sandboxing flag set: targetSnapshotParams's sandboxing flags
|
||||
// cross-origin opener policy: coop
|
||||
// opener policy: coop
|
||||
// FIXME: navigation timing type: navTimingType
|
||||
// about base URL: entry's document state's about base URL
|
||||
auto navigation_params = vm.heap().allocate_without_realm<NavigationParams>();
|
||||
|
@ -660,7 +660,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<NavigationParams>> create_navigation
|
|||
navigation_params->origin = move(response_origin);
|
||||
navigation_params->policy_container = policy_container;
|
||||
navigation_params->final_sandboxing_flag_set = target_snapshot_params.sandboxing_flags;
|
||||
navigation_params->cross_origin_opener_policy = move(coop);
|
||||
navigation_params->opener_policy = move(coop);
|
||||
navigation_params->about_base_url = entry->document_state()->about_base_url();
|
||||
|
||||
return navigation_params;
|
||||
|
@ -784,16 +784,16 @@ static WebIDL::ExceptionOr<Navigable::NavigationParamsVariant> create_navigation
|
|||
// 11. Let fetchController be null.
|
||||
JS::GCPtr<Fetch::Infrastructure::FetchController> fetch_controller = nullptr;
|
||||
|
||||
// 12. Let coopEnforcementResult be a new cross-origin opener policy enforcement result, with
|
||||
// 12. Let coopEnforcementResult be a new opener policy enforcement result, with
|
||||
// - url: navigable's active document's URL
|
||||
// - origin: navigable's active document's origin
|
||||
// - cross-origin opener policy: navigable's active document's cross-origin opener policy
|
||||
// - opener policy: navigable's active document's opener policy
|
||||
// - current context is navigation source: true if navigable's active document's origin is same origin with
|
||||
// entry's document state's initiator origin otherwise false
|
||||
CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result = {
|
||||
OpenerPolicyEnforcementResult coop_enforcement_result = {
|
||||
.url = active_document.url(),
|
||||
.origin = active_document.origin(),
|
||||
.cross_origin_opener_policy = active_document.cross_origin_opener_policy(),
|
||||
.opener_policy = active_document.opener_policy(),
|
||||
.current_context_is_navigation_source = entry->document_state()->initiator_origin().has_value() && active_document.origin().is_same_origin(*entry->document_state()->initiator_origin())
|
||||
};
|
||||
|
||||
|
@ -803,8 +803,8 @@ static WebIDL::ExceptionOr<Navigable::NavigationParamsVariant> create_navigation
|
|||
// 14. Let responsePolicyContainer be null.
|
||||
Optional<PolicyContainer> response_policy_container = {};
|
||||
|
||||
// 15. Let responseCOOP be a new cross-origin opener policy.
|
||||
CrossOriginOpenerPolicy response_coop = {};
|
||||
// 15. Let responseCOOP be a new opener policy.
|
||||
OpenerPolicy response_coop = {};
|
||||
|
||||
// 16. Let locationURL be null.
|
||||
ErrorOr<Optional<URL::URL>> location_url { OptionalNone {} };
|
||||
|
@ -884,15 +884,15 @@ static WebIDL::ExceptionOr<Navigable::NavigationParamsVariant> create_navigation
|
|||
|
||||
// 12. If navigable is a top-level traversable, then:
|
||||
if (navigable->is_top_level_traversable()) {
|
||||
// 1. Set responseCOOP to the result of obtaining a cross-origin opener policy given response and request's reserved client.
|
||||
response_coop = obtain_a_cross_origin_opener_policy(*response_holder->response(), request->reserved_client());
|
||||
// 1. Set responseCOOP to the result of obtaining an opener policy given response and request's reserved client.
|
||||
response_coop = obtain_an_opener_policy(*response_holder->response(), request->reserved_client());
|
||||
|
||||
// FIXME: 2. Set coopEnforcementResult to the result of enforcing the response's cross-origin opener policy given navigable's active browsing context,
|
||||
// FIXME: 2. Set coopEnforcementResult to the result of enforcing the response's opener policy given navigable's active browsing context,
|
||||
// response's URL, responseOrigin, responseCOOP, coopEnforcementResult and request's referrer.
|
||||
|
||||
// FIXME: 3. If finalSandboxFlags is not empty and responseCOOP's value is not "unsafe-none", then set response to an appropriate network error and break.
|
||||
// NOTE: This results in a network error as one cannot simultaneously provide a clean slate to a response
|
||||
// using cross-origin opener policy and sandbox the result of navigating to that response.
|
||||
// using opener policy and sandbox the result of navigating to that response.
|
||||
}
|
||||
|
||||
// 13. FIXME If response is not a network error, navigable is a child navigable, and the result of performing a cross-origin resource policy check
|
||||
|
@ -1009,7 +1009,7 @@ static WebIDL::ExceptionOr<Navigable::NavigationParamsVariant> create_navigation
|
|||
// response: response
|
||||
// fetch controller: fetchController
|
||||
// commit early hints: commitEarlyHints
|
||||
// cross-origin opener policy: responseCOOP
|
||||
// opener policy: responseCOOP
|
||||
// reserved environment: request's reserved client
|
||||
// origin: responseOrigin
|
||||
// policy container: resultPolicyContainer
|
||||
|
@ -1029,7 +1029,7 @@ static WebIDL::ExceptionOr<Navigable::NavigationParamsVariant> create_navigation
|
|||
navigation_params->origin = *response_origin;
|
||||
navigation_params->policy_container = result_policy_container;
|
||||
navigation_params->final_sandboxing_flag_set = final_sandbox_flags;
|
||||
navigation_params->cross_origin_opener_policy = response_coop;
|
||||
navigation_params->opener_policy = response_coop;
|
||||
navigation_params->about_base_url = entry->document_state()->about_base_url();
|
||||
return navigation_params;
|
||||
}
|
||||
|
@ -1591,17 +1591,17 @@ WebIDL::ExceptionOr<JS::GCPtr<DOM::Document>> Navigable::evaluate_javascript_url
|
|||
// FIXME: 13. Let finalSandboxFlags be policyContainer's CSP list's CSP-derived sandboxing flags.
|
||||
auto final_sandbox_flags = SandboxingFlagSet {};
|
||||
|
||||
// 14. Let coop be targetNavigable's active document's cross-origin opener policy.
|
||||
auto const& coop = active_document()->cross_origin_opener_policy();
|
||||
// 14. Let coop be targetNavigable's active document's opener policy.
|
||||
auto const& coop = active_document()->opener_policy();
|
||||
|
||||
// 15. Let coopEnforcementResult be a new cross-origin opener policy enforcement result with
|
||||
// 15. Let coopEnforcementResult be a new opener policy enforcement result with
|
||||
// url: url
|
||||
// origin: newDocumentOrigin
|
||||
// cross-origin opener policy: coop
|
||||
CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result {
|
||||
// opener policy: coop
|
||||
OpenerPolicyEnforcementResult coop_enforcement_result {
|
||||
.url = url,
|
||||
.origin = new_document_origin,
|
||||
.cross_origin_opener_policy = coop,
|
||||
.opener_policy = coop,
|
||||
};
|
||||
|
||||
// 16. Let navigationParams be a new navigation params, with
|
||||
|
@ -1616,7 +1616,7 @@ WebIDL::ExceptionOr<JS::GCPtr<DOM::Document>> Navigable::evaluate_javascript_url
|
|||
// origin: newDocumentOrigin
|
||||
// policy container: policyContainer
|
||||
// final sandboxing flag set: finalSandboxFlags
|
||||
// cross-origin opener policy: coop
|
||||
// opener policy: coop
|
||||
// FIXME: navigation timing type: "navigate"
|
||||
// about base URL: targetNavigable's active document's about base URL
|
||||
auto navigation_params = vm.heap().allocate_without_realm<NavigationParams>();
|
||||
|
@ -1631,7 +1631,7 @@ WebIDL::ExceptionOr<JS::GCPtr<DOM::Document>> Navigable::evaluate_javascript_url
|
|||
navigation_params->origin = new_document_origin;
|
||||
navigation_params->policy_container = policy_container;
|
||||
navigation_params->final_sandboxing_flag_set = final_sandbox_flags;
|
||||
navigation_params->cross_origin_opener_policy = coop;
|
||||
navigation_params->opener_policy = coop;
|
||||
navigation_params->about_base_url = active_document()->about_base_url();
|
||||
|
||||
// 17. Return the result of loading an HTML document given navigationParams.
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicy.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/CrossOriginOpenerPolicyEnforcementResult.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/OpenerPolicy.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/OpenerPolicyEnforcementResult.h>
|
||||
#include <LibWeb/HTML/Origin.h>
|
||||
#include <LibWeb/HTML/PolicyContainers.h>
|
||||
#include <LibWeb/HTML/SandboxingFlagSet.h>
|
||||
|
@ -43,8 +43,8 @@ struct NavigationParams : JS::Cell {
|
|||
// 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;
|
||||
// an opener policy enforcement result, used for reporting and potentially for causing a browsing context group switch
|
||||
OpenerPolicyEnforcementResult coop_enforcement_result;
|
||||
|
||||
// null or an environment reserved for the new Document
|
||||
Fetch::Infrastructure::Request::ReservedClientType reserved_environment;
|
||||
|
@ -58,8 +58,8 @@ struct NavigationParams : JS::Cell {
|
|||
// a sandboxing flag set to impose on the new Document
|
||||
SandboxingFlagSet final_sandboxing_flag_set = {};
|
||||
|
||||
// a cross-origin opener policy to use for the new Document
|
||||
CrossOriginOpenerPolicy cross_origin_opener_policy;
|
||||
// an opener policy to use for the new Document
|
||||
OpenerPolicy opener_policy;
|
||||
|
||||
// FIXME: a NavigationTimingType used for creating the navigation timing entry for the new Document
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ ErrorOr<JS::NonnullGCPtr<SVGDecodedImageData>> SVGDecodedImageData::create(JS::R
|
|||
navigation_params->origin = HTML::Origin {};
|
||||
navigation_params->policy_container = HTML::PolicyContainer {};
|
||||
navigation_params->final_sandboxing_flag_set = HTML::SandboxingFlagSet {};
|
||||
navigation_params->cross_origin_opener_policy = HTML::CrossOriginOpenerPolicy {};
|
||||
navigation_params->opener_policy = HTML::OpenerPolicy {};
|
||||
|
||||
// FIXME: Use Navigable::navigate() instead of manually replacing the navigable's document.
|
||||
auto document = DOM::Document::create_and_initialize(DOM::Document::Type::HTML, "text/html"_string, navigation_params).release_value_but_fixme_should_propagate_errors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue