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