Skip to content

Commit

Permalink
Merge branch 'release-2.3.1' of github.com:browserstack/a11y-engine-a…
Browse files Browse the repository at this point in the history
…xe-core into AXE-231-iframe
  • Loading branch information
Utkarsh Chaudhary committed Aug 2, 2024
2 parents 8f84c27 + b004343 commit 7b42677
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 21 deletions.
8 changes: 5 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = function (grunt) {
grunt.loadTasks('build/tasks');

var langs;
var wrapper = !!grunt.option('wrapper');
if (grunt.option('lang')) {
langs = (grunt.option('lang') || '').split(/[,;]/g).map(function (lang) {
lang = lang.trim();
Expand Down Expand Up @@ -85,11 +86,11 @@ module.exports = function (grunt) {
files: langs.map(function (lang, i) {
return {
src: [
'lib/intro.stub',
wrapper ? 'lib/custom/intro.stub' : 'lib/intro.stub',
'<%= concat.engine.coreFiles %>',
// include rules / checks / commons
'<%= configure.rules.files[' + i + '].dest.auto %>',
'lib/outro.stub'
wrapper ? 'lib/custom/outro.stub' : 'lib/outro.stub'
],
dest: 'axe' + lang + '.js'
};
Expand Down Expand Up @@ -127,7 +128,8 @@ module.exports = function (grunt) {
entry: 'lib/commons/aria/index.js',
destFile: 'doc/aria-supported.md',
options: {
langs: langs
langs: langs,
wrapper: wrapper
},
listType: 'unsupported' // Possible values for listType: 'supported', 'unsupported', 'all'
}
Expand Down
3 changes: 2 additions & 1 deletion build/tasks/aria-supported.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module.exports = function (grunt) {
* hence cannot be required at the top of the file.
*/
const done = this.async();
const { langs } = this.options();
const { langs, wrapper } = this.options();
if (wrapper) return true;
const fileNameSuffix = langs && langs.length > 0 ? `${langs[0]}` : '';
const axe = require(`../../axe${fileNameSuffix}`);
const listType = this.data.listType.toLowerCase();
Expand Down
2 changes: 1 addition & 1 deletion doc/rule-descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Rules that check for conformance to WCAG AAA success criteria that can be fully
| Rule ID | Description | Impact | Tags | Issue Type | ACT Rules |
| :--------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | :------- | :----------------------------------------------------------------------- | :------------------------- | :------------------------------------------------- |
| [color-contrast-enhanced](https://dequeuniversity.com/rules/axe/4.9/color-contrast-enhanced?application=RuleDescription) | Ensures the contrast between foreground and background colors meets WCAG 2 AAA enhanced contrast ratio thresholds | Serious | cat.color, wcag2aaa, wcag146, ACT | failure, needs&nbsp;review | [09o5cg](https://act-rules.github.io/rules/09o5cg) |
| [heading-order](https://dequeuniversity.com/rules/axe/4.9/heading-order?application=RuleDescription) | Ensures the order of headings is semantically correct | Moderate | cat.semantics, wcag2aaa, wcag2410, a11y-engine, a11y-engine-experimental | failure, needs&nbsp;review | |
| [heading-order](https://dequeuniversity.com/rules/axe/4.9/heading-order?application=RuleDescription) | Ensures the order of headings is semantically correct | Moderate | cat.structure, wcag2aaa, wcag2410, a11y-engine, a11y-engine-experimental | failure, needs&nbsp;review | |
| [identical-links-same-purpose](https://dequeuniversity.com/rules/axe/4.9/identical-links-same-purpose?application=RuleDescription) | Ensure that links with the same accessible name serve a similar purpose | Minor | cat.semantics, wcag2aaa, wcag249 | needs&nbsp;review | [b20e66](https://act-rules.github.io/rules/b20e66) |
| [meta-refresh-no-exceptions](https://dequeuniversity.com/rules/axe/4.9/meta-refresh-no-exceptions?application=RuleDescription) | Ensures &lt;meta http-equiv=&quot;refresh&quot;&gt; is not used for delayed refresh | Minor | cat.time-and-media, wcag2aaa, wcag224, wcag325 | failure | [bisz58](https://act-rules.github.io/rules/bisz58) |

Expand Down
2 changes: 1 addition & 1 deletion lib/checks/navigation/heading-order.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"impact": "moderate",
"messages": {
"pass": "Heading order valid",
"fail": "Heading order invalid",
"fail": "Fix the order of headings. Headings should be in descending order of size without skipping levels. For example, <h2> should be followed by <h3>, not <h4> or <h5>.",
"incomplete": "Unable to determine previous heading"
}
}
Expand Down
15 changes: 15 additions & 0 deletions lib/custom/intro.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*! axe v<%= pkg.version %>
* Copyright (c) 2015 - <%= grunt.template.today("yyyy") %> Deque Systems, Inc.
*
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This entire copyright notice must appear in every copy of this file you
* distribute or in any file that contains substantial portions of this source
* code.
*/
const createAxe = () => (function axeFunction (window) {
// A window reference is required to access the axe object in a "global".
var global = window;
var document = window.document;
2 changes: 2 additions & 0 deletions lib/custom/outro.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

}( typeof window === 'object' ? window : this ));
2 changes: 1 addition & 1 deletion lib/rules/heading-order.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"selector": "h1, h2, h3, h4, h5, h6, [role=heading]",
"matches": "heading-matches",
"tags": [
"cat.semantics",
"cat.structure",
"wcag2aaa",
"wcag2410",
"a11y-engine",
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"develop": "grunt dev --force",
"api-docs": "jsdoc --configure .jsdoc.json",
"build": "grunt",
"build:wrapper": "grunt --wrapper=true",
"eslint": "eslint --color --format stylish '{lib,test,build,doc}/**/*.js' 'Gruntfile.js'",
"test": "npm run test:tsc && run-s \"test:unit:* -- {@}\" --",
"test:tsc": "tsc",
Expand Down

0 comments on commit 7b42677

Please sign in to comment.