Skip to content

Commit

Permalink
fix(dlitem): allow role=presentation on parent dl (#2301)
Browse files Browse the repository at this point in the history
  • Loading branch information
straker authored Jun 18, 2020
1 parent 2554f5c commit 9857978
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/checks/lists/dlitem-evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function dlitemEvaluate(node) {
return false;
}

if (!parentRole || parentRole === 'list') {
if (!parentRole || ['presentation', 'none', 'list'].includes(parentRole)) {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions test/checks/lists/dlitem.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ describe('dlitem', function() {
assert.isTrue(checks.dlitem.evaluate.apply(null, checkArgs));
});

it('should fail if the dt element has a parent <dl> with role="presentation"', function() {
it('should pass if the dt element has a parent <dl> with role="presentation"', function() {
var checkArgs = checkSetup(
'<dl role="presentation"><dt id="target">My list item</dt></dl>'
);
assert.isFalse(checks.dlitem.evaluate.apply(null, checkArgs));
assert.isTrue(checks.dlitem.evaluate.apply(null, checkArgs));
});

it('should fail if the dt element has a parent <dl> with a changed role', function() {
Expand Down

0 comments on commit 9857978

Please sign in to comment.