
When an iframe is inserted or removed from a document, we now take it in and out of the BrowsingContext tree.
39 lines
1 KiB
C++
39 lines
1 KiB
C++
/*
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class BrowsingContextContainer : public HTMLElement {
|
|
public:
|
|
BrowsingContextContainer(DOM::Document&, DOM::QualifiedName);
|
|
virtual ~BrowsingContextContainer() override;
|
|
|
|
BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; }
|
|
const BrowsingContext* nested_browsing_context() const { return m_nested_browsing_context; }
|
|
|
|
const DOM::Document* content_document() const;
|
|
DOM::Document const* content_document_without_origin_check() const;
|
|
|
|
virtual void inserted() override;
|
|
virtual void removed_from(Node*) override;
|
|
|
|
protected:
|
|
RefPtr<BrowsingContext> m_nested_browsing_context;
|
|
|
|
private:
|
|
virtual bool is_browsing_context_container() const override { return true; }
|
|
};
|
|
|
|
}
|
|
|
|
namespace Web::DOM {
|
|
template<>
|
|
inline bool Node::fast_is<HTML::BrowsingContextContainer>() const { return is_browsing_context_container(); }
|
|
}
|