axe-core 4.4.2-canary.1cae5ea → 4.4.2-canary.27031a8

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 CHANGED
@@ -233,6 +233,7 @@ declare namespace axe {
233
233
  none?: string[];
234
234
  tags?: string[];
235
235
  matches?: string;
236
+ reviewOnFail?: boolean;
236
237
  }
237
238
  interface AxePlugin {
238
239
  id: string;
package/axe.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! axe v4.4.2-canary.1cae5ea
1
+ /*! axe v4.4.2-canary.27031a8
2
2
  * Copyright (c) 2022 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.4.2-canary.1cae5ea';
25
+ axe.version = '4.4.2-canary.27031a8';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -82,7 +82,7 @@
82
82
  }
83
83
  }
84
84
  function _setPrototypeOf(o, p) {
85
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
85
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
86
86
  o.__proto__ = p;
87
87
  return o;
88
88
  };
@@ -133,7 +133,7 @@
133
133
  }
134
134
  }
135
135
  function _getPrototypeOf(o) {
136
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
136
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
137
137
  return o.__proto__ || Object.getPrototypeOf(o);
138
138
  };
139
139
  return _getPrototypeOf(o);
@@ -235,7 +235,7 @@
235
235
  }
236
236
  }
237
237
  function _extends() {
238
- _extends = Object.assign || function(target) {
238
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
239
239
  for (var i = 1; i < arguments.length; i++) {
240
240
  var source = arguments[i];
241
241
  for (var key in source) {
@@ -4617,8 +4617,8 @@
4617
4617
  this.buffer._bytes[d] = tmp[i];
4618
4618
  }
4619
4619
  } else {
4620
- for (i = 0, s = array.byteOffset, d = byteOffset; i < byteLength; i += 1, s += 1,
4621
- d += 1) {
4620
+ for (i = 0, s = array.byteOffset, d = byteOffset; i < byteLength; i += 1,
4621
+ s += 1, d += 1) {
4622
4622
  this.buffer._bytes[d] = array.buffer._bytes[s];
4623
4623
  }
4624
4624
  }
@@ -18557,7 +18557,7 @@
18557
18557
  if (_typeof(aValue) !== _typeof(bValue)) {
18558
18558
  return false;
18559
18559
  }
18560
- if (typeof aValue === 'object' || typeof bValue === 'object') {
18560
+ if (_typeof(aValue) === 'object' || _typeof(bValue) === 'object') {
18561
18561
  return isIdenticalObject(aValue, bValue);
18562
18562
  }
18563
18563
  return aValue === bValue;
@@ -19010,11 +19010,27 @@
19010
19010
  });
19011
19011
  }
19012
19012
  var internal_link_present_evaluate_default = internalLinkPresentEvaluate;
19013
+ var separatorRegex = /[;,\s]/;
19014
+ var validRedirectNumRegex = /^[0-9.]+$/;
19013
19015
  function metaRefreshEvaluate(node, options, virtualNode) {
19014
- var content = virtualNode.attr('content') || '', parsedParams = content.split(/[;,]/);
19015
- return content === '' || parsedParams[0] === '0';
19016
+ var _ref83 = options || {}, minDelay = _ref83.minDelay, maxDelay = _ref83.maxDelay;
19017
+ var content = (virtualNode.attr('content') || '').trim();
19018
+ var _content$split = content.split(separatorRegex), _content$split2 = _slicedToArray(_content$split, 1), redirectStr = _content$split2[0];
19019
+ if (!redirectStr.match(validRedirectNumRegex)) {
19020
+ return true;
19021
+ }
19022
+ var redirectDelay = parseFloat(redirectStr);
19023
+ this.data({
19024
+ redirectDelay: redirectDelay
19025
+ });
19026
+ if (typeof minDelay === 'number' && redirectDelay <= options.minDelay) {
19027
+ return true;
19028
+ }
19029
+ if (typeof maxDelay === 'number' && redirectDelay > options.maxDelay) {
19030
+ return true;
19031
+ }
19032
+ return false;
19016
19033
  }
19017
- var meta_refresh_evaluate_default = metaRefreshEvaluate;
19018
19034
  function normalizeFontWeight(weight) {
19019
19035
  switch (weight) {
19020
19036
  case 'lighter':
@@ -19164,8 +19180,8 @@
19164
19180
  } else if (node !== document.body && has_content_default(node, true)) {
19165
19181
  return [ virtualNode ];
19166
19182
  } else {
19167
- return virtualNode.children.filter(function(_ref83) {
19168
- var actualNode = _ref83.actualNode;
19183
+ return virtualNode.children.filter(function(_ref84) {
19184
+ var actualNode = _ref84.actualNode;
19169
19185
  return actualNode.nodeType === 1;
19170
19186
  }).map(function(vNode) {
19171
19187
  return findRegionlessElms(vNode, options);
@@ -19343,8 +19359,8 @@
19343
19359
  if (!virtualNode.children) {
19344
19360
  return void 0;
19345
19361
  }
19346
- var titleNode = virtualNode.children.find(function(_ref84) {
19347
- var props = _ref84.props;
19362
+ var titleNode = virtualNode.children.find(function(_ref85) {
19363
+ var props = _ref85.props;
19348
19364
  return props.nodeName === 'title';
19349
19365
  });
19350
19366
  if (!titleNode) {
@@ -19919,7 +19935,7 @@
19919
19935
  if (!role || [ 'none', 'presentation' ].includes(role)) {
19920
19936
  return true;
19921
19937
  }
19922
- var _ref85 = aria_roles_default[role] || {}, accessibleNameRequired = _ref85.accessibleNameRequired;
19938
+ var _ref86 = aria_roles_default[role] || {}, accessibleNameRequired = _ref86.accessibleNameRequired;
19923
19939
  if (accessibleNameRequired || _isFocusable(virtualNode)) {
19924
19940
  return true;
19925
19941
  }
@@ -19937,6 +19953,11 @@
19937
19953
  return true;
19938
19954
  }
19939
19955
  var no_naming_method_matches_default = noNamingMethodMatches;
19956
+ function noNegativeTabindexMatches(node, virtualNode) {
19957
+ var tabindex = parseInt(virtualNode.attr('tabindex'), 10);
19958
+ return isNaN(tabindex) || tabindex >= 0;
19959
+ }
19960
+ var no_negative_tabindex_matches_default = noNegativeTabindexMatches;
19940
19961
  function noRoleMatches(node) {
19941
19962
  return !node.getAttribute('role');
19942
19963
  }
@@ -20111,7 +20132,7 @@
20111
20132
  'link-in-text-block-matches': link_in_text_block_matches_default,
20112
20133
  'listitem-evaluate': listitemEvaluate,
20113
20134
  'matches-definition-evaluate': matches_definition_evaluate_default,
20114
- 'meta-refresh-evaluate': meta_refresh_evaluate_default,
20135
+ 'meta-refresh-evaluate': metaRefreshEvaluate,
20115
20136
  'meta-viewport-scale-evaluate': meta_viewport_scale_evaluate_default,
20116
20137
  'multiple-label-evaluate': multiple_label_evaluate_default,
20117
20138
  'nested-interactive-matches': nested_interactive_matches_default,
@@ -20122,6 +20143,7 @@
20122
20143
  'no-focusable-content-evaluate': noFocusableContentEvaluate,
20123
20144
  'no-implicit-explicit-label-evaluate': no_implicit_explicit_label_evaluate_default,
20124
20145
  'no-naming-method-matches': no_naming_method_matches_default,
20146
+ 'no-negative-tabindex-matches': no_negative_tabindex_matches_default,
20125
20147
  'no-role-matches': no_role_matches_default,
20126
20148
  'non-empty-if-present-evaluate': non_empty_if_present_evaluate_default,
20127
20149
  'not-html-matches': not_html_matches_default,
@@ -21165,8 +21187,8 @@
21165
21187
  });
21166
21188
  };
21167
21189
  }
21168
- function getHelpUrl(_ref86, ruleId, version) {
21169
- var brand = _ref86.brand, application = _ref86.application, lang = _ref86.lang;
21190
+ function getHelpUrl(_ref87, ruleId, version) {
21191
+ var brand = _ref87.brand, application = _ref87.application, lang = _ref87.lang;
21170
21192
  return constants_default.helpUrlBase + brand + '/' + (version || axe.version.substring(0, axe.version.lastIndexOf('.'))) + '/' + ruleId + '?application=' + encodeURIComponent(application) + (lang && lang !== 'en' ? '&lang=' + encodeURIComponent(lang) : '');
21171
21193
  }
21172
21194
  var audit_default = Audit;
@@ -21581,9 +21603,9 @@
21581
21603
  });
21582
21604
  }
21583
21605
  var run_virtual_rule_default = runVirtualRule;
21584
- function normalizeRunParams(_ref87) {
21585
- var _ref89, _options$reporter, _axe$_audit;
21586
- var _ref88 = _slicedToArray(_ref87, 3), context5 = _ref88[0], options = _ref88[1], callback = _ref88[2];
21606
+ function normalizeRunParams(_ref88) {
21607
+ var _ref90, _options$reporter, _axe$_audit;
21608
+ var _ref89 = _slicedToArray(_ref88, 3), context5 = _ref89[0], options = _ref89[1], callback = _ref89[2];
21587
21609
  var typeErr = new TypeError('axe.run arguments are invalid');
21588
21610
  if (!isContext(context5)) {
21589
21611
  if (callback !== void 0) {
@@ -21604,7 +21626,7 @@
21604
21626
  throw typeErr;
21605
21627
  }
21606
21628
  options = clone_default(options);
21607
- options.reporter = (_ref89 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit = axe._audit) === null || _axe$_audit === void 0 ? void 0 : _axe$_audit.reporter) !== null && _ref89 !== void 0 ? _ref89 : 'v1';
21629
+ options.reporter = (_ref90 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit = axe._audit) === null || _axe$_audit === void 0 ? void 0 : _axe$_audit.reporter) !== null && _ref90 !== void 0 ? _ref90 : 'v1';
21608
21630
  return {
21609
21631
  context: context5,
21610
21632
  options: options,
@@ -21729,14 +21751,14 @@
21729
21751
  return new Promise(function(res, rej) {
21730
21752
  axe._audit.run(contextObj, options, res, rej);
21731
21753
  }).then(function(results) {
21732
- results = results.map(function(_ref90) {
21733
- var nodes = _ref90.nodes, result = _objectWithoutProperties(_ref90, _excluded8);
21754
+ results = results.map(function(_ref91) {
21755
+ var nodes = _ref91.nodes, result = _objectWithoutProperties(_ref91, _excluded8);
21734
21756
  return _extends({
21735
21757
  nodes: nodes.map(serializeNode)
21736
21758
  }, result);
21737
21759
  });
21738
- var frames = contextObj.frames.map(function(_ref91) {
21739
- var node = _ref91.node;
21760
+ var frames = contextObj.frames.map(function(_ref92) {
21761
+ var node = _ref92.node;
21740
21762
  return new dq_element_default(node, options).toJSON();
21741
21763
  });
21742
21764
  var environmentData;
@@ -21756,13 +21778,13 @@
21756
21778
  return Promise.reject(err2);
21757
21779
  });
21758
21780
  }
21759
- function serializeNode(_ref92) {
21760
- var node = _ref92.node, nodeResult = _objectWithoutProperties(_ref92, _excluded9);
21781
+ function serializeNode(_ref93) {
21782
+ var node = _ref93.node, nodeResult = _objectWithoutProperties(_ref93, _excluded9);
21761
21783
  nodeResult.node = node.toJSON();
21762
21784
  for (var _i32 = 0, _arr2 = [ 'any', 'all', 'none' ]; _i32 < _arr2.length; _i32++) {
21763
21785
  var type = _arr2[_i32];
21764
- nodeResult[type] = nodeResult[type].map(function(_ref93) {
21765
- var relatedNodes = _ref93.relatedNodes, checkResult = _objectWithoutProperties(_ref93, _excluded10);
21786
+ nodeResult[type] = nodeResult[type].map(function(_ref94) {
21787
+ var relatedNodes = _ref94.relatedNodes, checkResult = _objectWithoutProperties(_ref94, _excluded10);
21766
21788
  return _extends({}, checkResult, {
21767
21789
  relatedNodes: relatedNodes.map(function(node2) {
21768
21790
  return node2.toJSON();
@@ -21773,14 +21795,14 @@
21773
21795
  return nodeResult;
21774
21796
  }
21775
21797
  function finishRun(partialResults) {
21776
- var _ref95, _options$reporter2, _axe$_audit2;
21798
+ var _ref96, _options$reporter2, _axe$_audit2;
21777
21799
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
21778
21800
  options = clone_default(options);
21779
- var _ref94 = partialResults.find(function(r) {
21801
+ var _ref95 = partialResults.find(function(r) {
21780
21802
  return r.environmentData;
21781
- }) || {}, environmentData = _ref94.environmentData;
21803
+ }) || {}, environmentData = _ref95.environmentData;
21782
21804
  axe._audit.normalizeOptions(options);
21783
- options.reporter = (_ref95 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref95 !== void 0 ? _ref95 : 'v1';
21805
+ options.reporter = (_ref96 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref96 !== void 0 ? _ref96 : 'v1';
21784
21806
  setFrameSpec(partialResults);
21785
21807
  var results = merge_results_default(partialResults);
21786
21808
  results = axe._audit.after(results, options);
@@ -21810,8 +21832,8 @@
21810
21832
  _iterator4.f();
21811
21833
  }
21812
21834
  }
21813
- function getMergedFrameSpecs(_ref96) {
21814
- var childFrameSpecs = _ref96.frames, parentFrameSpec = _ref96.frameSpec;
21835
+ function getMergedFrameSpecs(_ref97) {
21836
+ var childFrameSpecs = _ref97.frames, parentFrameSpec = _ref97.frameSpec;
21815
21837
  if (!parentFrameSpec) {
21816
21838
  return childFrameSpecs;
21817
21839
  }
@@ -21874,9 +21896,9 @@
21874
21896
  for (var _i33 = 0, _types = types; _i33 < _types.length; _i33++) {
21875
21897
  var type = _types[_i33];
21876
21898
  if (transformedResult[type] && Array.isArray(transformedResult[type])) {
21877
- transformedResult[type] = transformedResult[type].map(function(_ref97) {
21899
+ transformedResult[type] = transformedResult[type].map(function(_ref98) {
21878
21900
  var _node;
21879
- var node = _ref97.node, typeResult = _objectWithoutProperties(_ref97, _excluded13);
21901
+ var node = _ref98.node, typeResult = _objectWithoutProperties(_ref98, _excluded13);
21880
21902
  node = typeof ((_node = node) === null || _node === void 0 ? void 0 : _node.toJSON) === 'function' ? node.toJSON() : node;
21881
21903
  return _extends({
21882
21904
  node: node
@@ -22279,9 +22301,13 @@
22279
22301
  description: 'Ensures <marquee> elements are not used',
22280
22302
  help: '<marquee> elements are deprecated and must not be used'
22281
22303
  },
22304
+ 'meta-refresh-no-exceptions': {
22305
+ description: 'Ensures <meta http-equiv="refresh"> is not used for delayed refresh',
22306
+ help: 'Delayed refresh must not be used'
22307
+ },
22282
22308
  'meta-refresh': {
22283
- description: 'Ensures <meta http-equiv="refresh"> is not used',
22284
- help: 'Timed refresh must not exist'
22309
+ description: 'Ensures <meta http-equiv="refresh"> is not used for delayed refresh',
22310
+ help: 'Delayed refresh under 20 hours must not be used'
22285
22311
  },
22286
22312
  'meta-viewport-large': {
22287
22313
  description: 'Ensures <meta name="viewport"> can scale a significant amount',
@@ -23032,11 +23058,18 @@
23032
23058
  fail: 'Page does not have a landmark region'
23033
23059
  }
23034
23060
  },
23061
+ 'meta-refresh-no-exceptions': {
23062
+ impact: 'minor',
23063
+ messages: {
23064
+ pass: '<meta> tag does not immediately refresh the page',
23065
+ fail: '<meta> tag forces timed refresh of page'
23066
+ }
23067
+ },
23035
23068
  'meta-refresh': {
23036
23069
  impact: 'critical',
23037
23070
  messages: {
23038
23071
  pass: '<meta> tag does not immediately refresh the page',
23039
- fail: '<meta> tag forces timed refresh of page'
23072
+ fail: '<meta> tag forces timed refresh of page (less than 20 hours)'
23040
23073
  }
23041
23074
  },
23042
23075
  'p-as-heading': {
@@ -23896,7 +23929,8 @@
23896
23929
  }, {
23897
23930
  id: 'frame-title',
23898
23931
  selector: 'frame, iframe',
23899
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag241', 'wcag412', 'section508', 'section508.22.i' ],
23932
+ matches: 'no-negative-tabindex-matches',
23933
+ tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'section508', 'section508.22.i' ],
23900
23934
  actIds: [ 'cae760' ],
23901
23935
  all: [],
23902
23936
  any: [ {
@@ -24208,14 +24242,36 @@
24208
24242
  all: [],
24209
24243
  any: [],
24210
24244
  none: [ 'is-on-screen' ]
24245
+ }, {
24246
+ id: 'meta-refresh-no-exceptions',
24247
+ selector: 'meta[http-equiv="refresh"][content]',
24248
+ excludeHidden: false,
24249
+ enabled: false,
24250
+ tags: [ 'cat.time-and-media', 'wcag2aaa', 'wcag224', 'wcag325' ],
24251
+ actIds: [ 'bisz58' ],
24252
+ all: [],
24253
+ any: [ {
24254
+ options: {
24255
+ minDelay: 0,
24256
+ maxDelay: false
24257
+ },
24258
+ id: 'meta-refresh-no-exceptions'
24259
+ } ],
24260
+ none: []
24211
24261
  }, {
24212
24262
  id: 'meta-refresh',
24213
- selector: 'meta[http-equiv="refresh"]',
24263
+ selector: 'meta[http-equiv="refresh"][content]',
24214
24264
  excludeHidden: false,
24215
24265
  tags: [ 'cat.time-and-media', 'wcag2a', 'wcag221', 'wcag224', 'wcag325' ],
24216
24266
  actIds: [ 'bc659a' ],
24217
24267
  all: [],
24218
- any: [ 'meta-refresh' ],
24268
+ any: [ {
24269
+ options: {
24270
+ minDelay: 0,
24271
+ maxDelay: 72e3
24272
+ },
24273
+ id: 'meta-refresh'
24274
+ } ],
24219
24275
  none: []
24220
24276
  }, {
24221
24277
  id: 'meta-viewport-large',
@@ -24842,9 +24898,20 @@
24842
24898
  options: {
24843
24899
  selector: 'main, [role=main]'
24844
24900
  }
24901
+ }, {
24902
+ id: 'meta-refresh-no-exceptions',
24903
+ evaluate: 'meta-refresh-evaluate',
24904
+ options: {
24905
+ minDelay: 0,
24906
+ maxDelay: false
24907
+ }
24845
24908
  }, {
24846
24909
  id: 'meta-refresh',
24847
- evaluate: 'meta-refresh-evaluate'
24910
+ evaluate: 'meta-refresh-evaluate',
24911
+ options: {
24912
+ minDelay: 0,
24913
+ maxDelay: 72e3
24914
+ }
24848
24915
  }, {
24849
24916
  id: 'p-as-heading',
24850
24917
  evaluate: 'p-as-heading-evaluate',