Skip to content

Commit a2b1bf3

Browse files
author
Nathan LaPre
committed
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
1 parent d9c506a commit a2b1bf3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

accessible/basetypes/Accessible.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,14 @@ nsStaticAtom* Accessible::ComputedARIARole() const {
572572
(roleMap->roleRule == kUseNativeRole || roleMap->IsOfType(eLandmark) ||
573573
roleMap->roleAtom == nsGkAtoms::alertdialog ||
574574
roleMap->roleAtom == nsGkAtoms::feed ||
575-
roleMap->roleAtom == nsGkAtoms::rowgroup ||
576-
roleMap->roleAtom == nsGkAtoms::searchbox)) {
575+
roleMap->roleAtom == nsGkAtoms::rowgroup)) {
577576
// Explicit ARIA role (e.g. specified via the role attribute) which does not
578577
// map to a unique Gecko role.
579578
return roleMap->roleAtom;
580579
}
580+
if (IsSearchbox()) {
581+
return nsGkAtoms::searchbox;
582+
}
581583
role geckoRole = Role();
582584
if (geckoRole == roles::LANDMARK) {
583585
// Landmark role from native markup; e.g. <main>, <nav>.

testing/web-platform/meta/html-aam/roles.html.ini

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
[roles.html]
2-
[el-input-search]
3-
expected: FAIL
4-
52
[el-em]
63
expected: FAIL
74

0 commit comments

Comments
 (0)