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.
package/config/project.config.js
CHANGED
|
@@ -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
|
-
|
|
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