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