Skip to content

Commit

Permalink
Bug 1858051: Fix ComputedARIARole for <input type="search">, r=Jamie
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nathan LaPre committed Feb 2, 2024
1 parent d9c506a commit a2b1bf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 4 additions & 2 deletions accessible/basetypes/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>.
Expand Down
3 changes: 0 additions & 3 deletions testing/web-platform/meta/html-aam/roles.html.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[roles.html]
[el-input-search]
expected: FAIL

[el-em]
expected: FAIL

Expand Down

0 comments on commit a2b1bf3

Please sign in to comment.