calendar
All repositories: gitoria
4.8 KB
// tests/mobile-measure.js — THE PHONE MEASUREMENT of one page (tickets mission 022, from gitoria's), evaluated inside the page by// tests/e2e-theme.mjs (real Chrome) . Set `window.__W` (the phone width, 390) before; returns one object:// docScrollWidth the page's width (must be ≤ __W: no sideways scroll — innerWidth is NOT used, a mobile viewport grows with the page)// taps / tapsSmall interactive elements (a[href], button, summary, fields) and those under 44×44 px. Exempt (WCAG 2.5.8 "inline"):// a link that flows inside a sentence (display inline, its parent has more text than the link)// inputsSmall visible fields with a font under 16 px (iOS zooms into them on focus)// textSmall visible elements whose own text is under 14 px// headerH the application header's height// boxesOver code / table boxes (pre, markdown tables) that reach past the screen edge// wide visible elements wider than the screen (not inside a box that scrolls sideways itself)(() => {const W = window.__W || 390;const sel = (e) => { let s = e.tagName.toLowerCase(); if (e.id) s += '#' + e.id; else if (typeof e.className === 'string' && e.className.trim()) s += '.' + e.className.trim().split(/\s+/).join('.'); return s; };const shown = (e) => { const r = e.getBoundingClientRect(); if (r.width <= 0 || r.height <= 0) return false; const cs = getComputedStyle(e); return cs.visibility !== 'hidden' && cs.display !== 'none' && cs.opacity !== '0'; };const out = { url: location.href, W, docScrollWidth: document.documentElement.scrollWidth, docHeight: document.documentElement.scrollHeight };out.hscroll = out.docScrollWidth > W;const inline = (e) => { if (e.tagName !== 'A' || getComputedStyle(e).display !== 'inline' || !e.parentElement) return false; return e.parentElement.textContent.trim().length > e.textContent.trim().length; };const tapEls = [...document.querySelectorAll('a[href], button, summary, input:not([type=hidden]), select, textarea, [role=button]')].filter(shown);const small = [];for (const e of tapEls) { if (inline(e)) continue; const r = e.getBoundingClientRect(); if (r.width < 43.5 || r.height < 43.5) small.push(`${sel(e)} "${(e.textContent || e.value || '').trim().slice(0, 20)}" ${Math.round(r.width)}x${Math.round(r.height)}`); }// ident's selector (shadow DOM): its visible buttons count toofor (const h of document.querySelectorAll('ident-selector')) if (h.shadowRoot && shown(h)) for (const e of h.shadowRoot.querySelectorAll('button, a[href], input')) { if (!shown(e)) continue; const r = e.getBoundingClientRect(); if (r.width < 43.5 || r.height < 43.5) small.push(`shadow:${sel(e)} ${Math.round(r.width)}x${Math.round(r.height)}`); }out.taps = tapEls.length; out.tapsSmall = small.length; out.tapsSmallList = small.slice(0, 12);const fields = [...document.querySelectorAll('input:not([type=hidden]), textarea, select')].filter(shown);out.inputs = fields.length; out.inputsSmallList = fields.filter(e => parseFloat(getComputedStyle(e).fontSize) < 15.95).map(e => `${sel(e)} ${getComputedStyle(e).fontSize}`);out.inputsSmall = out.inputsSmallList.length;const tiny = {};for (const e of document.querySelectorAll('body *')) {if (['SCRIPT', 'STYLE'].includes(e.tagName)) continue;if (![...e.childNodes].some(n => n.nodeType === 3 && n.textContent.trim())) continue;if (!shown(e)) continue;const fs = parseFloat(getComputedStyle(e).fontSize);if (fs < 13.95) { const k = `${sel(e)} ${fs.toFixed(1)}px`; tiny[k] = (tiny[k] || 0) + 1; }}out.textSmall = Object.values(tiny).reduce((a, b) => a + b, 0); out.textSmallList = Object.entries(tiny).slice(0, 8).map(([k, v]) => `${k} x${v}`);const hd = document.querySelector('application-header'); out.headerH = hd ? Math.round(hd.getBoundingClientRect().height) : null;out.boxesOver = [...document.querySelectorAll('pre, table, markdown-table')].filter(shown).filter(e => e.getBoundingClientRect().right > W + 1).map(e => `${sel(e)} right ${Math.round(e.getBoundingClientRect().right)}`);// elements that reach past the screen edge, not counting the contents of an element that scrolls sideways itselfconst insideScroll = (e) => { for (let p = e.parentElement; p; p = p.parentElement) { const o = getComputedStyle(p).overflowX; if (o === 'auto' || o === 'scroll' || o === 'hidden') return true; } return false; };out.wideList = [...document.querySelectorAll('body *')].filter(shown).filter(e => e.getBoundingClientRect().right > W + 0.5 && !insideScroll(e)).slice(0, 8).map(e => `${sel(e)} right ${Math.round(e.getBoundingClientRect().right)}`);out.wide = out.wideList.length;out.ok = !out.hscroll && out.tapsSmall === 0 && out.inputsSmall === 0 && out.textSmall === 0 && (out.headerH === null || out.headerH <= 53) && out.boxesOver.length === 0 && out.wide === 0;return out;})()
Branches
Latest commits
- f9b8f918Merge branch 'calendar-vendor-day61' into mainAtlas
- 66341793|||PR Vendor Hybriel day61Atlas
- 36fc596bMerge branch 'vendor-day59' into mainAtlas
- b37cc1da|||PR Vendor Hybriel day59Atlas
- 05665102Merge branch 'vendor-day56' into mainAtlas
- 687296fb|||PR Vendor Hybriel day56Atlas
- a6166d4eMerge branch 'hl-standard-3' into mainAtlas
- 6d0eb3b0|||PR Calendar day add buttons only when signed in (Kunibert minor)Atlas
- add4b499|||PR Make calendar day actions keyboard accessibleAtlas
- 79e49b4dMerge branch 'hl-standard' into mainAtlas
- e9fec7bb|||PR HL-STANDARD clean-up: typed parameters, plain locals, by-reference cacheAtlas
- eff166a4Re-vendor complete Hybriel plugins and runtime to day44mre
- cef81394Wait for the DST fixture page instead of an unused socketmre
- 42434f47Check lazy-session cookies after login with a stored anonymous fixturemre
- 728e84e3Re-vendor complete Hybriel day41 plugin directoriesmre
- cbd7ff43Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
- 59d1da0acalendar: plain declarations instead of needless let in 9 files (calendar#17): 49 declarations that are never reassigned; reassigned ones and the timer closure's p stay letmre
- f5415cf9calendar: the Style blocks in the language's nested form (calendar#16): rules named after the View's own elements with their children nested, pseudo-classes and @media nested, merged duplicate select rule; same CSS, shots identical in Chrome at 4 sizesmre
- edb7c947calendar: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 56+4 failing → 60 passedmre
- bf8cc0fcStyles move into their components: the shell's styles into main.hl, the events and the editors into the month view's Style block; styles.hl keeps only the theme inherit, the accent and the message line; .gitignore ignores a bin symlink too; tests/styles-shots.mjs for the before/after pixel comparemre