axe-core 4.7.2-canary.2cc5547 → 4.7.2-canary.4deb0a0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/axe.d.ts +2 -1
- package/axe.js +37 -22
- package/axe.min.js +2 -2
- package/package.json +1 -1
- package/sri-history.json +3 -3
package/axe.d.ts
CHANGED
|
@@ -371,7 +371,8 @@ declare namespace axe {
|
|
|
371
371
|
type AxeReporter<T = unknown> = (
|
|
372
372
|
rawResults: RawResult[],
|
|
373
373
|
option: RunOptions,
|
|
374
|
-
|
|
374
|
+
resolve: (report: T) => void,
|
|
375
|
+
reject: (error: Error) => void
|
|
375
376
|
) => void;
|
|
376
377
|
|
|
377
378
|
interface VirtualNode {
|
package/axe.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! axe v4.7.2-canary.
|
|
1
|
+
/*! axe v4.7.2-canary.4deb0a0
|
|
2
2
|
* Copyright (c) 2015 - 2023 Deque Systems, Inc.
|
|
3
3
|
*
|
|
4
4
|
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}, _typeof(obj);
|
|
23
23
|
}
|
|
24
24
|
var axe = axe || {};
|
|
25
|
-
axe.version = '4.7.2-canary.
|
|
25
|
+
axe.version = '4.7.2-canary.4deb0a0';
|
|
26
26
|
if (typeof define === 'function' && define.amd) {
|
|
27
27
|
define('axe-core', [], function() {
|
|
28
28
|
return axe;
|
|
@@ -11584,10 +11584,9 @@
|
|
|
11584
11584
|
});
|
|
11585
11585
|
});
|
|
11586
11586
|
var canvas = canvasContext.canvas;
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
}
|
|
11590
|
-
var fonts = cache_default.get('fonts');
|
|
11587
|
+
var fonts = cache_default.get('fonts', function() {
|
|
11588
|
+
return {};
|
|
11589
|
+
});
|
|
11591
11590
|
var style = window.getComputedStyle(textVNode.parent.actualNode);
|
|
11592
11591
|
var fontFamily = style.getPropertyValue('font-family');
|
|
11593
11592
|
if (!fonts[fontFamily]) {
|
|
@@ -11610,6 +11609,10 @@
|
|
|
11610
11609
|
canvasContext.font = fontStyle;
|
|
11611
11610
|
var firstChar = nodeValue.charAt(0);
|
|
11612
11611
|
var width = canvasContext.measureText(firstChar).width;
|
|
11612
|
+
if (width === 0) {
|
|
11613
|
+
font.numLigatures++;
|
|
11614
|
+
return true;
|
|
11615
|
+
}
|
|
11613
11616
|
if (width < 30) {
|
|
11614
11617
|
var diff = 30 / width;
|
|
11615
11618
|
width *= diff;
|
|
@@ -26812,27 +26815,32 @@
|
|
|
26812
26815
|
if (options.performanceTimer) {
|
|
26813
26816
|
axe.utils.performanceTimer.start();
|
|
26814
26817
|
}
|
|
26815
|
-
function handleRunRules(rawResults,
|
|
26818
|
+
function handleRunRules(rawResults, teardown2) {
|
|
26816
26819
|
var respond = function respond(results) {
|
|
26817
26820
|
axe._running = false;
|
|
26818
|
-
|
|
26821
|
+
teardown2();
|
|
26819
26822
|
try {
|
|
26820
|
-
|
|
26823
|
+
resolve(results);
|
|
26824
|
+
} catch (e) {
|
|
26825
|
+
axe.log(e);
|
|
26826
|
+
}
|
|
26827
|
+
};
|
|
26828
|
+
var wrappedReject = function wrappedReject(err2) {
|
|
26829
|
+
axe._running = false;
|
|
26830
|
+
teardown2();
|
|
26831
|
+
try {
|
|
26832
|
+
reject(err2);
|
|
26821
26833
|
} catch (e) {
|
|
26822
26834
|
axe.log(e);
|
|
26823
26835
|
}
|
|
26824
|
-
resolve(results);
|
|
26825
26836
|
};
|
|
26826
26837
|
if (options.performanceTimer) {
|
|
26827
26838
|
axe.utils.performanceTimer.end();
|
|
26828
26839
|
}
|
|
26829
26840
|
try {
|
|
26830
|
-
createReport(rawResults, options, respond);
|
|
26841
|
+
createReport(rawResults, options, respond, wrappedReject);
|
|
26831
26842
|
} catch (err2) {
|
|
26832
|
-
|
|
26833
|
-
cleanup3();
|
|
26834
|
-
callback(err2);
|
|
26835
|
-
reject(err2);
|
|
26843
|
+
wrappedReject(err2);
|
|
26836
26844
|
}
|
|
26837
26845
|
}
|
|
26838
26846
|
function errorRunRules(err2) {
|
|
@@ -26840,7 +26848,6 @@
|
|
|
26840
26848
|
axe.utils.performanceTimer.end();
|
|
26841
26849
|
}
|
|
26842
26850
|
axe._running = false;
|
|
26843
|
-
resetGlobals();
|
|
26844
26851
|
callback(err2);
|
|
26845
26852
|
reject(err2);
|
|
26846
26853
|
}
|
|
@@ -26855,7 +26862,12 @@
|
|
|
26855
26862
|
resolve = _resolve;
|
|
26856
26863
|
});
|
|
26857
26864
|
} else {
|
|
26858
|
-
resolve =
|
|
26865
|
+
resolve = function resolve(result) {
|
|
26866
|
+
return callback(null, result);
|
|
26867
|
+
};
|
|
26868
|
+
reject = function reject(err2) {
|
|
26869
|
+
return callback(err2);
|
|
26870
|
+
};
|
|
26859
26871
|
}
|
|
26860
26872
|
return {
|
|
26861
26873
|
thenable: thenable,
|
|
@@ -26863,15 +26875,14 @@
|
|
|
26863
26875
|
resolve: resolve
|
|
26864
26876
|
};
|
|
26865
26877
|
}
|
|
26866
|
-
function createReport(rawResults, options, respond) {
|
|
26878
|
+
function createReport(rawResults, options, respond, reject) {
|
|
26867
26879
|
var reporter = getReporter(options.reporter);
|
|
26868
|
-
var results = reporter(rawResults, options, respond);
|
|
26880
|
+
var results = reporter(rawResults, options, respond, reject);
|
|
26869
26881
|
if (results !== void 0) {
|
|
26870
26882
|
respond(results);
|
|
26871
26883
|
}
|
|
26872
26884
|
}
|
|
26873
26885
|
function handleError(err2, callback) {
|
|
26874
|
-
resetGlobals();
|
|
26875
26886
|
if (typeof callback === 'function' && callback !== noop2) {
|
|
26876
26887
|
callback(err2.message);
|
|
26877
26888
|
return;
|
|
@@ -26983,15 +26994,19 @@
|
|
|
26983
26994
|
});
|
|
26984
26995
|
}
|
|
26985
26996
|
function createReport2(results, options) {
|
|
26986
|
-
return new Promise(function(resolve) {
|
|
26997
|
+
return new Promise(function(resolve, reject) {
|
|
26987
26998
|
var reporter = getReporter(options.reporter);
|
|
26988
|
-
reporter(results, options, resolve);
|
|
26999
|
+
reporter(results, options, resolve, reject);
|
|
26989
27000
|
});
|
|
26990
27001
|
}
|
|
26991
27002
|
function setup(node) {
|
|
26992
27003
|
if (axe._tree) {
|
|
26993
27004
|
throw new Error('Axe is already setup. Call `axe.teardown()` before calling `axe.setup` again.');
|
|
26994
27005
|
}
|
|
27006
|
+
if (node && _typeof(node.documentElement) === 'object' && _typeof(node.defaultView) === 'object') {
|
|
27007
|
+
node = node.documentElement;
|
|
27008
|
+
}
|
|
27009
|
+
setupGlobals(node);
|
|
26995
27010
|
axe._tree = _getFlattenedTree(node);
|
|
26996
27011
|
axe._selectorData = _getSelectorData(axe._tree);
|
|
26997
27012
|
return axe._tree[0];
|