mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Correct default ARIA Roles for few tags
This commit is contained in:
parent
551b72b018
commit
c9c67a6f24
Notes:
github-actions[bot]
2024-10-27 09:22:16 +00:00
Author: https://github.com/Simek 🔰
Commit: c9c67a6f24
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1984
Reviewed-by: https://github.com/sideshowbarker
2 changed files with 8 additions and 2 deletions
|
@ -571,6 +571,9 @@ void HTMLElement::blur()
|
||||||
|
|
||||||
Optional<ARIA::Role> HTMLElement::default_role() const
|
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
|
// https://www.w3.org/TR/html-aria/#el-article
|
||||||
if (local_name() == TagNames::article)
|
if (local_name() == TagNames::article)
|
||||||
return ARIA::Role::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
|
// https://www.w3.org/TR/html-aria/#el-hgroup
|
||||||
if (local_name() == TagNames::hgroup)
|
if (local_name() == TagNames::hgroup)
|
||||||
return ARIA::Role::generic;
|
return ARIA::Role::group;
|
||||||
// https://www.w3.org/TR/html-aria/#el-i
|
// https://www.w3.org/TR/html-aria/#el-i
|
||||||
if (local_name() == TagNames::i)
|
if (local_name() == TagNames::i)
|
||||||
return ARIA::Role::generic;
|
return ARIA::Role::generic;
|
||||||
|
@ -622,6 +625,9 @@ Optional<ARIA::Role> HTMLElement::default_role() const
|
||||||
// https://www.w3.org/TR/html-aria/#el-nav
|
// https://www.w3.org/TR/html-aria/#el-nav
|
||||||
if (local_name() == TagNames::nav)
|
if (local_name() == TagNames::nav)
|
||||||
return ARIA::Role::navigation;
|
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
|
// https://www.w3.org/TR/html-aria/#el-samp
|
||||||
if (local_name() == TagNames::samp)
|
if (local_name() == TagNames::samp)
|
||||||
return ARIA::Role::generic;
|
return ARIA::Role::generic;
|
||||||
|
|
|
@ -2311,7 +2311,7 @@ Optional<ARIA::Role> HTMLInputElement::default_role() const
|
||||||
return ARIA::Role::combobox;
|
return ARIA::Role::combobox;
|
||||||
// https://www.w3.org/TR/html-aria/#el-input-search
|
// https://www.w3.org/TR/html-aria/#el-input-search
|
||||||
if (type_state() == TypeAttributeState::Search && !has_attribute(AttributeNames::list))
|
if (type_state() == TypeAttributeState::Search && !has_attribute(AttributeNames::list))
|
||||||
return ARIA::Role::textbox;
|
return ARIA::Role::searchbox;
|
||||||
// https://www.w3.org/TR/html-aria/#el-input-submit
|
// https://www.w3.org/TR/html-aria/#el-input-submit
|
||||||
if (type_state() == TypeAttributeState::SubmitButton)
|
if (type_state() == TypeAttributeState::SubmitButton)
|
||||||
return ARIA::Role::button;
|
return ARIA::Role::button;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue