axe-core 4.10.2 → 4.10.3-canary.06efcde

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/README.md CHANGED
@@ -14,7 +14,7 @@ Axe is an accessibility testing engine for websites and other HTML-based user in
14
14
 
15
15
  ## The Accessibility Rules
16
16
 
17
- Axe-core has different types of rules, for WCAG 2.0, 2.1, 2.2 on level A, AA and AAA as well as a number of best practices that help you identify common accessibility practices like ensuring every page has an `h1` heading, and to help you avoid "gotchas" in ARIA like where an ARIA attribute you used will get ignored. The complete list of rules, grouped WCAG level and best practice, can found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).
17
+ Axe-core has different types of rules, for WCAG 2.0, 2.1, 2.2 on level A, AA and AAA as well as a number of best practices that help you identify common accessibility practices like ensuring every page has an `h1` heading, and to help you avoid "gotchas" in ARIA like where an ARIA attribute you used will get ignored. The complete list of rules, grouped WCAG level and best practice, can be found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).
18
18
 
19
19
  With axe-core, you can find **on average 57% of WCAG issues automatically**. Additionally, axe-core will return elements as "incomplete" where axe-core could not be certain, and manual review is needed.
20
20
 
@@ -65,7 +65,7 @@ Axe was built to reflect how web development actually works. It works with all m
65
65
  - It's actively supported by [Deque Systems](https://www.deque.com), a major accessibility vendor.
66
66
  - It integrates with your existing functional/acceptance automated tests.
67
67
  - It automatically determines which rules to run based on the evaluation context.
68
- - Axe supports in-memory fixtures, static fixtures, integration tests and iframes of infinite depth.
68
+ - Axe supports in-memory fixtures, static fixtures, integration tests, and iframes of infinite depth.
69
69
  - Axe is highly configurable.
70
70
 
71
71
  ## Supported Browsers
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 {