Skip to content

Commit

Permalink
feat: add layout-table-matches method (#2400)
Browse files Browse the repository at this point in the history
* feat: add layout-table-matches method

* chore: add comment

* chore: expose layoutTableMatches
  • Loading branch information
WilcoFiers authored Jul 20, 2020
1 parent f2cccf5 commit d7ba70f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/core/base/metadata-function-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ import labelContentNameMismatchMatches from '../../rules/label-content-name-mism
import labelMatches from '../../rules/label-matches';
import landmarkHasBodyContextMatches from '../../rules/landmark-has-body-context-matches';
import landmarkUniqueMatches from '../../rules/landmark-unique-matches';
import layoutTableMatches from '../../rules/layout-table-matches';
import linkInTextBlockMatches from '../../rules/link-in-text-block-matches';
import noAutoplayAudioMatches from '../../rules/no-autoplay-audio-matches';
import noEmptyRoleMatches from '../../rules/no-empty-role-matches';
Expand Down Expand Up @@ -307,6 +308,7 @@ const metadataFunctionMap = {
'label-matches': labelMatches,
'landmark-has-body-context-matches': landmarkHasBodyContextMatches,
'landmark-unique-matches': landmarkUniqueMatches,
'layout-table-matches': layoutTableMatches,
'link-in-text-block-matches': linkInTextBlockMatches,
'no-autoplay-audio-matches': noAutoplayAudioMatches,
'no-empty-role-matches': noEmptyRoleMatches,
Expand Down
9 changes: 9 additions & 0 deletions lib/rules/layout-table-matches.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { isDataTable } from '../commons/table';
import { isFocusable } from '../commons/dom';

// TODO: es-modules add tests. No way to access this on the `axe` object
function dataTableMatches(node) {
return !isDataTable(node) && !isFocusable(node);
}

export default dataTableMatches;

0 comments on commit d7ba70f

Please sign in to comment.