pour-engine 1.31.0 → 1.31.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.
@@ -6,6 +6,6 @@
6
6
  export default {
7
7
  engine: {
8
8
  name: 'pour engine',
9
- version: '1.31.0',
9
+ version: '1.31.1',
10
10
  },
11
11
  };
@@ -211,7 +211,26 @@ export function createTargetSizeRule({ id, tags, help, helpUrl, min, spacingExce
211
211
  // usually) belongs to the name rules, not to size judgment. Pointer-
212
212
  // invisible targets (clipped skip links etc.) are excluded the same
213
213
  // way, on both sides of the crowding test.
214
- const laidOut = rects.map((r, i) => r.width > 0 && r.height > 0 && !isHiddenFromPointer(elements[i], r));
214
+ //
215
+ // Content-visibility-skipped subtrees have PLACEHOLDER geometry, not
216
+ // geometry: an offscreen article under content-visibility:auto skips
217
+ // layout, its 40×40 icon buttons measure 12×12 and stack on top of each
218
+ // other, and the rule read that as "tiny AND crowded" (measured live on
219
+ // a long-feed blog home: the same button is 40×40 the moment it scrolls
220
+ // into view). The browser itself knows the difference — checkVisibility
221
+ // with contentVisibilityAuto reports skipped subtrees as not visible —
222
+ // so those targets are unmeasurable in this state and sit out of the
223
+ // judgment AND the crowding field. Engines that don't recognise the
224
+ // option ignore unknown keys and behave as before.
225
+ const layoutSkipped = (element) => {
226
+ try {
227
+ return typeof element.checkVisibility === 'function'
228
+ && element.checkVisibility({ visibilityProperty: true })
229
+ && !element.checkVisibility({ contentVisibilityAuto: true, visibilityProperty: true });
230
+ } catch { return false; }
231
+ };
232
+ const laidOut = rects.map((r, i) =>
233
+ r.width > 0 && r.height > 0 && !isHiddenFromPointer(elements[i], r) && !layoutSkipped(elements[i]));
215
234
  const undersized = rects.map((r, i) => laidOut[i] && (r.width < min || r.height < min));
216
235
  // One rect fully inside another is one control drawn twice (stretched-
217
236
  // link cards, overlay + inner button) — not two targets crowding.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pour-engine",
3
- "version": "1.31.0",
3
+ "version": "1.31.1",
4
4
  "description": "Accessibility (WCAG 2.2) audit engine written from the W3C specifications — runs entirely in the browser, no dependencies.",
5
5
  "type": "module",
6
6
  "main": "engine/index.js",