Bug 1858051: Fix ComputedARIARole for <input type="search">, r=Jamie

The markup <input type="search"> will report a ComputedARIARole of "textbox,"
which isn't correct - it should return "searchbox." To address this issue, this
revision implements a change to ComputedARIARole for searchboxes, checking
IsSearchbox() and returning the searchbox atom if so. This revision also enables
the previously expected-failure relevant web platform test, since we now pass it.

Differential Revision: https://phabricator.services.mozilla.com/D200235
This commit is contained in:
Nathan LaPre 2024-02-02 18:23:21 +00:00
Родитель d9c506aa8d
Коммит a2b1bf3551
2 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -572,12 +572,14 @@ nsStaticAtom* Accessible::ComputedARIARole() const {
(roleMap->roleRule == kUseNativeRole || roleMap->IsOfType(eLandmark) ||
roleMap->roleAtom == nsGkAtoms::alertdialog ||
roleMap->roleAtom == nsGkAtoms::feed ||
roleMap->roleAtom == nsGkAtoms::rowgroup ||
roleMap->roleAtom == nsGkAtoms::searchbox)) {
roleMap->roleAtom == nsGkAtoms::rowgroup)) {
// Explicit ARIA role (e.g. specified via the role attribute) which does not
// map to a unique Gecko role.
return roleMap->roleAtom;
}
if (IsSearchbox()) {
return nsGkAtoms::searchbox;
}
role geckoRole = Role();
if (geckoRole == roles::LANDMARK) {
// Landmark role from native markup; e.g. <main>, <nav>.

Просмотреть файл

@ -1,7 +1,4 @@
[roles.html]
[el-input-search]
expected: FAIL
[el-em]
expected: FAIL