/* * Copyright (c) 2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Web::HTML { class BrowsingContextGroup final : public JS::Cell { JS_CELL(BrowsingContextGroup, JS::Cell); JS_DECLARE_ALLOCATOR(BrowsingContextGroup); public: struct BrowsingContextGroupAndDocument { JS::NonnullGCPtr browsing_context; JS::NonnullGCPtr document; }; static WebIDL::ExceptionOr create_a_new_browsing_context_group_and_document(JS::NonnullGCPtr); ~BrowsingContextGroup(); Page& page() { return m_page; } Page const& page() const { return m_page; } auto& browsing_context_set() { return m_browsing_context_set; } auto const& browsing_context_set() const { return m_browsing_context_set; } void append(BrowsingContext&); private: explicit BrowsingContextGroup(JS::NonnullGCPtr); virtual void visit_edges(Cell::Visitor&) override; // https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-group-set OrderedHashTable> m_browsing_context_set; JS::NonnullGCPtr m_page; }; }