LibWeb: Add Support for the ARIA Element Properties

Element now supports getting and setting ARIA properties from
JS and HTML.
This commit is contained in:
Jonah
2022-11-28 17:58:13 -06:00
committed by Sam Atkins
parent 0a244b9c1f
commit e63d9d4925
57 changed files with 976 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Assertions.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/HTML/HTMLModElement.h>
@@ -17,4 +18,15 @@ HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName quali
HTMLModElement::~HTMLModElement() = default;
FlyString HTMLModElement::default_role() const
{
// https://www.w3.org/TR/html-aria/#el-del
if (local_name() == TagNames::del)
return DOM::ARIARoleNames::deletion;
// https://www.w3.org/TR/html-aria/#el-ins
if (local_name() == TagNames::ins)
return DOM::ARIARoleNames::insertion;
VERIFY_NOT_REACHED();
}
}