axe-core 4.10.1 → 4.10.2-canary.d260ea8

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
@@ -342,6 +342,9 @@ declare namespace axe {
342
342
  interface DqElement extends SerialDqElement {
343
343
  element: Element;
344
344
  toJSON(): SerialDqElement;
345
+ }
346
+ interface DqElementConstructor {
347
+ new (elm: Element, options?: { absolutePaths?: boolean }): DqElement;
345
348
  mergeSpecs(
346
349
  childSpec: SerialDqElement,
347
350
  parentSpec: SerialDqElement
@@ -405,6 +408,24 @@ declare namespace axe {
405
408
  boundingClientRect: DOMRect;
406
409
  }
407
410
 
411
+ interface CustomNodeSerializer<T = SerialDqElement> {
412
+ toSpec: (dqElm: DqElement) => T;
413
+ mergeSpecs: (nodeSpec: T, parentFrameSpec: T) => T;
414
+ }
415
+
416
+ interface NodeSerializer {
417
+ update: <T>(serializer: CustomNodeSerializer<T>) => void;
418
+ toSpec: (node: Element | VirtualNode) => SerialDqElement;
419
+ dqElmToSpec: (
420
+ dqElm: DqElement | SerialDqElement,
421
+ options?: RunOptions
422
+ ) => SerialDqElement;
423
+ mergeSpecs: (
424
+ nodeSpec: SerialDqElement,
425
+ parentFrameSpec: SerialDqElement
426
+ ) => SerialDqElement;
427
+ }
428
+
408
429
  interface Utils {
409
430
  getFrameContexts: (
410
431
  context?: ElementContext,
@@ -423,15 +444,13 @@ declare namespace axe {
423
444
  selector: unknown
424
445
  ) => selector is LabelledShadowDomSelector;
425
446
 
426
- DqElement: new (
427
- elm: Element,
428
- options?: { absolutePaths?: boolean }
429
- ) => DqElement;
447
+ DqElement: DqElementConstructor;
430
448
  uuid: (
431
449
  options?: { random?: Uint8Array | Array<number> },
432
450
  buf?: Uint8Array | Array<number>,
433
451
  offset?: number
434
452
  ) => string | Uint8Array | Array<number>;
453
+ nodeSerializer: NodeSerializer;
435
454
  }
436
455
 
437
456
  interface Aria {
package/axe.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! axe v4.10.1
1
+ /*! axe v4.10.2-canary.d260ea8
2
2
  * Copyright (c) 2015 - 2024 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.1';
25
+ axe.version = '4.10.2-canary.d260ea8';
26
26
  if (typeof define === 'function' && define.amd) {
27
27
  define('axe-core', [], function() {
28
28
  return axe;
@@ -7625,7 +7625,7 @@
7625
7625
  var parentElement = node.parentElement;
7626
7626
  var parentNode = node.parentNode;
7627
7627
  var nthChild = '';
7628
- if (nodeName2 !== 'head' && nodeName2 !== 'body' && parentNode.children.length > 1) {
7628
+ if (nodeName2 !== 'head' && nodeName2 !== 'body' && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.children.length) > 1) {
7629
7629
  var index = Array.prototype.indexOf.call(parentNode.children, node) + 1;
7630
7630
  nthChild = ':nth-child('.concat(index, ')');
7631
7631
  }
@@ -27836,16 +27836,18 @@
27836
27836
  });
27837
27837
  });
27838
27838
  });
27839
- q.defer(function(res) {
27840
- return setTimeout(res, 0);
27841
- });
27842
- if (options.performanceTimer) {
27843
- this._logRulePerformance();
27844
- }
27845
27839
  q.then(function() {
27846
- return resolve(ruleResult);
27840
+ if (options.performanceTimer) {
27841
+ _this9._logRulePerformance();
27842
+ }
27843
+ setTimeout(function() {
27844
+ resolve(ruleResult);
27845
+ }, 0);
27847
27846
  })['catch'](function(error) {
27848
- return reject(error);
27847
+ if (options.performanceTimer) {
27848
+ _this9._logRulePerformance();
27849
+ }
27850
+ reject(error);
27849
27851
  });
27850
27852
  };
27851
27853
  Rule.prototype.runSync = function runSync2(context) {