axe-core 4.3.5-canary.2ad92f6 → 4.3.5-canary.2ca9fef

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.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! axe v4.3.5-canary.2ad92f6
2
- * Copyright (c) 2021 Deque Systems, Inc.
1
+ /*! axe v4.3.5-canary.2ca9fef
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
5
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -15,19 +15,14 @@
15
15
  'use strict';
16
16
  function _typeof(obj) {
17
17
  '@babel/helpers - typeof';
18
- if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
19
- _typeof = function _typeof(obj) {
20
- return typeof obj;
21
- };
22
- } else {
23
- _typeof = function _typeof(obj) {
24
- return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
25
- };
26
- }
27
- return _typeof(obj);
18
+ return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) {
19
+ return typeof obj;
20
+ } : function(obj) {
21
+ return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
22
+ }, _typeof(obj);
28
23
  }
29
24
  var axe = axe || {};
30
- axe.version = '4.3.5-canary.2ad92f6';
25
+ axe.version = '4.3.5-canary.2ca9fef';
31
26
  if (typeof define === 'function' && define.amd) {
32
27
  define('axe-core', [], function() {
33
28
  return axe;
@@ -79,6 +74,9 @@
79
74
  configurable: true
80
75
  }
81
76
  });
77
+ Object.defineProperty(subClass, 'prototype', {
78
+ writable: false
79
+ });
82
80
  if (superClass) {
83
81
  _setPrototypeOf(subClass, superClass);
84
82
  }
@@ -106,6 +104,8 @@
106
104
  function _possibleConstructorReturn(self, call) {
107
105
  if (call && (_typeof(call) === 'object' || typeof call === 'function')) {
108
106
  return call;
107
+ } else if (call !== void 0) {
108
+ throw new TypeError('Derived constructors may only return object or undefined');
109
109
  }
110
110
  return _assertThisInitialized(self);
111
111
  }
@@ -271,6 +271,9 @@
271
271
  if (staticProps) {
272
272
  _defineProperties(Constructor, staticProps);
273
273
  }
274
+ Object.defineProperty(Constructor, 'prototype', {
275
+ writable: false
276
+ });
274
277
  return Constructor;
275
278
  }
276
279
  function _createForOfIteratorHelper(o, allowArrayLike) {
@@ -359,16 +362,11 @@
359
362
  }
360
363
  function _typeof(obj) {
361
364
  '@babel/helpers - typeof';
362
- if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
363
- _typeof = function _typeof(obj) {
364
- return typeof obj;
365
- };
366
- } else {
367
- _typeof = function _typeof(obj) {
368
- return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
369
- };
370
- }
371
- return _typeof(obj);
365
+ return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) {
366
+ return typeof obj;
367
+ } : function(obj) {
368
+ return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
369
+ }, _typeof(obj);
372
370
  }
373
371
  (function() {
374
372
  var __create = Object.create;
@@ -5002,7 +5000,7 @@
5002
5000
  return _collectResultsFromFrames;
5003
5001
  },
5004
5002
  contains: function contains() {
5005
- return contains_default;
5003
+ return _contains;
5006
5004
  },
5007
5005
  convertSelector: function convertSelector() {
5008
5006
  return _convertSelector;
@@ -6952,33 +6950,30 @@
6952
6950
  resolve(merge_results_default(data2, options));
6953
6951
  })['catch'](reject);
6954
6952
  }
6955
- function contains(vNode, otherVNode) {
6956
- function containsShadowChild(vNode2, otherVNode2) {
6957
- if (vNode2.shadowId === otherVNode2.shadowId) {
6958
- return true;
6959
- }
6960
- return !!vNode2.children.find(function(child) {
6961
- return containsShadowChild(child, otherVNode2);
6962
- });
6963
- }
6953
+ function _contains(vNode, otherVNode) {
6964
6954
  if (vNode.shadowId || otherVNode.shadowId) {
6965
- return containsShadowChild(vNode, otherVNode);
6955
+ do {
6956
+ if (vNode.shadowId === otherVNode.shadowId) {
6957
+ return true;
6958
+ }
6959
+ otherVNode = otherVNode.parent;
6960
+ } while (otherVNode);
6961
+ return false;
6966
6962
  }
6967
- if (vNode.actualNode) {
6968
- if (typeof vNode.actualNode.contains === 'function') {
6969
- return vNode.actualNode.contains(otherVNode.actualNode);
6970
- }
6971
- return !!(vNode.actualNode.compareDocumentPosition(otherVNode.actualNode) & 16);
6972
- } else {
6963
+ if (!vNode.actualNode) {
6973
6964
  do {
6974
6965
  if (otherVNode === vNode) {
6975
6966
  return true;
6976
6967
  }
6977
- } while (otherVNode = otherVNode && otherVNode.parent);
6968
+ otherVNode = otherVNode.parent;
6969
+ } while (otherVNode);
6978
6970
  }
6979
- return false;
6971
+ if (typeof vNode.actualNode.contains !== 'function') {
6972
+ var position = vNode.actualNode.compareDocumentPosition(otherVNode.actualNode);
6973
+ return !!(position & 16);
6974
+ }
6975
+ return vNode.actualNode.contains(otherVNode.actualNode);
6980
6976
  }
6981
- var contains_default = contains;
6982
6977
  function deepMerge() {
6983
6978
  var target = {};
6984
6979
  for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -11225,7 +11220,7 @@
11225
11220
  var is_html_element_default = isHtmlElement;
11226
11221
  function getDeepest(collection) {
11227
11222
  return collection.sort(function(a, b) {
11228
- if (contains_default(a, b)) {
11223
+ if (_contains(a, b)) {
11229
11224
  return 1;
11230
11225
  }
11231
11226
  return -1;
@@ -11233,12 +11228,12 @@
11233
11228
  }
11234
11229
  function isNodeInContext(node, context5) {
11235
11230
  var include = context5.include && getDeepest(context5.include.filter(function(candidate) {
11236
- return contains_default(candidate, node);
11231
+ return _contains(candidate, node);
11237
11232
  }));
11238
11233
  var exclude = context5.exclude && getDeepest(context5.exclude.filter(function(candidate) {
11239
- return contains_default(candidate, node);
11234
+ return _contains(candidate, node);
11240
11235
  }));
11241
- if (!exclude && include || exclude && contains_default(exclude, include)) {
11236
+ if (!exclude && include || exclude && _contains(exclude, include)) {
11242
11237
  return true;
11243
11238
  }
11244
11239
  return false;
@@ -12137,9 +12132,9 @@
12137
12132
  }
12138
12133
  return result;
12139
12134
  }
12140
- function reduceIncludes(includes) {
12135
+ function getOuterIncludes(includes) {
12141
12136
  return includes.reduce(function(res, el) {
12142
- if (!res.length || !contains_default(res[res.length - 1], el)) {
12137
+ if (!res.length || !_contains(res[res.length - 1], el)) {
12143
12138
  res.push(el);
12144
12139
  }
12145
12140
  return res;
@@ -12156,15 +12151,12 @@
12156
12151
  }
12157
12152
  }
12158
12153
  }
12159
- var curried = function(context6) {
12160
- return function(node) {
12161
- return is_node_in_context_default(node, context6);
12162
- };
12163
- }(context5);
12164
- var reducedIncludes = reduceIncludes(context5.include);
12165
- for (var _i10 = 0; _i10 < reducedIncludes.length; _i10++) {
12166
- candidate = reducedIncludes[_i10];
12167
- result = pushNode(result, query_selector_all_filter_default(candidate, selector, curried));
12154
+ var outerIncludes = getOuterIncludes(context5.include);
12155
+ var isInContext = getContextFilter(context5);
12156
+ for (var _i10 = 0; _i10 < outerIncludes.length; _i10++) {
12157
+ candidate = outerIncludes[_i10];
12158
+ var nodes = query_selector_all_filter_default(candidate, selector, isInContext);
12159
+ result = pushNode(result, nodes);
12168
12160
  }
12169
12161
  if (axe._selectCache) {
12170
12162
  axe._selectCache.push({
@@ -12175,6 +12167,14 @@
12175
12167
  return result;
12176
12168
  }
12177
12169
  var select_default = select;
12170
+ function getContextFilter(context5) {
12171
+ if (!context5.exclude || context5.exclude.length === 0) {
12172
+ return null;
12173
+ }
12174
+ return function(node) {
12175
+ return is_node_in_context_default(node, context5);
12176
+ };
12177
+ }
12178
12178
  function setScroll(elm, top, left) {
12179
12179
  if (elm === window) {
12180
12180
  return elm.scroll(left, top);