Skip to content

Commit 4b49026

Browse files
authored
Merge pull request #124 from browserstack/release-3.5.0
fix: Release 3.5.0 changes
2 parents a1eed77 + bc96242 commit 4b49026

File tree

5 files changed

+41
-13
lines changed

5 files changed

+41
-13
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module.exports = {
1010
},
1111
globals: {
1212
axe: true,
13-
Promise: true
13+
Promise: true,
14+
a11yEngine: true
1415
},
1516
rules: {
1617
'no-bitwise': 2,

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ jobs:
1919
cache: 'npm'
2020
- run: npm ci
2121
- run: npm run build
22-
# v4 download seems to have some flakiness with the download of artifacts so pinning to v3 for now
23-
# @see https://github.com/actions/download-artifact/issues/249
24-
- uses: actions/upload-artifact@v3
22+
- uses: actions/upload-artifact@v4
2523
with:
2624
name: axe-core
2725
path: axe.js

lib/checks/color/link-in-text-block-evaluate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
getBackgroundColor,
55
incompleteData
66
} from '../../commons/color';
7-
import a11yEngineCommons from '../../commons/a11y-engine-index';
87

98
function getContrast(color1, color2) {
109
var c1lum = color1.getRelativeLuminance();
@@ -53,7 +52,7 @@ function linkInTextBlockEvaluate(node, options) {
5352
) {
5453
return true;
5554
}
56-
return a11yEngineCommons.distinguishableLinkEvaluate(node, parentBlock);
55+
return a11yEngine.commons.distinguishableLinkEvaluate(node, parentBlock);
5756
}
5857

5958
// Capture colors

lib/commons/a11y-engine-index.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

lib/rules/autocomplete-a11y-matches.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,50 @@ function nodeIsASearchFunctionality(actualNode, currLevel = 0, maxLevels = 4) {
5757
return currentLevelSearch(actualNode, currLevel);
5858
}
5959

60+
function quantityField(node) {
61+
const keywords = [
62+
'qty',
63+
'quantity',
64+
'quantities',
65+
'km',
66+
'kilometer',
67+
'drive',
68+
'code',
69+
'mileage',
70+
'power',
71+
'fuel'
72+
];
73+
const attributes = [
74+
'name',
75+
'id',
76+
'title',
77+
'placeholder',
78+
'aria-label',
79+
'data-label',
80+
'data-title',
81+
'data-placeholder',
82+
'role'
83+
];
84+
return attributes.some(attr => {
85+
if (node.hasAttribute(attr)) {
86+
const value = node.getAttribute(attr).toLowerCase();
87+
return keywords.some(
88+
keyword => value && value.includes(keyword.toLowerCase())
89+
);
90+
}
91+
return false;
92+
});
93+
}
94+
6095
function autocompleteA11yMatches(node, virtualNode) {
6196
const a11yEngineFlag = true;
6297
/* the flag is used to tell autocomplete matcher that it is being called
6398
by a11y-engine and thus bypass an if block
6499
The second condition is to check we are not matching with search functionality */
65100
return (
66101
autocompleteMatches(node, virtualNode, a11yEngineFlag) &&
67-
!nodeIsASearchFunctionality(node)
102+
!nodeIsASearchFunctionality(node) &&
103+
!quantityField(node)
68104
);
69105
}
70106

0 commit comments

Comments
 (0)