HTMLHtmlElement.h 947 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/ARIA/Roles.h>
  8. #include <LibWeb/HTML/HTMLElement.h>
  9. namespace Web::HTML {
  10. class HTMLHtmlElement final : public HTMLElement {
  11. WEB_PLATFORM_OBJECT(HTMLHtmlElement, HTMLElement);
  12. JS_DECLARE_ALLOCATOR(HTMLHtmlElement);
  13. public:
  14. virtual ~HTMLHtmlElement() override;
  15. bool should_use_body_background_properties() const;
  16. // https://www.w3.org/TR/html-aria/#el-html
  17. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::document; }
  18. private:
  19. HTMLHtmlElement(DOM::Document&, DOM::QualifiedName);
  20. virtual void initialize(JS::Realm&) override;
  21. virtual bool is_html_html_element() const override { return true; }
  22. };
  23. }
  24. namespace Web::DOM {
  25. template<>
  26. inline bool Node::fast_is<HTML::HTMLHtmlElement>() const { return is_html_html_element(); }
  27. }