axe-core 4.10.2 → 4.10.3-canary.01c2c02

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,42 @@ declare namespace axe {
405
408
  boundingClientRect: DOMRect;
406
409
  }
407
410
 
411
+ type GridCell = VirtualNode[];
412
+
413
+ interface Grid {
414
+ container: VirtualNode | null;
415
+ cells: unknown; // opaque implementation detail
416
+ boundaries?: DOMRect;
417
+ toGridIndex(num: number): number;
418
+ getCellFromPoint(point: { x: number; y: number }): GridCell;
419
+ loopGridPosition(
420
+ gridPosition: DOMRect,
421
+ callback: (gridCell: GridCell, pos: { row: number; col: number }) => void
422
+ ): void;
423
+ getGridPositionOfRect(
424
+ rect: { top: number; right: number; bottom: number; left: number },
425
+ margin?: number
426
+ ): DOMRect;
427
+ }
428
+
429
+ interface CustomNodeSerializer<T = SerialDqElement> {
430
+ toSpec: (dqElm: DqElement) => T;
431
+ mergeSpecs: (nodeSpec: T, parentFrameSpec: T) => T;
432
+ }
433
+
434
+ interface NodeSerializer {
435
+ update: <T>(serializer: CustomNodeSerializer<T>) => void;
436
+ toSpec: (node: Element | VirtualNode) => SerialDqElement;
437
+ dqElmToSpec: (
438
+ dqElm: DqElement | SerialDqElement,
439
+ options?: RunOptions
440
+ ) => SerialDqElement;
441
+ mergeSpecs: (
442
+ nodeSpec: SerialDqElement,
443
+ parentFrameSpec: SerialDqElement
444
+ ) => SerialDqElement;
445
+ }
446
+
408
447
  interface Utils {
409
448
  getFrameContexts: (
410
449
  context?: ElementContext,
@@ -423,15 +462,13 @@ declare namespace axe {
423
462
  selector: unknown
424
463
  ) => selector is LabelledShadowDomSelector;
425
464
 
426
- DqElement: new (
427
- elm: Element,
428
- options?: { absolutePaths?: boolean }
429
- ) => DqElement;
465
+ DqElement: DqElementConstructor;
430
466
  uuid: (
431
467
  options?: { random?: Uint8Array | Array<number> },
432
468
  buf?: Uint8Array | Array<number>,
433
469
  offset?: number
434
470
  ) => string | Uint8Array | Array<number>;
471
+ nodeSerializer: NodeSerializer;
435
472
  }
436
473
 
437
474
  interface Aria {
@@ -441,6 +478,7 @@ declare namespace axe {
441
478
  interface Dom {
442
479
  isFocusable: (node: Element | VirtualNode) => boolean;
443
480
  isNativelyFocusable: (node: Element | VirtualNode) => boolean;
481
+ getNodeGrid: (node: Node | VirtualNode) => Grid;
444
482
  }
445
483
 
446
484
  type AccessibleTextOptions = {