/src/serenity/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2020, the SerenityOS developers. |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <AK/Assertions.h> |
8 | | #include <LibWeb/ARIA/Roles.h> |
9 | | #include <LibWeb/Bindings/HTMLQuoteElementPrototype.h> |
10 | | #include <LibWeb/Bindings/Intrinsics.h> |
11 | | #include <LibWeb/HTML/HTMLQuoteElement.h> |
12 | | |
13 | | namespace Web::HTML { |
14 | | |
15 | | JS_DEFINE_ALLOCATOR(HTMLQuoteElement); |
16 | | |
17 | | HTMLQuoteElement::HTMLQuoteElement(DOM::Document& document, DOM::QualifiedName qualified_name) |
18 | 0 | : HTMLElement(document, move(qualified_name)) |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | 0 | HTMLQuoteElement::~HTMLQuoteElement() = default; |
23 | | |
24 | | void HTMLQuoteElement::initialize(JS::Realm& realm) |
25 | 0 | { |
26 | 0 | Base::initialize(realm); |
27 | 0 | WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLQuoteElement); |
28 | 0 | } |
29 | | |
30 | | Optional<ARIA::Role> HTMLQuoteElement::default_role() const |
31 | 0 | { |
32 | | // https://www.w3.org/TR/html-aria/#el-blockquote |
33 | 0 | if (local_name() == TagNames::blockquote) |
34 | 0 | return ARIA::Role::blockquote; |
35 | | // https://www.w3.org/TR/html-aria/#el-q |
36 | 0 | if (local_name() == TagNames::q) |
37 | 0 | return ARIA::Role::generic; |
38 | 0 | VERIFY_NOT_REACHED(); |
39 | 0 | } |
40 | | |
41 | | } |