From 124c1a31feaa552fec23a8efdcbfba4eedabbbbd Mon Sep 17 00:00:00 2001 From: Dan Bowling Date: Tue, 16 Aug 2022 16:36:59 -0600 Subject: [PATCH] feat(is-focusable): account for negative tabindex - add option arg that enables looking for negative tabindex (defaults to false) references: #3500 --- lib/commons/dom/is-focusable.js | 11 +- test/commons/dom/is-focusable.js | 182 +++++++++++++++++-------------- 2 files changed, 111 insertions(+), 82 deletions(-) diff --git a/lib/commons/dom/is-focusable.js b/lib/commons/dom/is-focusable.js index 6fc676fa10..9beb8b54a2 100644 --- a/lib/commons/dom/is-focusable.js +++ b/lib/commons/dom/is-focusable.js @@ -9,9 +9,10 @@ import { getNodeFromTree } from '../../core/utils'; * @memberof axe.commons.dom * @instance * @param {HTMLElement} el The HTMLElement + * @param {object} options Optional. If set to {programatically: false}, the function will return true * @return {Boolean} The element's focusability status */ -export default function isFocusable(el) { +export default function isFocusable(el, options = { programmatically: false }) { const vNode = el instanceof AbstractVirtualNode ? el : getNodeFromTree(el); if (vNode.props.nodeType !== 1) { @@ -23,8 +24,16 @@ export default function isFocusable(el) { } else if (isNativelyFocusable(vNode)) { return true; } + // check if the tabindex is specified and a parseable number var tabindex = vNode.attr('tabindex'); + if ( + tabindex && + options.programmatically === true && + parseInt(tabindex, 10) === -1 + ) { + return false; + } if (tabindex && !isNaN(parseInt(tabindex, 10))) { return true; } diff --git a/test/commons/dom/is-focusable.js b/test/commons/dom/is-focusable.js index ee75953083..6b9e57d363 100644 --- a/test/commons/dom/is-focusable.js +++ b/test/commons/dom/is-focusable.js @@ -1,4 +1,4 @@ -describe('is-focusable', function() { +describe('is-focusable', function () { function hideByClipping(el) { el.style.cssText = 'position: absolute !important;' + @@ -19,16 +19,16 @@ describe('is-focusable', function() { var fixtureSetup = axe.testUtils.fixtureSetup; var flatTreeSetup = axe.testUtils.flatTreeSetup; - describe('dom.isFocusable', function() { + describe('dom.isFocusable', function () { 'use strict'; var fixture = document.getElementById('fixture'); - afterEach(function() { + afterEach(function () { document.getElementById('fixture').innerHTML = ''; }); - it('should return true for visible, enabled textareas', function() { + it('should return true for visible, enabled textareas', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -36,7 +36,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return true for visible, enabled selects', function() { + it('should return true for visible, enabled selects', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -44,7 +44,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return true for visible, enabled buttons', function() { + it('should return true for visible, enabled buttons', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -52,7 +52,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return true for visible, enabled, non-hidden inputs', function() { + it('should return true for visible, enabled, non-hidden inputs', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -60,7 +60,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return false for non-element nodes', function() { + it('should return false for non-element nodes', function () { fixture.innerHTML = 'Hello World'; flatTreeSetup(fixture); var el = document.getElementById('target').childNodes[0]; @@ -68,7 +68,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for disabled elements', function() { + it('should return false for disabled elements', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -76,7 +76,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for hidden inputs', function() { + it('should return false for hidden inputs', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -84,7 +84,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for hidden inputs with tabindex', function() { + it('should return false for hidden inputs with tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -92,7 +92,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for hidden buttons with tabindex', function() { + it('should return false for hidden buttons with tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -101,7 +101,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for disabled buttons with tabindex', function() { + it('should return false for disabled buttons with tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -109,7 +109,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for non-visible elements', function() { + it('should return false for non-visible elements', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -118,7 +118,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return true for an anchor with an href', function() { + it('should return true for an anchor with an href', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -126,7 +126,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return false for an anchor with no href', function() { + it('should return false for an anchor with no href', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -134,7 +134,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return true for a div with a tabindex with spaces', function() { + it('should return true for a div with a tabindex with spaces', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -142,7 +142,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return true for a div with a tabindex', function() { + it('should return true for a div with a tabindex', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -150,7 +150,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return false for a div with a non-numeric tabindex', function() { + it('should return false for a div with a non-numeric tabindex', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -158,7 +158,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return true for a summary element', function() { + it('should return true for a summary element', function () { fixture.innerHTML = '
Summary

Detail

'; var el = document.getElementById('target'); @@ -167,7 +167,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return true for a details element without a summary element', function() { + it('should return true for a details element without a summary element', function () { fixture.innerHTML = '

Detail

'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -175,7 +175,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return false for a details element with a summary element', function() { + it('should return false for a details element with a summary element', function () { fixture.innerHTML = '
Summary

Detail

'; var el = document.getElementById('target'); @@ -184,25 +184,45 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for a div with no tabindex', function() { + it('should return false for a div with no tabindex', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); assert.isFalse(axe.commons.dom.isFocusable(el)); }); + + it('should return false for negative tabindex with option `programmatically: true`', function () { + fixture.innerHTML = '
'; + var el = document.getElementById('target'); + flatTreeSetup(fixture); + + assert.isFalse( + axe.commons.dom.isFocusable(el, { programmatically: true }) + ); + }); + + it('should return true for negative tabindex with option `programmatically: false`', function () { + fixture.innerHTML = '
'; + var el = document.getElementById('target'); + flatTreeSetup(fixture); + + assert.isTrue( + axe.commons.dom.isFocusable(el, { programmatically: false }) + ); + }); }); - describe('dom.isNativelyFocusable', function() { + describe('dom.isNativelyFocusable', function () { 'use strict'; var fixture = document.getElementById('fixture'); - afterEach(function() { + afterEach(function () { document.getElementById('fixture').innerHTML = ''; }); - it('should return true for buttons with redundant tabindex', function() { + it('should return true for buttons with redundant tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -210,7 +230,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for buttons with tabindex -1', function() { + it('should return true for buttons with tabindex -1', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -218,7 +238,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for visible, enabled textareas', function() { + it('should return true for visible, enabled textareas', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -226,7 +246,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for visible, enabled selects', function() { + it('should return true for visible, enabled selects', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -234,7 +254,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for visible, enabled buttons', function() { + it('should return true for visible, enabled buttons', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -242,7 +262,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for visible, enabled, non-hidden inputs', function() { + it('should return true for visible, enabled, non-hidden inputs', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -250,7 +270,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for disabled elements', function() { + it('should return false for disabled elements', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -258,7 +278,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for hidden inputs', function() { + it('should return false for hidden inputs', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -266,7 +286,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for elements hidden with display:none', function() { + it('should return false for elements hidden with display:none', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -275,7 +295,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for elements hidden with visibility:hidden', function() { + it('should return false for elements hidden with visibility:hidden', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -284,7 +304,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for elements collapsed with visibility:collapse', function() { + it('should return false for elements collapsed with visibility:collapse', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -293,7 +313,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for clipped elements', function() { + it('should return true for clipped elements', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); hideByClipping(el); @@ -302,7 +322,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for elements positioned off screen', function() { + it('should return true for elements positioned off screen', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); hideByMovingOffScreen(el); @@ -311,7 +331,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for elements hidden with display:none on an ancestor', function() { + it('should return false for elements hidden with display:none on an ancestor', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -320,7 +340,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for elements hidden with visibility:hidden on an ancestor', function() { + it('should return false for elements hidden with visibility:hidden on an ancestor', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -329,7 +349,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for elements collapsed with visibility:collapse on an ancestor', function() { + it('should return false for elements collapsed with visibility:collapse on an ancestor', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); @@ -338,7 +358,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for elements with a clipped ancestor', function() { + it('should return true for elements with a clipped ancestor', function () { fixture.innerHTML = '
'; hideByClipping(document.getElementById('parent')); @@ -348,7 +368,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for elements off-screened by an ancestor', function() { + it('should return true for elements off-screened by an ancestor', function () { fixture.innerHTML = '
'; hideByMovingOffScreen(document.getElementById('parent')); @@ -358,7 +378,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for hidden inputs with tabindex', function() { + it('should return false for hidden inputs with tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -366,7 +386,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for disabled inputs with tabindex', function() { + it('should return false for disabled inputs with tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -374,7 +394,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for hidden buttons with tabindex', function() { + it('should return false for hidden buttons with tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); @@ -383,7 +403,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for disabled buttons with tabindex', function() { + it('should return false for disabled buttons with tabindex', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -391,7 +411,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return true for an anchor with an href', function() { + it('should return true for an anchor with an href', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -399,7 +419,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for an anchor with no href', function() { + it('should return false for an anchor with no href', function () { fixture.innerHTML = ''; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -407,7 +427,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for a div with a tabindex with spaces', function() { + it('should return false for a div with a tabindex with spaces', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -415,7 +435,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for a div with a tabindex', function() { + it('should return false for a div with a tabindex', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -423,7 +443,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return false for a div with a non-numeric tabindex', function() { + it('should return false for a div with a non-numeric tabindex', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -431,7 +451,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isNativelyFocusable(el)); }); - it('should return true for a summary element', function() { + it('should return true for a summary element', function () { fixture.innerHTML = '
Summary

Detail

'; var el = document.getElementById('target'); @@ -440,7 +460,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return true for a details element without a summary element', function() { + it('should return true for a details element without a summary element', function () { fixture.innerHTML = '

Detail

'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -448,7 +468,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.isFocusable(el)); }); - it('should return false for a details element with a summary element', function() { + it('should return false for a details element with a summary element', function () { fixture.innerHTML = '
Summary

Detail

'; var el = document.getElementById('target'); @@ -457,7 +477,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.isFocusable(el)); }); - it('should return false for a div with no tabindex', function() { + it('should return false for a div with no tabindex', function () { fixture.innerHTML = '
'; var el = document.getElementById('target'); flatTreeSetup(fixture); @@ -466,21 +486,21 @@ describe('is-focusable', function() { }); }); - describe('dom.insertedIntoFocusOrder', function() { + describe('dom.insertedIntoFocusOrder', function () { var fixture = document.getElementById('fixture'); - beforeEach(function() { + beforeEach(function () { fixture.innerHTML = ''; }); - it('should return true for span with tabindex 0', function() { + it('should return true for span with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#spanTabindex0'); assert.isTrue(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return true for clipped span with tabindex 0', function() { + it('should return true for clipped span with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#clippedSpanTabindex0'); hideByClipping(node); @@ -488,7 +508,7 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return true for off screen span with tabindex 0', function() { + it('should return true for off screen span with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#offScreenSpanTabindex0'); hideByMovingOffScreen(node); @@ -496,28 +516,28 @@ describe('is-focusable', function() { assert.isTrue(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for span with negative tabindex', function() { + it('should return false for span with negative tabindex', function () { fixtureSetup(''); var node = fixture.querySelector('#spanNegativeTabindex'); assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for native button with tabindex 0', function() { + it('should return false for native button with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#nativeButtonTabindex0'); assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for native button with tabindex implicitly 0', function() { + it('should return false for native button with tabindex implicitly 0', function () { fixtureSetup(''); var node = fixture.querySelector('#nativeButtonTabindexImplicitly0'); assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for anchor with href and positive tabindex', function() { + it('should return false for anchor with href and positive tabindex', function () { fixtureSetup( '' ); @@ -526,14 +546,14 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for input with tabindex 0', function() { + it('should return false for input with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#inputWithTabindex0'); assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for off screen native button with tabindex 0', function() { + it('should return false for off screen native button with tabindex 0', function () { fixtureSetup( '' ); @@ -543,7 +563,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for off screen anchor with href and tabindex 1', function() { + it('should return false for off screen anchor with href and tabindex 1', function () { fixtureSetup( '' ); @@ -553,7 +573,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for off screen input with tabindex 0', function() { + it('should return false for off screen input with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#offScreenInputWithTabindex0'); hideByMovingOffScreen(node); @@ -561,7 +581,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for clipped native button with tabindex 0', function() { + it('should return false for clipped native button with tabindex 0', function () { fixtureSetup( '' ); @@ -571,7 +591,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for display none native button with tabindex 0', function() { + it('should return false for display none native button with tabindex 0', function () { fixtureSetup( '' ); @@ -580,7 +600,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for clipped anchor with href and tabindex 1', function() { + it('should return false for clipped anchor with href and tabindex 1', function () { fixtureSetup( '' ); @@ -590,7 +610,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for display none anchor with href and tabindex 1', function() { + it('should return false for display none anchor with href and tabindex 1', function () { fixtureSetup( '' ); @@ -599,7 +619,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for clipped input with tabindex 0', function() { + it('should return false for clipped input with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#clippedInputWithTabindex0'); hideByClipping(node); @@ -607,14 +627,14 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for display none input with tabindex 0', function() { + it('should return false for display none input with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#displayNoneInputWithTabindex0'); assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for hidden native button with tabindex 0', function() { + it('should return false for hidden native button with tabindex 0', function () { fixtureSetup( '' ); @@ -623,7 +643,7 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for hidden anchor with href and tabindex 1', function() { + it('should return false for hidden anchor with href and tabindex 1', function () { fixtureSetup( '' ); @@ -632,14 +652,14 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for hidden input with tabindex 0', function() { + it('should return false for hidden input with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#hiddenInputWithTabindex0'); assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for disabled native button with tabindex 0', function() { + it('should return false for disabled native button with tabindex 0', function () { fixtureSetup( '' ); @@ -648,14 +668,14 @@ describe('is-focusable', function() { assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for disabled input with tabindex 0', function() { + it('should return false for disabled input with tabindex 0', function () { fixtureSetup(''); var node = fixture.querySelector('#disabledInputTabindex0'); assert.isFalse(axe.commons.dom.insertedIntoFocusOrder(node)); }); - it('should return false for an invalid tabindex', function() { + it('should return false for an invalid tabindex', function () { fixtureSetup(''); var node = fixture.querySelector('#spanTabindexInvalid');