BrowsingContextContainer.h 1020 B

1234567891011121314151617181920212223242526272829303132333435363738
  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&, 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. protected:
  19. RefPtr<BrowsingContext> m_nested_browsing_context;
  20. private:
  21. virtual bool is_browsing_context_container() const override { return true; }
  22. };
  23. }
  24. namespace Web::DOM {
  25. template<>
  26. inline bool Node::fast_is<HTML::BrowsingContextContainer>() const { return is_browsing_context_container(); }
  27. }