stitch2 0.9.0 → 0.9.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/dist/audit.js +11 -0
- package/package.json +1 -1
package/dist/audit.js
CHANGED
|
@@ -149,6 +149,17 @@ export async function audit(opts) {
|
|
|
149
149
|
if (hit)
|
|
150
150
|
push('error', 'fixed-overlap', b, `Overlaps another fixed bar (“${text(a).slice(0, 30)}”): move one clear of the other`);
|
|
151
151
|
}
|
|
152
|
+
// 3c. A fixed bar shows all of itself: a row of it pushed past the bottom (or top) of the screen is unreachable.
|
|
153
|
+
for (const bar of fixedBars)
|
|
154
|
+
for (const e of [bar, ...bar.querySelectorAll('*')]) {
|
|
155
|
+
if (!shown(e) || inSvg(e) || !(ownText(e) || e.matches('svg, img, button, a, input')))
|
|
156
|
+
continue;
|
|
157
|
+
const r = e.getBoundingClientRect();
|
|
158
|
+
if (r.bottom > window.innerHeight + 1 || r.top < -1) {
|
|
159
|
+
push('error', 'overflow', e, 'Part of a fixed bar is cut off by the screen edge: it lays out on more rows than the bar shows');
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
152
163
|
await covered('bottom');
|
|
153
164
|
await covered('top');
|
|
154
165
|
window.scrollTo(0, 0);
|
package/package.json
CHANGED