diff --git a/.eslintrc.js b/.eslintrc.js index 71a39bc1..b269cdee 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,7 +10,8 @@ module.exports = { }, globals: { axe: true, - Promise: true + Promise: true, + a11yEngine: true }, rules: { 'no-bitwise': 2, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e2a2341..5cbf7d46 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,9 +19,7 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build - # v4 download seems to have some flakiness with the download of artifacts so pinning to v3 for now - # @see https://github.com/actions/download-artifact/issues/249 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: axe-core path: axe.js diff --git a/lib/checks/color/link-in-text-block-evaluate.js b/lib/checks/color/link-in-text-block-evaluate.js index be872cd7..70ac126a 100644 --- a/lib/checks/color/link-in-text-block-evaluate.js +++ b/lib/checks/color/link-in-text-block-evaluate.js @@ -4,7 +4,6 @@ import { getBackgroundColor, incompleteData } from '../../commons/color'; -import a11yEngineCommons from '../../commons/a11y-engine-index'; function getContrast(color1, color2) { var c1lum = color1.getRelativeLuminance(); @@ -53,7 +52,7 @@ function linkInTextBlockEvaluate(node, options) { ) { return true; } - return a11yEngineCommons.distinguishableLinkEvaluate(node, parentBlock); + return a11yEngine.commons.distinguishableLinkEvaluate(node, parentBlock); } // Capture colors diff --git a/lib/commons/a11y-engine-index.js b/lib/commons/a11y-engine-index.js deleted file mode 100644 index edc7f9b0..00000000 --- a/lib/commons/a11y-engine-index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { distinguishableLinkEvaluate } from '../../../a11y-engine-core/lib/commons/distinguishable-link'; - -const a11yEngineCommons = {}; -a11yEngineCommons.distinguishableLinkEvaluate = distinguishableLinkEvaluate; - -export default a11yEngineCommons; diff --git a/lib/commons/dom/get-overflow-hidden-ancestors.js b/lib/commons/dom/get-overflow-hidden-ancestors.js index 79ca04ce..8ace4290 100644 --- a/lib/commons/dom/get-overflow-hidden-ancestors.js +++ b/lib/commons/dom/get-overflow-hidden-ancestors.js @@ -28,7 +28,7 @@ const getOverflowHiddenAncestors = memoize( ancestors.push(vNode); } } else { - if (overflow.includes('hidden')) { + if (overflow === 'hidden' || overflow.includes('clip')) { ancestors.push(vNode); } } diff --git a/lib/core/base/rule.js b/lib/core/base/rule.js index e42c7429..8432760a 100644 --- a/lib/core/base/rule.js +++ b/lib/core/base/rule.js @@ -12,6 +12,7 @@ import { } from '../utils'; import { isVisibleToScreenReaders } from '../../commons/dom'; import constants from '../constants'; +import cache from './cache'; export default function Rule(spec, parentAudit) { this._audit = parentAudit; @@ -245,6 +246,7 @@ Rule.prototype.run = function run(context, options = {}, resolve, reject) { try { // Matches throws an error when it lacks support for document methods nodes = this.gatherAndMatchNodes(context, options); + cache.set(this.id, nodes.length); } catch (error) { // Exit the rule execution if matches fails reject(new SupportError({ cause: error, ruleId: this.id })); diff --git a/lib/core/utils/check-helper.js b/lib/core/utils/check-helper.js index fbedf364..71960bac 100644 --- a/lib/core/utils/check-helper.js +++ b/lib/core/utils/check-helper.js @@ -25,6 +25,9 @@ function checkHelper(checkResult, options, resolve, reject) { data(data) { checkResult.data = data; }, + getCheckData() { + return checkResult.data; + }, relatedNodes(nodes) { if (!window.Node) { return;