mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibWeb: Fill-in some fixmes around sandboxing flag sets
...Including a couple of steps in obtain_a_browsing_context_to_use_for_a_navigation_response() which didn't have FIXMEs. No apparent changes on WPT.
This commit is contained in:
parent
2c7e730726
commit
310cdc35f0
Notes:
github-actions[bot]
2024-11-26 10:00:42 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/310cdc35f05 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2575
5 changed files with 28 additions and 6 deletions
|
@ -183,8 +183,10 @@ static GC::Ref<HTML::BrowsingContext> obtain_a_browsing_context_to_use_for_a_nav
|
|||
VERIFY(navigation_coop.value == HTML::OpenerPolicyValue::UnsafeNone);
|
||||
|
||||
// 2. Assert: newBrowsingContext's popup sandboxing flag set is empty.
|
||||
VERIFY(is_empty(new_browsing_context->popup_sandboxing_flag_set()));
|
||||
|
||||
// 3. Set newBrowsingContext's popup sandboxing flag set to a clone of sandboxFlags.
|
||||
new_browsing_context->set_popup_sandboxing_flag_set(sandbox_flags);
|
||||
}
|
||||
|
||||
// 6. Return newBrowsingContext.
|
||||
|
@ -3215,6 +3217,11 @@ HTML::SandboxingFlagSet Document::active_sandboxing_flag_set() const
|
|||
return m_active_sandboxing_flag_set;
|
||||
}
|
||||
|
||||
void Document::set_active_sandboxing_flag_set(HTML::SandboxingFlagSet sandboxing_flag_set)
|
||||
{
|
||||
m_active_sandboxing_flag_set = sandboxing_flag_set;
|
||||
}
|
||||
|
||||
HTML::PolicyContainer Document::policy_container() const
|
||||
{
|
||||
return m_policy_container;
|
||||
|
|
|
@ -526,6 +526,7 @@ public:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#active-sandboxing-flag-set
|
||||
HTML::SandboxingFlagSet active_sandboxing_flag_set() const;
|
||||
void set_active_sandboxing_flag_set(HTML::SandboxingFlagSet);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-policy-container
|
||||
HTML::PolicyContainer policy_container() const;
|
||||
|
|
|
@ -163,7 +163,7 @@ WebIDL::ExceptionOr<BrowsingContext::BrowsingContextAndDocument> BrowsingContext
|
|||
browsing_context->m_virtual_browsing_context_group_id = creator->browsing_context()->top_level_browsing_context()->m_virtual_browsing_context_group_id;
|
||||
}
|
||||
|
||||
// 6. Let sandboxFlags be the result of determining the creation sandboxing flags given browsingContext and embedder.
|
||||
// FIXME: 6. Let sandboxFlags be the result of determining the creation sandboxing flags given browsingContext and embedder.
|
||||
SandboxingFlagSet sandbox_flags = {};
|
||||
|
||||
// 7. Let origin be the result of determining the origin given about:blank, sandboxFlags, and creatorOrigin.
|
||||
|
@ -236,7 +236,8 @@ WebIDL::ExceptionOr<BrowsingContext::BrowsingContextAndDocument> BrowsingContext
|
|||
|
||||
// FIXME: permissions policy: permissionsPolicy
|
||||
|
||||
// FIXME: active sandboxing flag set: sandboxFlags
|
||||
// active sandboxing flag set: sandboxFlags
|
||||
document->set_active_sandboxing_flag_set(sandbox_flags);
|
||||
|
||||
// load timing info: loadTimingInfo
|
||||
document->set_load_timing_info(load_timing_info);
|
||||
|
|
|
@ -124,6 +124,10 @@ public:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/origin.html#one-permitted-sandboxed-navigator
|
||||
BrowsingContext const* the_one_permitted_sandboxed_navigator() const;
|
||||
void set_the_one_permitted_sandboxed_navigator(BrowsingContext const*)
|
||||
{
|
||||
// FIXME: Implement this
|
||||
}
|
||||
|
||||
bool has_navigable_been_destroyed() const;
|
||||
|
||||
|
@ -132,6 +136,9 @@ public:
|
|||
|
||||
void set_is_popup(TokenizedFeature::Popup is_popup) { m_is_popup = is_popup; }
|
||||
|
||||
SandboxingFlagSet popup_sandboxing_flag_set() const { return m_popup_sandboxing_flag_set; }
|
||||
void set_popup_sandboxing_flag_set(SandboxingFlagSet value) { m_popup_sandboxing_flag_set = value; }
|
||||
|
||||
private:
|
||||
explicit BrowsingContext(GC::Ref<Page>);
|
||||
|
||||
|
@ -151,6 +158,9 @@ private:
|
|||
// https://html.spec.whatwg.org/multipage/browsers.html#is-popup
|
||||
TokenizedFeature::Popup m_is_popup { TokenizedFeature::Popup::No };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#popup-sandboxing-flag-set
|
||||
SandboxingFlagSet m_popup_sandboxing_flag_set {};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#is-auxiliary
|
||||
bool m_is_auxiliary { false };
|
||||
|
||||
|
|
|
@ -476,13 +476,16 @@ Navigable::ChosenNavigable Navigable::choose_a_navigable(StringView name, Tokeni
|
|||
// 1. Set chosen to the result of creating a new top-level traversable given currentNavigable's active browsing context and targetName.
|
||||
chosen = create_new_traversable->function()(active_browsing_context());
|
||||
|
||||
// FIXME: 2. If sandboxingFlagSet's sandboxed navigation browsing context flag is set,
|
||||
// 2. If sandboxingFlagSet's sandboxed navigation browsing context flag is set,
|
||||
// then set chosen's active browsing context's one permitted sandboxed navigator to currentNavigable's active browsing context.
|
||||
if (has_flag(sandboxing_flag_set, SandboxingFlagSet::SandboxedNavigation))
|
||||
chosen->active_browsing_context()->set_the_one_permitted_sandboxed_navigator(active_browsing_context());
|
||||
}
|
||||
|
||||
// FIXME: 10. If sandboxingFlagSet's sandbox propagates to auxiliary browsing contexts flag is set,
|
||||
// then all the flags that are set in sandboxingFlagSet must be set in chosen's active browsing context's popup sandboxing flag set.
|
||||
// Our BrowsingContexts do not have SandboxingFlagSets yet, only documents do
|
||||
// 10. If sandboxingFlagSet's sandbox propagates to auxiliary browsing contexts flag is set,
|
||||
// then all the flags that are set in sandboxingFlagSet must be set in chosen's active browsing context's popup sandboxing flag set.
|
||||
if (has_flag(sandboxing_flag_set, SandboxingFlagSet::SandboxPropagatesToAuxiliaryBrowsingContexts))
|
||||
chosen->active_browsing_context()->set_popup_sandboxing_flag_set(chosen->active_browsing_context()->popup_sandboxing_flag_set() | sandboxing_flag_set);
|
||||
}
|
||||
|
||||
// --> If the user agent has been configured such that in this instance t will reuse current
|
||||
|
|
Loading…
Add table
Reference in a new issue