1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:08:10 +00:00

LibWeb: Add ARIA::allows_name_from_content

This is required to implement accessible name and description
calculation.
This commit is contained in:
Jonah 2023-02-05 11:20:16 -06:00 committed by Linus Groh
parent 613cfb31b1
commit fc3ee471ed
2 changed files with 26 additions and 0 deletions

View file

@ -178,4 +178,29 @@ bool is_non_abstract_role(Role role)
|| is_windows_role(role);
}
// https://www.w3.org/TR/wai-aria-1.2/#namefromcontent
bool allows_name_from_content(Role role)
{
return first_is_one_of(role,
Role::button,
Role::cell,
Role::checkbox,
Role::columnheader,
Role::gridcell,
Role::heading,
Role::link,
Role::menuitem,
Role::menuitemcheckbox,
Role::menuitemradio,
Role::option,
Role::radio,
Role::row,
Role::rowheader,
Role::sectionhead,
Role::switch_,
Role::tab,
Role::tooltip,
Role::treeitem);
}
}