diff options
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/ARIA/Roles.cpp | 25 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/ARIA/Roles.h | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/ARIA/Roles.cpp b/Userland/Libraries/LibWeb/ARIA/Roles.cpp index b032e0351f..0748563ae0 100644 --- a/Userland/Libraries/LibWeb/ARIA/Roles.cpp +++ b/Userland/Libraries/LibWeb/ARIA/Roles.cpp @@ -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); +} + } diff --git a/Userland/Libraries/LibWeb/ARIA/Roles.h b/Userland/Libraries/LibWeb/ARIA/Roles.h index 630bcdac71..b8562d2560 100644 --- a/Userland/Libraries/LibWeb/ARIA/Roles.h +++ b/Userland/Libraries/LibWeb/ARIA/Roles.h @@ -124,5 +124,6 @@ bool is_live_region_role(Role); bool is_windows_role(Role); bool is_non_abstract_role(Role); +bool allows_name_from_content(Role); } |