diff --git a/internal/check-fits-the-screen.mjs b/internal/check-fits-the-screen.mjs index 8d0fec4cd..d13b5f873 100644 --- a/internal/check-fits-the-screen.mjs +++ b/internal/check-fits-the-screen.mjs @@ -396,10 +396,29 @@ async function runResponsiveSweep(url, label) { // Elements clipped to zero height: anything with real content but 0 rendered height. // Exempt .rd-td/.rd-th (text-overflow:ellipsis is EXPECTED there — the brief's own carve-out) // and anything with zero content (legitimately-empty containers are not a clipping defect). + // ★ MAPBOX INTERNALS ARE EXEMPT TOO (added 2026-09-23, after the first real verdict). + // On its first run this clause failed on ALL EIGHT viewport/target combinations with + // docOverflow=0 and the SAME two elements every time: mapboxgl-canvas-container and + // mapboxgl-control-container. Both are GL-JS's own wrappers, legitimately zero-height with + // children — the canvas container collapses because the canvas is absolutely positioned, and + // the control container is an empty positioning shell. Neither is a layout defect. + // + // That was 8 of this gate's 12 failures on its first verdict: a false signal loud enough to + // drown the ONE real finding (clause B, a wheel below the map scrolling nothing). A gate that + // reports four-fifths noise teaches its reader to skim the summary line, which is the same + // failure this file was written to end — so the exemption is a correctness fix, not a + // convenience. + // + // Scoped by PREFIX rather than an exact class list, because GL-JS composes these as + // multi-class strings ("mapboxgl-canvas-container mapboxgl-interactive") and adds more of + // them across versions. Kept NARROW to mapboxgl-/maplibregl- so it cannot silently swallow a + // real defect in our own markup. + const VENDOR_ZERO_HEIGHT = /(^|\s)(mapboxgl|maplibregl)-/; const all = __walk('*'); const clipped = []; for (const el of all) { if (el.classList && (el.classList.contains('rd-td') || el.classList.contains('rd-th'))) continue; + if (el.className && VENDOR_ZERO_HEIGHT.test(String(el.className))) continue; const r = el.getBoundingClientRect(); const hasText = (el.textContent || '').trim().length > 0; const hasOwnChildren = el.children && el.children.length > 0;