Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcy Sutton committed Jun 15, 2017
2 parents b254976 + 08b3feb commit 8c5e098
Show file tree
Hide file tree
Showing 17 changed files with 8,191 additions and 8,154 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,15 @@ v2.3.0:
date: 2017-06-14
changes:
- Overhaul of selectors API
- New experimental rule for hidden content
- New rule for aria-hidden="true" on the body
- New experimental rule for hidden-content
- New rule for flagging aria-hidden="true" on document.body
- Color-contrast rule impact is now serious
- Color-contrast fixes for implicit labels and TR elements
- Color-contrast puts 1:1 ratio elements into Needs Review/incomplete
- List category mappings in docs
- Update axe.source to work with Firefox webdriver
v2.3.1:
date: 2017-06-15
changes:
- Improvements to hidden-content rule
- Deduplicated langs in valid-lang options
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = function (grunt) {
},
langs : {
generate: {
check: 'lib/checks/language/valid-lang'
check: 'lib/commons/utils/valid-langs'
}
},
validate: {
Expand Down
2 changes: 1 addition & 1 deletion axe.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for axe-core 2.3.0
// Type definitions for axe-core 2.3.1
// Project: https://github.com/dequelabs/axe-core
// Definitions by: Marcy Sutton <https://github.com/marcysutton>

Expand Down
17 changes: 12 additions & 5 deletions build/tasks/langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ module.exports = function (grunt) {
return entry;
}
function generateOutput(langs, checkPath) {
var path = checkPath + '.json';
var check = grunt.file.readJSON(path);
check.options = langs;
grunt.file.write(path, JSON.stringify(check, null, ' '));
var path = checkPath + '.js';
var template = [
'/*global axe */\n',
'/*jshint -W109 */\n',
'var langs = ' + JSON.stringify(langs, null, '\t') + ';\n',
'axe.utils.validLangs = function () {\n',
'\t\'use strict\';\n',
'\treturn langs;\n',
'};'
].join('');
grunt.file.write(path, template);
}
grunt.registerMultiTask('langs', function () {
var done = this.async();
Expand Down Expand Up @@ -83,4 +90,4 @@ module.exports = function (grunt) {
done(result);
});
});
};
};
2 changes: 1 addition & 1 deletion doc/rule-descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
| accesskeys | Ensures every accesskey attribute value is unique | wcag2a, wcag211, cat.keyboard | true |
| area-alt | Ensures &lt;area&gt; elements of image maps have alternate text | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a | true |
| aria-allowed-attr | Ensures ARIA attributes are allowed for an element&apos;s role | cat.aria, wcag2a, wcag411, wcag412 | true |
| aria-hidden-body | Ensures aria-hidden is not present on the document body. | cat.aria, wcag2a, wcag412 | true |
| aria-hidden-body | Ensures aria-hidden=&apos;true&apos; is not present on the document body. | cat.aria, wcag2a, wcag412 | true |
| aria-required-attr | Ensures elements with ARIA roles have all required ARIA attributes | cat.aria, wcag2a, wcag411, wcag412 | true |
| aria-required-children | Ensures elements with an ARIA role that require child roles contain them | cat.aria, wcag2a, wcag131 | true |
| aria-required-parent | Ensures elements with an ARIA role that require parent roles are contained by them | cat.aria, wcag2a, wcag131 | true |
Expand Down
5 changes: 3 additions & 2 deletions lib/checks/language/valid-lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
function getBaseLang (lang) {
return lang.trim().split('-')[0].toLowerCase();
}

var langs, invalid;

langs = (options || []).map(getBaseLang);
langs = (options ? options : axe.commons.utils.validLangs()).map(getBaseLang);

invalid = ['lang', 'xml:lang'].reduce(function (invalid, langAttr) {
var langVal = node.getAttribute(langAttr);
Expand All @@ -28,4 +29,4 @@ if (invalid.length) {
return true;
}

return false;
return false;
Loading

0 comments on commit 8c5e098

Please sign in to comment.