mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 02:25:07 +00:00

Once we paint, it's way too late for this check to happen anyway. Additionally, the spec's steps for retrieving the content document assume that both the browsing context's active document and the container's node document are non-null, which evidently isn't always the case here, as seen by crashes on the SerenityOS 2nd and 3rd birthday pages (I'm not sure about the details though). Fixes #12565.
38 lines
1,020 B
C++
38 lines
1,020 B
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&, 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;
|
|
|
|
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(); }
|
|
}
|