1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Bring BrowsingContext::choose_a_browsing_context closer to spec

This commit is contained in:
Idan Horowitz 2022-11-15 02:00:27 +02:00 committed by Linus Groh
parent c948873c5b
commit ff2f31bc81
3 changed files with 100 additions and 79 deletions

View file

@ -163,7 +163,18 @@ public:
BrowsingContext const& top_level_browsing_context() const { return const_cast<BrowsingContext*>(this)->top_level_browsing_context(); }
BrowsingContext* choose_a_browsing_context(StringView name, bool noopener);
enum class WindowType {
ExistingOrNone,
NewAndUnrestricted,
NewWithNoOpener,
};
struct ChosenBrowsingContext {
JS::GCPtr<BrowsingContext> browsing_context;
WindowType window_type;
};
ChosenBrowsingContext choose_a_browsing_context(StringView name, bool no_opener);
size_t document_tree_child_browsing_context_count() const;