BrowsingContextContainer.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/HTML/HTMLElement.h>
  8. namespace Web::HTML {
  9. class BrowsingContextContainer : public HTMLElement {
  10. public:
  11. BrowsingContextContainer(DOM::Document&, DOM::QualifiedName);
  12. virtual ~BrowsingContextContainer() override;
  13. BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; }
  14. const BrowsingContext* nested_browsing_context() const { return m_nested_browsing_context; }
  15. const DOM::Document* content_document() const;
  16. DOM::Document const* content_document_without_origin_check() const;
  17. virtual void inserted() override;
  18. virtual void removed_from(Node*) override;
  19. protected:
  20. RefPtr<BrowsingContext> m_nested_browsing_context;
  21. private:
  22. virtual bool is_browsing_context_container() const override { return true; }
  23. };
  24. }
  25. namespace Web::DOM {
  26. template<>
  27. inline bool Node::fast_is<HTML::BrowsingContextContainer>() const { return is_browsing_context_container(); }
  28. }