2021-04-03 11:43:08 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-04-03 11:43:08 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2021-05-31 13:59:28 +01:00
|
|
|
class BrowsingContextContainer : public HTMLElement {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(BrowsingContextContainer, HTMLElement);
|
|
|
|
|
2021-04-03 11:43:08 +02:00
|
|
|
public:
|
2021-05-31 13:59:28 +01:00
|
|
|
virtual ~BrowsingContextContainer() override;
|
2021-04-03 11:43:08 +02:00
|
|
|
|
2021-05-30 12:36:53 +02:00
|
|
|
BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; }
|
2022-04-01 20:58:27 +03:00
|
|
|
BrowsingContext const* nested_browsing_context() const { return m_nested_browsing_context; }
|
2021-04-03 11:43:08 +02:00
|
|
|
|
|
|
|
const DOM::Document* content_document() const;
|
2022-02-16 22:51:25 +00:00
|
|
|
DOM::Document const* content_document_without_origin_check() const;
|
2021-04-03 11:43:08 +02:00
|
|
|
|
2022-08-04 20:13:52 +02:00
|
|
|
HTML::Window* content_window() const;
|
|
|
|
|
2022-03-24 22:08:06 +02:00
|
|
|
DOM::Document const* get_svg_document() const;
|
|
|
|
|
2021-04-03 11:43:08 +02:00
|
|
|
protected:
|
2022-08-28 13:42:07 +02:00
|
|
|
BrowsingContextContainer(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
2022-03-23 20:13:34 -04:00
|
|
|
void create_new_nested_browsing_context();
|
|
|
|
void discard_nested_browsing_context();
|
|
|
|
|
2021-05-30 12:36:53 +02:00
|
|
|
RefPtr<BrowsingContext> m_nested_browsing_context;
|
2021-11-24 19:15:04 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual bool is_browsing_context_container() const override { return true; }
|
2021-04-03 11:43:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2021-11-24 19:15:04 +03:00
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
template<>
|
|
|
|
inline bool Node::fast_is<HTML::BrowsingContextContainer>() const { return is_browsing_context_container(); }
|
|
|
|
}
|
2022-08-28 13:42:07 +02:00
|
|
|
|
|
|
|
WRAPPER_HACK(BrowsingContextContainer, Web::HTML)
|