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.
- package/package.json +1 -1
- package/procs/catalog.js +8 -1
package/package.json
CHANGED
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
|
-
|
|
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(':')
|