diff --git a/lib/commons/aria/index.js b/lib/commons/aria/index.js index 36369b033a..9930d69b2f 100644 --- a/lib/commons/aria/index.js +++ b/lib/commons/aria/index.js @@ -442,7 +442,7 @@ lookupTable.role = { { nodeName: 'input', properties: { - type: 'text' + type: ['text', 'search', 'tel', 'url', 'email'] } } ] @@ -2146,15 +2146,6 @@ lookupTable.elementsAllowedNoRole = [ ] } }, - { - nodeName: 'input', - attributes: { - list: isNull - }, - properties: { - type: ['email', 'search', 'tel', 'url'] - } - }, { nodeName: 'link', attributes: { @@ -2342,6 +2333,11 @@ lookupTable.evaluateRoleForElement = { return ( role === 'combobox' || role === 'searchbox' || role === 'spinbutton' ); + case 'tel': + case 'url': + case 'search': + case 'email': + return role === 'combobox'; default: return false; } diff --git a/test/checks/aria/aria-allowed-role.js b/test/checks/aria/aria-allowed-role.js index 1874b6dfab..4d2cae5670 100644 --- a/test/checks/aria/aria-allowed-role.js +++ b/test/checks/aria/aria-allowed-role.js @@ -164,6 +164,46 @@ describe('aria-allowed-role', function() { ); }); + it('returns true when INPUT type is tel with role combobox', function() { + var node = document.createElement('input'); + node.setAttribute('type', 'tel'); + node.setAttribute('role', 'combobox'); + fixture.appendChild(node); + assert.isTrue( + checks['aria-allowed-role'].evaluate.call(checkContext, node) + ); + }); + + it('returns true when INPUT type is url with role combobox', function() { + var node = document.createElement('input'); + node.setAttribute('type', 'url'); + node.setAttribute('role', 'combobox'); + fixture.appendChild(node); + assert.isTrue( + checks['aria-allowed-role'].evaluate.call(checkContext, node) + ); + }); + + it('returns true when INPUT type is search with role combobox', function() { + var node = document.createElement('input'); + node.setAttribute('type', 'search'); + node.setAttribute('role', 'combobox'); + fixture.appendChild(node); + assert.isTrue( + checks['aria-allowed-role'].evaluate.call(checkContext, node) + ); + }); + + it('returns true when INPUT type is email with role combobox', function() { + var node = document.createElement('input'); + node.setAttribute('type', 'email'); + node.setAttribute('role', 'combobox'); + fixture.appendChild(node); + assert.isTrue( + checks['aria-allowed-role'].evaluate.call(checkContext, node) + ); + }); + it('returns true when INPUT type is text with role spinbutton', function() { var node = document.createElement('input'); node.setAttribute('type', 'text'); diff --git a/test/integration/rules/aria-allowed-role/aria-allowed-role.html b/test/integration/rules/aria-allowed-role/aria-allowed-role.html index 5095ed00a6..f920c92b52 100644 --- a/test/integration/rules/aria-allowed-role/aria-allowed-role.html +++ b/test/integration/rules/aria-allowed-role/aria-allowed-role.html @@ -62,6 +62,42 @@

aria-expanded="true" id="pass-input-text-role-combobox" /> + + + +