BrowsingContextContainer.h 1.1 KB

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