mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Add ARIA::allows_name_from_content
This is required to implement accessible name and description calculation.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user