axe-core 4.10.3-canary.d7dfebc → 4.10.3-canary.e1a47d0

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,4 +1,4 @@
1
- /*! axe v4.10.3-canary.d7dfebc
1
+ /*! axe v4.10.3-canary.e1a47d0
2
2
  * Copyright (c) 2015 - 2025 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(o);
23
23
  }
24
24
  var axe = axe || {};
25
- axe.version = '4.10.3-canary.d7dfebc';
25
+ axe.version = '4.10.3-canary.e1a47d0';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -18302,78 +18302,70 @@
18302
18302
  return tree;
18303
18303
  }
18304
18304
  function getSlotChildren(node) {
18305
- var retVal = [];
18305
+ var childNodes = [];
18306
18306
  node = node.firstChild;
18307
18307
  while (node) {
18308
- retVal.push(node);
18308
+ childNodes.push(node);
18309
18309
  node = node.nextSibling;
18310
18310
  }
18311
- return retVal;
18311
+ return childNodes;
18312
18312
  }
18313
18313
  function createNode(node, parent, shadowId) {
18314
18314
  var vNode = new virtual_node_default(node, parent, shadowId);
18315
18315
  cacheNodeSelectors(vNode, cache_default.get('selectorMap'));
18316
18316
  return vNode;
18317
18317
  }
18318
- function flattenTree(node, shadowId, parent) {
18319
- var retVal, realArray;
18320
- function reduceShadowDOM(res, child, parentVNode) {
18321
- var replacements = flattenTree(child, shadowId, parentVNode);
18322
- if (replacements) {
18323
- res = res.concat(replacements);
18318
+ function createChildren(childNodes, parent, shadowId) {
18319
+ var children = [];
18320
+ childNodes.forEach(function(childNode) {
18321
+ var child = flattenTree(childNode, shadowId, parent);
18322
+ if (child) {
18323
+ children.push.apply(children, _toConsumableArray(child));
18324
18324
  }
18325
- return res;
18326
- }
18325
+ });
18326
+ return children;
18327
+ }
18328
+ function flattenTree(node, shadowId, parent) {
18329
+ var vNode, childNodes;
18327
18330
  if (node.documentElement) {
18328
18331
  node = node.documentElement;
18329
18332
  }
18330
18333
  var nodeName2 = node.nodeName.toLowerCase();
18331
18334
  if (is_shadow_root_default(node)) {
18332
18335
  hasShadowRoot = true;
18333
- retVal = createNode(node, parent, shadowId);
18336
+ vNode = createNode(node, parent, shadowId);
18334
18337
  shadowId = 'a' + Math.random().toString().substring(2);
18335
- realArray = Array.from(node.shadowRoot.childNodes);
18336
- retVal.children = realArray.reduce(function(res, child) {
18337
- return reduceShadowDOM(res, child, retVal);
18338
- }, []);
18339
- return [ retVal ];
18340
- } else {
18341
- if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') {
18342
- realArray = Array.from(node.getDistributedNodes());
18343
- return realArray.reduce(function(res, child) {
18344
- return reduceShadowDOM(res, child, parent);
18345
- }, []);
18346
- } else if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') {
18347
- realArray = Array.from(node.assignedNodes());
18348
- if (!realArray.length) {
18349
- realArray = getSlotChildren(node);
18350
- }
18351
- var styl = window.getComputedStyle(node);
18352
- if (false) {
18353
- retVal = createNode(node, parent, shadowId);
18354
- retVal.children = realArray.reduce(function(res, child) {
18355
- return reduceShadowDOM(res, child, retVal);
18356
- }, []);
18357
- return [ retVal ];
18358
- } else {
18359
- return realArray.reduce(function(res, child) {
18360
- return reduceShadowDOM(res, child, parent);
18361
- }, []);
18362
- }
18363
- } else {
18364
- if (node.nodeType === 1) {
18365
- retVal = createNode(node, parent, shadowId);
18366
- realArray = Array.from(node.childNodes);
18367
- retVal.children = realArray.reduce(function(res, child) {
18368
- return reduceShadowDOM(res, child, retVal);
18369
- }, []);
18370
- return [ retVal ];
18371
- } else if (node.nodeType === 3) {
18372
- return [ createNode(node, parent) ];
18373
- }
18374
- return void 0;
18338
+ childNodes = Array.from(node.shadowRoot.childNodes);
18339
+ vNode.children = createChildren(childNodes, vNode, shadowId);
18340
+ return [ vNode ];
18341
+ }
18342
+ if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') {
18343
+ childNodes = Array.from(node.getDistributedNodes());
18344
+ return createChildren(childNodes, parent, shadowId);
18345
+ }
18346
+ if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') {
18347
+ childNodes = Array.from(node.assignedNodes());
18348
+ if (!childNodes.length) {
18349
+ childNodes = getSlotChildren(node);
18350
+ }
18351
+ var styl = window.getComputedStyle(node);
18352
+ if (false) {
18353
+ vNode = createNode(node, parent, shadowId);
18354
+ vNode.children = createChildren(childNodes, vNode, shadowId);
18355
+ return [ vNode ];
18375
18356
  }
18357
+ return createChildren(childNodes, parent, shadowId);
18376
18358
  }
18359
+ if (node.nodeType === document.ELEMENT_NODE) {
18360
+ vNode = createNode(node, parent, shadowId);
18361
+ childNodes = Array.from(node.childNodes);
18362
+ vNode.children = createChildren(childNodes, vNode, shadowId);
18363
+ return [ vNode ];
18364
+ }
18365
+ if (node.nodeType === document.TEXT_NODE) {
18366
+ return [ createNode(node, parent) ];
18367
+ }
18368
+ return void 0;
18377
18369
  }
18378
18370
  function getBaseLang(lang) {
18379
18371
  if (!lang) {
@@ -19253,7 +19245,11 @@
19253
19245
  if (!((_window$performance2 = window.performance) !== null && _window$performance2 !== void 0 && _window$performance2.measure)) {
19254
19246
  return;
19255
19247
  }
19256
- window.performance.measure(measureName, startMark, endMark);
19248
+ try {
19249
+ window.performance.measure(measureName, startMark, endMark);
19250
+ } catch (e) {
19251
+ this._log(e);
19252
+ }
19257
19253
  if (!keepMarks) {
19258
19254
  this.clearMark(startMark, endMark);
19259
19255
  }