BrowsingContextContainer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. BrowsingContext const* 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. HTML::Window* content_window() const;
  18. DOM::Document const* get_svg_document() const;
  19. protected:
  20. void create_new_nested_browsing_context();
  21. void discard_nested_browsing_context();
  22. RefPtr<BrowsingContext> m_nested_browsing_context;
  23. private:
  24. virtual bool is_browsing_context_container() const override { return true; }
  25. };
  26. }
  27. namespace Web::DOM {
  28. template<>
  29. inline bool Node::fast_is<HTML::BrowsingContextContainer>() const { return is_browsing_context_container(); }
  30. }