mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:07:35 +00:00
LibWeb: Add ARIA::allows_name_from_content
This is required to implement accessible name and description calculation.
This commit is contained in:
parent
613cfb31b1
commit
fc3ee471ed
2 changed files with 26 additions and 0 deletions
|
@ -178,4 +178,29 @@ bool is_non_abstract_role(Role role)
|
||||||
|| is_windows_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_windows_role(Role);
|
||||||
|
|
||||||
bool is_non_abstract_role(Role);
|
bool is_non_abstract_role(Role);
|
||||||
|
bool allows_name_from_content(Role);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue