testaro 77.2.0 → 77.2.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/procs/catalog.js +8 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "77.2.0",
3
+ "version": "77.2.1",
4
4
  "description": "Run 1300 web accessibility tests from 10 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/procs/catalog.js CHANGED
@@ -114,7 +114,14 @@ exports.getCatalog = async report => {
114
114
  texts[text] ??= [];
115
115
  texts[text].push(index);
116
116
  }
117
- const domRect = element.getBoundingClientRect();
117
+ // Get its bounding box, but only if the element is painted. Chromium reports
118
+ // plausible nonzero boxes for laid-out but unpainted content (visibility: hidden
119
+ // and content-visibility: hidden subtrees), and such a box disagrees with the
120
+ // page image, overlapping unrelated visible elements.
121
+ const isVisible = typeof element.checkVisibility === 'function'
122
+ ? element.checkVisibility({checkVisibilityCSS: true, visibilityProperty: true})
123
+ : true;
124
+ const domRect = isVisible ? element.getBoundingClientRect() : null;
118
125
  // Get its box ID.
119
126
  const boxID = domRect
120
127
  ? ['x', 'y', 'width', 'height'].map(key => Math.round(domRect[key])).join(':')