LibWeb: Correct default ARIA Roles for few tags

This commit is contained in:
Simek 2024-10-26 23:46:18 +02:00 committed by Andreas Kling
commit c9c67a6f24
Notes: github-actions[bot] 2024-10-27 09:22:16 +00:00
2 changed files with 8 additions and 2 deletions

View file

@ -571,6 +571,9 @@ void HTMLElement::blur()
Optional<ARIA::Role> HTMLElement::default_role() const
{
// https://www.w3.org/TR/html-aria/#el-address
if (local_name() == TagNames::address)
return ARIA::Role::group;
// https://www.w3.org/TR/html-aria/#el-article
if (local_name() == TagNames::article)
return ARIA::Role::article;
@ -612,7 +615,7 @@ Optional<ARIA::Role> HTMLElement::default_role() const
}
// https://www.w3.org/TR/html-aria/#el-hgroup
if (local_name() == TagNames::hgroup)
return ARIA::Role::generic;
return ARIA::Role::group;
// https://www.w3.org/TR/html-aria/#el-i
if (local_name() == TagNames::i)
return ARIA::Role::generic;
@ -622,6 +625,9 @@ Optional<ARIA::Role> HTMLElement::default_role() const
// https://www.w3.org/TR/html-aria/#el-nav
if (local_name() == TagNames::nav)
return ARIA::Role::navigation;
// https://www.w3.org/TR/html-aria/#el-s
if (local_name() == TagNames::s)
return ARIA::Role::deletion;
// https://www.w3.org/TR/html-aria/#el-samp
if (local_name() == TagNames::samp)
return ARIA::Role::generic;