diff --git a/lib/commons/dom/has-content-virtual.js b/lib/commons/dom/has-content-virtual.js index eb5e9b9d69..4a91344da2 100644 --- a/lib/commons/dom/has-content-virtual.js +++ b/lib/commons/dom/has-content-virtual.js @@ -39,7 +39,7 @@ dom.hasContentVirtual = function(elm, noRecursion, ignoreAria) { // It is a graphical element dom.isVisualContent(elm.actualNode) || // It has an ARIA label - (!!ignoreAria || !!aria.labelVirtual(elm)) || + (!ignoreAria && !!aria.labelVirtual(elm)) || // or one of it's descendants does (!noRecursion && elm.children.some( diff --git a/test/commons/dom/has-content-virtual.js b/test/commons/dom/has-content-virtual.js index acebe380b5..cb84e322e7 100644 --- a/test/commons/dom/has-content-virtual.js +++ b/test/commons/dom/has-content-virtual.js @@ -41,7 +41,7 @@ describe('dom.hasContentVirtual', function() { it('is false if the element has an aria label but `ignoreAria=true`', function() { fixture.innerHTML = '
'; tree = axe.utils.getFlattenedTree(fixture); - assert.isTrue( + assert.isFalse( hasContentVirtual( axe.utils.querySelectorAll(tree, '#target')[0], true, diff --git a/test/rule-matches/scrollable-region-focusable-matches.js b/test/rule-matches/scrollable-region-focusable-matches.js index 94a77be3fb..f2d373fc9f 100644 --- a/test/rule-matches/scrollable-region-focusable-matches.js +++ b/test/rule-matches/scrollable-region-focusable-matches.js @@ -82,6 +82,14 @@ describe('scrollable-region-focusable-matches', function() { assert.isTrue(actual); }); + it('returns false when element overflow is scroll but has no content', function() { + var target = queryFixture( + '
' + ); + var actual = rule.matches(target.actualNode, target); + assert.isFalse(actual); + }); + describe('shadowDOM - scrollable-region-focusable-matches', function() { before(function() { if (!shadowSupported) {