mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibWeb: Remove BrowsingContext::create_a_new_top_level_browsing_context
This call has been replaced by `create_a_new_top_level_browsing_context_and_document` after specification was refactored to use navigables.
This commit is contained in:
parent
b90dd9d1f8
commit
7daa462ef8
5 changed files with 10 additions and 20 deletions
|
@ -126,9 +126,9 @@ static JS::NonnullGCPtr<HTML::BrowsingContext> obtain_a_browsing_context_to_use_
|
|||
return browsing_context;
|
||||
}
|
||||
|
||||
// 3. Let newBrowsingContext be the result of creating a new top-level browsing context.
|
||||
// 3. Let newBrowsingContext be the first return value of creating a new top-level browsing context and document
|
||||
VERIFY(browsing_context.page());
|
||||
auto new_browsing_context = HTML::BrowsingContext::create_a_new_top_level_browsing_context(*browsing_context.page());
|
||||
auto new_browsing_context = HTML::create_a_new_top_level_browsing_context_and_document(*browsing_context.page()).release_value_but_fixme_should_propagate_errors().browsing_context;
|
||||
|
||||
// FIXME: 4. If navigationCOOP's value is "same-origin-plurs-COEP", then set newBrowsingContext's group's
|
||||
// cross-origin isolation mode to either "logical" or "concrete". The choice of which is implementation-defined.
|
||||
|
|
|
@ -105,16 +105,6 @@ HTML::Origin determine_the_origin(AK::URL const& url, SandboxingFlagSet sandbox_
|
|||
return URL::url_origin(url);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#creating-a-new-top-level-browsing-context
|
||||
JS::NonnullGCPtr<BrowsingContext> BrowsingContext::create_a_new_top_level_browsing_context(Web::Page& page)
|
||||
{
|
||||
// 1. Let group be the result of creating a new browsing context group.
|
||||
auto group = BrowsingContextGroup::create_a_new_browsing_context_group(page);
|
||||
|
||||
// 2. Return group's browsing context set[0].
|
||||
return *group->browsing_context_set().begin();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#creating-a-new-browsing-context
|
||||
JS::NonnullGCPtr<BrowsingContext> BrowsingContext::create_a_new_browsing_context(Page& page, JS::GCPtr<DOM::Document> creator, JS::GCPtr<DOM::Element> embedder, BrowsingContextGroup&)
|
||||
{
|
||||
|
@ -859,7 +849,7 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex
|
|||
else {
|
||||
// 1. Set chosen to the result of creating a new auxiliary browsing context with current.
|
||||
// FIXME: We have no concept of auxiliary browsing context
|
||||
chosen = HTML::BrowsingContext::create_a_new_top_level_browsing_context(*m_page);
|
||||
chosen = HTML::create_a_new_top_level_browsing_context_and_document(*m_page).release_value_but_fixme_should_propagate_errors().browsing_context;
|
||||
|
||||
// 2. If sandboxingFlagSet's sandboxed navigation browsing context flag is set, then current must be
|
||||
// set as chosen's one permitted sandboxed navigator.
|
||||
|
|
|
@ -39,7 +39,6 @@ class BrowsingContext final
|
|||
|
||||
public:
|
||||
static JS::NonnullGCPtr<BrowsingContext> create_a_new_browsing_context(Page&, JS::GCPtr<DOM::Document> creator, JS::GCPtr<DOM::Element> embedder, BrowsingContextGroup&);
|
||||
static JS::NonnullGCPtr<BrowsingContext> create_a_new_top_level_browsing_context(Page&);
|
||||
|
||||
struct BrowsingContextAndDocument {
|
||||
JS::NonnullGCPtr<BrowsingContext> browsing_context;
|
||||
|
|
|
@ -36,13 +36,8 @@ static OrderedHashTable<TraversableNavigable*>& user_agent_top_level_traversable
|
|||
return set;
|
||||
}
|
||||
|
||||
struct BrowsingContextAndDocument {
|
||||
JS::NonnullGCPtr<HTML::BrowsingContext> browsing_context;
|
||||
JS::NonnullGCPtr<DOM::Document> document;
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#creating-a-new-top-level-browsing-context
|
||||
static WebIDL::ExceptionOr<BrowsingContextAndDocument> create_a_new_top_level_browsing_context_and_document(Page& page)
|
||||
WebIDL::ExceptionOr<BrowsingContextAndDocument> create_a_new_top_level_browsing_context_and_document(Page& page)
|
||||
{
|
||||
// 1. Let group and document be the result of creating a new browsing context group and document.
|
||||
auto [group, document] = TRY(BrowsingContextGroup::create_a_new_browsing_context_group_and_document(page));
|
||||
|
|
|
@ -84,6 +84,12 @@ private:
|
|||
WeakPtr<Page> m_page;
|
||||
};
|
||||
|
||||
struct BrowsingContextAndDocument {
|
||||
JS::NonnullGCPtr<HTML::BrowsingContext> browsing_context;
|
||||
JS::NonnullGCPtr<DOM::Document> document;
|
||||
};
|
||||
|
||||
WebIDL::ExceptionOr<BrowsingContextAndDocument> create_a_new_top_level_browsing_context_and_document(Page& page);
|
||||
void finalize_a_same_document_navigation(JS::NonnullGCPtr<TraversableNavigable> traversable, JS::NonnullGCPtr<Navigable> target_navigable, JS::NonnullGCPtr<SessionHistoryEntry> target_entry, JS::GCPtr<SessionHistoryEntry> entry_to_replace);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue