/* the number this round exists to hold at zero, and who broke it */ a11yAnon: a11yNone.length, a11yWho: a11yNone.slice(0, 3).map(whatis).join(' | '), a11yBad: a11yAll.map(function (el) { var nm = aname(el); if (!nm) return ''; var j = junk(el, nm); return j ? j + ':' + whatis(el) + ':' + nm.slice(0, 22) : ''; }).filter(Boolean).slice(0, 3).join(' | '), /* a layer that is off-screen but still in the tree: the closed sheets, the hidden mini bar, the nav under a sheet */ a11yGhost: (function () { var n = 0; [].forEach.call(document.querySelectorAll('.sheet:not(.up), .halfsheet:not(.up), .mini.hidden, .nav.gone'), function (h) { if (h.matches(A11Y_SEL) && exposed(h)) n++; n += [].filter.call(h.querySelectorAll(A11Y_SEL), exposed).length; }); return n; })(), /* a control that LOOKS chosen and does not say so */ a11yState: (function () { var bad = []; [].forEach.call(document.querySelectorAll('.row .sw'), function (sw) { var b = sw.closest('button, [role=button]'); if (!b || !exposed(b)) return; var want = sw.classList.contains('on') ? 'true' : 'false'; if (b.getAttribute('role') !== 'switch' || b.getAttribute('aria-checked') !== want) bad.push('sw:' + aname(b).slice(0, 18)); }); [].forEach.call(document.querySelectorAll('.segtabs button, .np-faces .fbtn, .nav button'), function (b) { if (!exposed(b)) return; var want = b.classList.contains('on') ? 'true' : 'false'; if (b.getAttribute('role') !== 'tab' || b.getAttribute('aria-selected') !== want) bad.push('tab:' + aname(b).slice(0, 18)); }); [].forEach.call(document.querySelectorAll('button.chip'), function (b) { if (!exposed(b) || b.classList.contains('tchip')) return; if (!b.hasAttribute('aria-pressed')) { if (b.classList.contains('on')) bad.push('chip:' + aname(b).slice(0, 18)); return; } if (b.getAttribute('aria-pressed') !== (b.classList.contains('on') ? 'true' : 'false')) bad.push('chip:' + aname(b).slice(0, 18)); }); return bad.slice(0, 3).join(' | '); })(), /* the layer on top: its role, whether it is modal, its name, and whether the focus went with it */ dlg: (function () { var d = document.querySelector('.viewer') || document.querySelector('.syncroom') || document.querySelector('.halfsheet.up') || document.querySelector('.sheet.up'); if (!d) return ''; var nm = (d.getAttribute('aria-label') || '').trim(); return (d.getAttribute('role') || '-') + '/' + (d.getAttribute('aria-modal') || '-') + '/' + nm.slice(0, 34) + '/' + (d.contains(document.activeElement) ? 'focus' : 'nofocus'); })(), navTabs: [].map.call(document.querySelectorAll('.nav button'), function (b) { return aname(b) + (b.getAttribute('aria-selected') === 'true' ? '*' : ''); }).join('|'), announce: ((document.querySelector('[data-live]') || {}).textContent || '').trim(),