Skip to content

Commit

Permalink
determine subclassRole from superclassRole
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Jul 31, 2019
1 parent 46c711b commit e5b7222
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/commons/aria/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,6 @@ lookupTable.role = {
'input:not([type])',
'textarea'
],
subclassRoles: ['searchbox'],
unsupported: false
},
timer: {
Expand Down
11 changes: 5 additions & 6 deletions lib/commons/aria/subclass-implicit-nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
* @return {Mixed} Either an Array of CSS selectors or `null` if there are none
*/
aria.subclassImplicitNodes = function(role) {
const roles = aria.lookupTable.role[role];
const roles = aria.lookupTable.role;
let subclassRoles = [];

if (roles && roles.subclassRoles) {
roles.subclassRoles.forEach(subclassRole => {
const implicit = aria.implicitNodes(subclassRole);

for (const roleName in roles) {
if (roles[roleName].superclassRole === role) {
const implicit = aria.implicitNodes(roleName);
if (implicit) {
subclassRoles = subclassRoles.concat(implicit);
}
});
}
}

if (subclassRoles.length > 0) {
Expand Down

0 comments on commit e5b7222

Please sign in to comment.