2020-07-31 23:05:43 -03:00
|
|
|
/*
|
2021-04-28 17:46:44 -03:00
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
2020-07-31 23:05:43 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-07-31 23:05:43 -03:00
|
|
|
*/
|
|
|
|
|
|
2022-11-28 20:58:13 -03:00
|
|
|
#include <AK/Assertions.h>
|
2023-01-28 19:23:16 -03:00
|
|
|
#include <LibWeb/ARIA/Roles.h>
|
2026-04-18 05:54:06 -03:00
|
|
|
#include <LibWeb/Bindings/HTMLQuoteElement.h>
|
2022-09-30 20:16:16 -03:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2020-07-31 23:05:43 -03:00
|
|
|
#include <LibWeb/HTML/HTMLQuoteElement.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DEFINE_ALLOCATOR(HTMLQuoteElement);
|
2023-11-19 15:47:52 -03:00
|
|
|
|
2022-02-18 17:00:52 -03:00
|
|
|
HTMLQuoteElement::HTMLQuoteElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
2021-02-07 07:20:15 -03:00
|
|
|
: HTMLElement(document, move(qualified_name))
|
2020-07-31 23:05:43 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-14 16:21:51 -03:00
|
|
|
HTMLQuoteElement::~HTMLQuoteElement() = default;
|
2020-07-31 23:05:43 -03:00
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
void HTMLQuoteElement::initialize(JS::Realm& realm)
|
2023-01-10 08:28:20 -03:00
|
|
|
{
|
2024-03-16 09:13:08 -03:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLQuoteElement);
|
2025-04-20 11:22:57 -03:00
|
|
|
Base::initialize(realm);
|
2023-01-10 08:28:20 -03:00
|
|
|
}
|
|
|
|
|
|
2023-01-28 19:23:16 -03:00
|
|
|
Optional<ARIA::Role> HTMLQuoteElement::default_role() const
|
2022-11-28 20:58:13 -03:00
|
|
|
{
|
|
|
|
|
// https://www.w3.org/TR/html-aria/#el-blockquote
|
|
|
|
|
if (local_name() == TagNames::blockquote)
|
2023-01-28 19:23:16 -03:00
|
|
|
return ARIA::Role::blockquote;
|
2022-11-28 20:58:13 -03:00
|
|
|
// https://www.w3.org/TR/html-aria/#el-q
|
|
|
|
|
if (local_name() == TagNames::q)
|
2023-01-28 19:23:16 -03:00
|
|
|
return ARIA::Role::generic;
|
2022-11-28 20:58:13 -03:00
|
|
|
VERIFY_NOT_REACHED();
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 23:05:43 -03:00
|
|
|
}
|