Accessibility / Analysis / Reading Order Correlator
The Reading Order Correlator bookmarklet compares visual reading order to DOM source order using the Kendall tau correlation coefficient. Finds all content blocks (headings, paragraphs, lists, sections, etc.), sorts them by visual position (top-to-bottom, left-to-right), calculates the number of inversions where visual order differs from DOM order, computes the tau correlation coefficient (1 = perfect correlation, 0 = no correlation), highlights elements with large position discrepancies (5+ positions) in red with up-down arrows, and displays an alert with tau value and inversion count. Run again to remove.
WCAG SC 1.3.2: Meaningful Sequence
Run Reading Order Correlator
Test run or drag to
bookmarklets bar to install
javascript:%21function()%7B%22use%20strict%22%3Btry%7Bconst%20e%3D%22a11y-read-corr%22%2Ct%3Ddocument.getElementById(e)%3Bt%26%26t.remove()%3Bconst%20o%3D%22p%2Ch1%2Ch2%2Ch3%2Ch4%2Ch5%2Ch6%2Cli%2Cdt%2Cdd%2Csection%2Carticle%2Caside%2Cmain%2Cheader%2Cfooter%2Cnav%2Cblockquote%2Cpre%22%2Cn%3D%5B...document.querySelectorAll(o)%5D.filter(e%3D%3Ee.offsetParent%26%26(e.innerText%7C%7C%22%22).trim())%3Bif(%21n.length)return%20void%20alert(%22No%20readable%20blocks%22)%3Bconst%20r%3Dnew%20Map(n.map((e%2Ct)%3D%3E%5Be%2Ct%5D))%2Cl%3D%5B...n%5D.sort((e%2Ct)%3D%3E%7Bconst%20o%3De.getBoundingClientRect()%2Cn%3Dt.getBoundingClientRect()%3Breturn%20Math.abs(o.top-n.top)%3E8%3Fo.top-n.top%3Ao.left-n.left%7D)%3Blet%20a%3D0%2Ci%3Dl.length%3Bfor(let%20e%3D0%3Be%3Ci%3Be%2B%2B)for(let%20t%3De%2B1%3Bt%3Ci%3Bt%2B%2B)r.get(l%5Be%5D)%3Er.get(l%5Bt%5D)%26%26a%2B%2B%3Bconst%20c%3Di*(i-1)%2F2%2Cs%3Dc%3F1-2*a%2Fc%3A1%2Cd%3Ddocument.createElement(%22div%22)%3Bd.id%3De%2Cd.style%3D%22position%3Afixed%3Binset%3A0%3Bpointer-events%3Anone%3Bz-index%3A2147483647%22%2Cl.forEach((e%2Ct)%3D%3E%7Bif(Math.abs(r.get(e)-t)%3E%3D5)%7Bconst%20t%3De.getBoundingClientRect()%2Co%3Ddocument.createElement(%22div%22)%3Bo.textContent%3D%22%5Cu2195%22%2Co.style%3D%60position%3Aabsolute%3Bleft%3A%24%7Bt.left%2BscrollX%7Dpx%3Btop%3A%24%7Bt.top%2BscrollY%7Dpx%3Bcolor%3A%23e00%3Bfont%3A16px%20monospace%60%2Cd.appendChild(o)%7D%7D)%2Cdocument.body.appendChild(d)%2Calert(%60Kendall%20tau%3A%20%24%7Bs.toFixed(2)%7D%20%20inversions%3A%20%24%7Ba%7D%60)%2Cconsole.log(%22%5CnSource%3A%20https%3A%2F%2Fgithub.com%2Falejandrogiga98%2FA11y-Bookmarklets%5CnBookmarklet%20name%3A%20Reading%20order%20correlator%5CnAuthor%3A%20alejandrogiga98%5CnLicense%3A%20MIT%20License%5Cn%22)%7Dcatch(e)%7Balert(%22Bookmarklet%20Error%3A%20%22%2Be.message)%7D%7D()%3B
← Back to all bookmarklets