Skip to content

Commit

Permalink
Added HTML5 input types to 4.1.2 Name, Role and Value checks. This re…
Browse files Browse the repository at this point in the history
…solves issue #196.
  • Loading branch information
ironikart committed Sep 11, 2017
1 parent 828939e commit 4ae66f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.js
Expand Up @@ -172,11 +172,16 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle4_Guideline4_1_4_1_2 = {
textarea: ['label', '@title', '@aria-label', '@aria-labelledby']
}

var html5inputTypes = ['email', 'search', 'date', 'datetime-local', 'month', 'number', 'tel', 'time', 'url', 'week'];
for (var i = 0, l = html5inputTypes.length; i < l; i++) {
requiredNames['input_'+html5inputTypes[i]] = ['label', '@title', '@aria-label', '@aria-labelledby'];
}

var requiredValues = {
select: 'option_selected'
};

for (var el = 0; el < elements.length; el++) {
for (var el = 0, ll = elements.length; el < ll; el++) {
var element = elements[el];
var nodeName = element.nodeName.toLowerCase();
var msgSubCode = element.nodeName.substr(0, 1).toUpperCase() + element.nodeName.substr(1).toLowerCase();
Expand Down

0 comments on commit 4ae66f3

Please sign in to comment.