summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h
blob: 6dc69e497a4332de141e15ad496ceb9be0d3125e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * 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&, 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;

    Origin content_origin() const;
    bool may_access_from_origin(const Origin&) const;

    void nested_browsing_context_did_load(Badge<FrameLoader>);

    virtual void inserted() override;

protected:
    RefPtr<BrowsingContext> m_nested_browsing_context;
};

}