-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWTFocus.js
1 lines (1 loc) · 19.6 KB
/
WTFocus.js
1
javascript:(function()%7B%22use%20strict%22%3Bfunction%20WTFocus()%7Blet%20e%3Ddocument.activeElement%3Bconst%20t%3Ddocument.querySelectorAll('a%5Bhref%5D%2Cbutton%2Cselect%2Cinput%3Anot(%5Btype%3D%22hidden%22%5D)%2Ctextarea%2Csummary%2Carea%2C%5Btabindex%5D%3Anot(%23WTFocusPanel)%3Anot(%5Btabindex%5E%3D%22-1%22%5D)%2C%5Bcontenteditable%5D%3Anot(%5Bcontenteditable%3D%22false%22%5D)')%2Co%3D%22background%3A%23fff%3Bcolor%3Adarkgreen%3Bfont-weight%3Abold%3Btext-decoration%3Aline-through%22%2Cn%3D%22font-weight%3Abold%3Bcolor%3A%2399f170%3Bbackground%3A%23333%3Bdisplay%3Ainline-block%3Bpadding%3A3px%3B%22%2Ca%3D%22color%3Apink%3Bbackground%3A%23333%3Bpadding%3A3px%3B%22%2Cl%3D%22color%3Ablack%3Bbackground%3A%23fefbe3%3Bfont-weight%3Abold%3B%22%2Cr%3Ddocument.createElement(%22div%22)%2Ci%3Ddocument.createElement(%22div%22)%2Cc%3D20%2Cs%3D400%2Cu%3D7%2Cd%3D'%3Cspan%20aria-hidden%3D%22true%22%3E%F0%9F%91%89%F0%9F%8F%BD%3C%2Fspan%3E%3Cspan%20class%3D%22visually-hidden%22%3EAccessible%20name%20provided%20by%3C%2Fspan%3E%20'%2Cb%3D'%3Cspan%20aria-hidden%3D%22true%22%3E%F0%9F%9A%A8%3C%2Fspan%3E%20%3Cspan%20class%3D%22visually-hidden%22%3EWarning%3C%2Fspan%3E'%3Blet%20p%2Cm%3D%22Accessible%20name%3A%20%22%2Cf%3D!1%2Cg%3D%22%22%2Cy%3D!1%2Ch%3D!1%2CA%3D!1%2Cx%3D!1%2Cv%3D!1%3Bfunction%20T()%7By%3D!1%2Ch%3D!1%7Dfunction%20k(e%2Ct%2Co%2Cn%2Ca)%7Bf%26%26(t%3Dt.split(%22%3C%22).join(%22%26lt%3B%22).split(%22%3E%22).join(%22%26gt%3B%22)%2Cg%2B%3D%22%3Cli%22%2C(a%7C%7Cn)%26%26(g%2B%3D'%20class%3D%22'%2Ca%26%26(g%2B%3D%22visible%22)%2Cn%26%26(g%2B%3D%22outline%22)%2Cg%2B%3D'%22')%2Cg%2B%3D'%20role%3D%22listitem%22%3E%3Cspan%20style%3D%22'%2Bo%2B'%22%3E'%2Cy%26%26(g%2B%3Dd)%2Ch%26%26(g%2B%3Db)%2Cg%2B%3De%2B%22%3C%2Fspan%3E%26nbsp%3B%22%2Bt%2B%22%3C%2Fli%3E%5Cn%22)%2Ct%3Dt.replace(%22%26lt%3B%22%2C%22%3C%22).replace(%22%26gt%3B%22%2C%22%3E%22)%2Cconsole.log(%22%25c%22%2Be%2B'%22'%2Bt%2B'%22'%2Co)%7Dfunction%20F()%7Bconst%20e%3Ddocument.createElement(%22button%22)%3Be.textContent%3D%22Close%20(Esc)%22%2Ce.setAttribute(%22type%22%2C%22button%22)%2Ce.setAttribute(%22class%22%2C%22panel-btn%22)%2Ce.addEventListener(%22click%22%2C()%3D%3E%7BW()%7D)%3Bconst%20t%3Ddocument.createElement(%22button%22)%3Bt.textContent%3D%22Change%20Mode%20(M)%22%2Ct.setAttribute(%22type%22%2C%22button%22)%2Ct.setAttribute(%22class%22%2C%22panel-btn%22)%2Ct.addEventListener(%22click%22%2Ce%3D%3E%7BS()%7D)%2Cr.appendChild(e)%2Cr.appendChild(t)%7Dfunction%20S()%7Bv%3F(document.querySelector(%22%23WTFocusPanel%22).classList.remove(%22curtainsMode%22)%2Cdocument.querySelector(%22%23WTFocusPanel%22).removeAttribute(%22style%22)%2Cdocument.querySelector(%22%23WTFocusCurtain%22).setAttribute(%22hidden%22%2C%22hidden%22)%2Cv%3D!1%2Cm%3D%22Accessible%20name%3A%20%22)%3A(document.querySelector(%22%23WTFocusPanel%22).classList.add(%22curtainsMode%22)%2Cdocument.querySelector(%22%23WTFocusCurtain%22).removeAttribute(%22hidden%22)%2Cv%3D!0%2Cm%3D%22%22)%2CC(e)%2Ce.focus()%7Dfunction%20W()%7Bdocument.querySelector(%22%23WTFocusCurtain%22).remove()%2Cdocument.querySelector(%22%23WTFocusPanel%22).remove()%2Cdocument.querySelector(%22%23panelStyles%22).remove()%2Cdocument.querySelector(%22%23focusStyles%22).remove()%7Dfunction%20C(e)%7Bconst%20t%3De.getBoundingClientRect()%2Co%3Ddocument.documentElement.scrollTop%2Cn%3Dt.right%2Bc%2Bs%2Ca%3Dr.offsetHeight%2Cl%3Do%2Bt.top%2Ba%2Ci%3Dwindow.innerWidth%2Cd%3Dwindow.innerHeight%3Bv%3Fdocument.querySelector(%22%23WTFocusPanel%22).removeAttribute(%22style%22)%3An%3Ei%3F(l%3Ed%3F(r.style.top%3D%22auto%22%2Cr.style.bottom%3Dd-(o%2Bt.bottom)-10%2B%22px%22%2Cr.classList.add(%22toBottom%22))%3A(r.style.top%3Do%2Bt.top%2B%22px%22%2Cr.style.bottom%3D%22auto%22%2Cr.classList.remove(%22toBottom%22))%2Cr.style.left%3D%22auto%22%2Cr.style.right%3Di-t.left%2Bc-u%2B%22px%22%2Cr.classList.add(%22toLeft%22))%3A(l%3Ed%3F(r.style.top%3D%22auto%22%2Cr.style.bottom%3Dd-(o%2Bt.bottom)-10%2B%22px%22%2Cr.classList.add(%22toBottom%22))%3A(r.style.top%3Do%2Bt.top%2B%22px%22%2Cr.style.bottom%3D%22auto%22%2Cr.classList.remove(%22toBottom%22))%2Cr.style.left%3Dt.right%2Bc-u%2B%22px%22%2Cr.style.right%3D%22auto%22%2Cr.classList.remove(%22toLeft%22))%7Dconsole.clear()%2Cfunction()%7Bconst%20e%3Ddocument.createElement(%22style%22)%3Be.setAttribute(%22type%22%2C%22text%2Fcss%22)%2Ce.setAttribute(%22id%22%2C%22panelStyles%22)%2Ce.textContent%3D%22.dupeAccName%20%7Boutline%3A4px%20dashed%20%23CC3300!important%3Boutline-offset%3A%22%2Bu%2B%22px!important%3Boverflow%3Avisible%3B%7D%20.WTFocusTempFocusStyle%3Afocus%20%7Boutline%3A%22%2Bu%2B%22px%20solid%20black!important%3Boutline-offset%3A%22%2Bu%2B%22px!important%3Boverflow%3Avisible%3B%2F*background%3Ayellow!important%3Bcolor%3Ablack!important%3B*%2F%7D%20.WTFocusTempFocusStyle.dupeAccName%3Afocus%20%7Boutline-color%3A%23CC3300!important%3B%7D%20.visually-hidden%20%7Bclip-path%3A%20inset(100%25)%3Bclip%3A%20rect(1px%2C%201px%2C%201px%2C%201px)%3Bheight%3A%201px%3Boverflow%3A%20hidden%3Bposition%3A%20absolute%3Bwhite-space%3A%20nowrap%3Bwidth%3A%201px%3B%7D%23WTFocusCurtain%20%7Bbackground%3Ablack%3Bposition%3A%20fixed%3Btop%3A%200%3Bbottom%3A%200%3Bleft%3A%200%3Bright%3A%200%3Bz-index%3A49999%7D%22%2Cdocument.querySelector(%22body%22).appendChild(e)%7D()%2Cdocument.querySelector(%22%23WTFocusCurtain%22)%26%26W()%2Cf%3D!0%2Cg%3D%22%22%2Cfunction(e)%7Bconst%20t%3Ddocument.createElement(%22style%22)%3Bt.setAttribute(%22type%22%2C%22text%2Fcss%22)%2Ct.setAttribute(%22id%22%2C%22focusStyles%22)%2Ct.textContent%3D%22%23WTFocusPanel.error%20%7Bbackground%3Adarkred%3B%7D%20%23WTFocusPanel.warning%20%7Bbackground%3A%23CC3300%3B%7D%20%23WTFocusPanel.curtainsMode.error%20%7Bbackground%3Ablack%3B%7D%20%23WTFocusPanel.curtainsMode%20%7Bz-index%3A50000%3Bposition%3Afixed%3Btop%3A50%25%3Bleft%3A50%25%3Btransform%3Atranslate(-50%25%2C-50%25)%3B%7D%20%23WTFocusPanel.curtainsMode.warning%20%7Bbackground%3Ablack%3B%7D%20%23WTFocusPanel%5Bhidden%5D%20%7Bdisplay%3Anone%3B%7D%20%23WTFocusPanel%20*%20%7Btext-align%3Aleft%7D%20%23WTFocusPanel%20%7Bborder%3A2px%20solid%20%23fff%3Bz-index%3A1000%3Btext-shadow%3Anone%3Bfont-family%3Asans-serif%3Bdisplay%3Ablock%3Btext-align%3Aleft%3Bposition%3A%20absolute%3Bz-index%3A10000%3Bbackground%3A%20black%3Bpadding%3A%2020px%2020px%3Bwidth%3A%22%2Be%2B%22px%3Bfont-size%3A16px%3B%7D%20%23WTFocusPanel%20button%20%7Bfont-weight%3Abold%3Bbackground%3Anone%3Bcolor%3A%23fff%3Bpadding%3A3px%2010px%3Bfont-size%3A14px%3Bborder%3A1px%20solid%20%23fff%3Bdisplay%3Ainline-block%3Bmargin%3A10px%201em%20-10px%200%3B%7D%20%23WTFocusPanel%20ul%2C%23WTFocusPanel%20li%20%7Bmargin%3A0%3Bpadding%3A0%3Blist-style%3Anone%7D%20%23WTFocusPanel%20li%20%7Bmargin%3A3px%200%3Bbackground%3A%23fff%3Bcolor%3A%23333%3Bpadding%3A2px%7D%20%23WTFocusPanel%20li.outline%20%7Boutline%3A4px%20solid%20rgb(58%2C%20190%2C%2058)%3Boutline-offset%3A-4px%3Bpadding%3A8px%7D%20%23WTFocusPanel.error%3Abefore%20%7Bbackground%3Adarkred%7D%20%23WTFocusPanel.warning%3Abefore%20%7Bbackground%3A%23CC3300%7D%20%23WTFocusPanel%3Abefore%20%7Bcontent%3A''%3Bdisplay%3Ablock%3Bheight%3A20px%3Bwidth%3A20px%3Btransform%3Arotate(45deg)%3Bposition%3Aabsolute%3Bbackground%3A%23000%3Bleft%3A-12px%3Btop%3A3px%3Bborder%3A2px%20solid%20%23fff%3Bborder-right%3Anone%3Bborder-top%3Anone%3B%7D%20%23WTFocusPanel.toBottom%3Abefore%20%7Btop%3Aauto%3Bbottom%3A3px%7D%20%23WTFocusPanel.toLeft%3Abefore%20%7Bleft%3Aauto%3Bright%3A-12px%3Bborder%3A2px%20solid%20%23fff%3Bborder-left%3Anone%3Bborder-bottom%3Anone%3B%7D%20%23WTFocusPanel.curtainsMode%20%7Boutline%3A10px%20solid%20orange%3B%7D%20%23WTFocusPanel.curtainsMode%3Abefore%20%7Bdisplay%3Anone%3B%7D%20%23WTFocusPanel.curtainsMode%20li%20%7Bdisplay%3Anone%3B%7D%20%23WTFocusPanel.curtainsMode%20li.visible%20%7Bdisplay%3Ablock%3B%7D%20%23WTFocusPanel.curtainsMode%20li%20span%20%7Bdisplay%3Anone!important%3B%7D%20%22%2Cdocument.querySelector(%22head%22).appendChild(t)%7D(s)%2Ci.setAttribute(%22id%22%2C%22WTFocusCurtain%22)%2Ci.setAttribute(%22hidden%22%2C%22hidden%22)%2Cdocument.querySelector(%22body%22).appendChild(i)%2Cr.setAttribute(%22id%22%2C%22WTFocusPanel%22)%2Cv%26%26r.setAttribute(%22class%22%2C%22curtainsMode%22)%2Cr.setAttribute(%22aria-live%22%2C%22polite%22)%2Cr.setAttribute(%22tabindex%22%2C%22-1%22)%2Cr.setAttribute(%22hidden%22%2C%22hidden%22)%2Cr.setAttribute(%22role%22%2C%22region%22)%2Cr.setAttribute(%22aria-label%22%2C%22Accessibility%20properties%20panel%22)%2Cdocument.querySelector(%22body%22).appendChild(r)%2Cwindow.addEventListener(%22keyup%22%2Ce%3D%3E%7B%22Escape%22%3D%3D%3De.key%26%26document.querySelector(%22%23WTFocusPanel%22)%26%26W()%7D)%2Cwindow.addEventListener(%22keyup%22%2Ce%3D%3E%7B%22m%22%3D%3D%3De.key.toLowerCase()%26%26document.querySelector(%22%23WTFocusPanel%22)%26%26S()%7D)%2CF()%3Blet%20N%3D%5B%5D%3BArray.from(t).forEach(function(i)%7Bi.classList.add(%22WTFocusTempFocusStyle%22)%3Bconst%20c%3Di.querySelectorAll(%22style%22)%3BArray.from(c).forEach(function(e)%7Be.remove()%7D)%2Ci.addEventListener(%22focus%22%2C()%3D%3E%7Blet%20c%3Di.getAttribute(%22role%22)%2Cs%3Di.tagName.toLowerCase()%3Bif(console.clear()%2Cc)%3Belse%20if(%22article%22!%3Ds%26%26%22button%22!%3Ds%26%26%22dialog%22!%3Ds%26%26%22figure%22!%3Ds%26%26%22img%22!%3Ds%26%26%22main%22!%3Ds%26%26%22math%22!%3Ds%7C%7C(c%3Ds)%2C%22summary%22%3D%3Ds%26%26(c%3D%22button%22)%2C%22aside%22%3D%3Ds%26%26(c%3D%22complementary%22)%2C%22dd%22%3D%3Ds%26%26(c%3D%22definition%22)%2C%22html%22%3D%3Ds%26%26(c%3D%22document%22)%2C%22details%22!%3Ds%26%26%22fieldset%22!%3Ds%26%26%22optgroup%22!%3Ds%7C%7C(c%3D%22group%22)%2C%22menu%22!%3Ds%26%26%22ol%22!%3Ds%26%26%22ul%22!%3Ds%7C%7C(c%3D%22list%22)%2C%22datalist%22%3D%3Ds%26%26(c%3D%22listbox%22)%2C%22li%22%3D%3Ds%26%26(c%3D%22listitem%22)%2C%22nav%22%3D%3Ds%26%26(c%3D%22navigation%22)%2C%22progress%22%3D%3Ds%26%26(c%3D%22progressbar%22)%2C%22hr%22%3D%3Ds%26%26(c%3D%22separator%22)%2C%22output%22%3D%3Ds%26%26(c%3D%22status%22)%2C%22dfn%22!%3Ds%26%26%22dt%22!%3Ds%7C%7C(c%3D%22term%22)%2C%22a%22%3D%3Ds%26%26(c%3D%22link%22)%2C%22select%22%3D%3Ds%26%26(c%3D%22listbox%22)%2C%22textarea%22%3D%3Ds%26%26(c%3D%22textbox%22)%2C%22input%22%3D%3Ds)%7Blet%20e%3Di.getAttribute(%22type%22).toLowerCase()%3B%22text%22%3D%3D%3De%26%26(c%3D%22textbox%22)%2C%22range%22%3D%3D%3De%26%26(c%3D%22slider%22)%2C%22number%22%3D%3D%3De%26%26(c%3D%22spinbutton%22)%2C%22checkbox%22!%3D%3De%26%26%22radio%22!%3D%3De%7C%7C(c%3De)%2C%22button%22!%3D%3De%26%26%22image%22!%3D%3De%26%26%22reset%22!%3D%3De%26%26%22submit%22!%3D%3De%7C%7C(c%3D%22button%22)%7De%3Di%2CArray.from(t).forEach(function(e)%7Be.classList.remove(%22dupeAccName%22)%7D)%3Blet%20u%3D!1%3By%3D!1%2Ch%3D!1%3Bconst%20d%3Di.querySelectorAll(%22img%2C%20%5Brole%3D'image'%5D%5Baria-label%5D%2C%20%5Brole%3D'img'%5D%5Baria-label%5D%22)%3B(u%3Dd.length%3E0)%26%26Array.from(d).forEach(function(e)%7Bconst%20t%3Ddocument.createElement(%22SPAN%22)%3Bvar%20o%2Cn%3Bt.setAttribute(%22class%22%2C%22visually-hidden%22)%2Ct.setAttribute(%22style%22%2C%22clip-path%3A%20inset(100%25)%3Bclip%3A%20rect(1px%2C%201px%2C%201px%2C%201px)%3Bheight%3A%201px%3Boverflow%3A%20hidden%3Bposition%3A%20absolute%3Bwhite-space%3A%20nowrap%3Bwidth%3A%201px%3B%22)%2Ct.setAttribute(%22data-temp-node%22%2C%22true%22)%2Ce.getAttribute(%22alt%22)%26%26(t.textContent%3D%22%20%22%2Be.getAttribute(%22alt%22)%2B%22%20%22)%2Ce.getAttribute(%22role%22)%26%26e.getAttribute(%22aria-label%22)%26%26(t.textContent%3D%22%20%22%2Be.getAttribute(%22aria-label%22)%2B%22%20%22)%2Co%3Dt%2C(n%3De).parentNode.insertBefore(o%2Cn.nextSibling)%7D)%2CsetTimeout(function()%7Bi.classList.add(%22WTFocusTempFocusStyle%22)%7D%2C100)%2Cg%3D%22%22%3Bconst%20b%3Di.tagName.toLowerCase()%3Blet%20p%3Di.getAttribute(%22role%22)%3Bp%26%26(p%3Di.getAttribute(%22role%22).toLowerCase())%3Blet%20v%3D%22%3C%22%2Bb%2B%22%3E%22%2CS%3D!1%2CW%3D!1%3Bp%26%26(v%3D%22%3C%22%2Bb%2B'%20role%3D%22'%2Bp%2B'%22%3E'%2C(%22link%22%3D%3D%3Dp%26%26%22a%22%3D%3D%3Db%7C%7C%22button%22%3D%3D%3Dp%26%26%22button%22%3D%3D%3Db%7C%7C%22image%22%3D%3D%3Dp%26%26%22img%22%3D%3D%3Db%7C%7C%22img%22%3D%3D%3Dp%26%26%22img%22%3D%3D%3Db%7C%7C%22navigation%22%3D%3D%3Dp%26%26%22nav%22%3D%3D%3Db%7C%7C%22heading%22%3D%3D%3Dp%26%26(%22h1%22%3D%3D%3Db%7C%7C%22h2%22%3D%3D%3Db%7C%7C%22h3%22%3D%3D%3Db%7C%7C%22h4%22%3D%3D%3Db%7C%7C%22h5%22%3D%3D%3Db%7C%7C%22h6%22%3D%3D%3Db))%26%26(S%3D!0)%2C(%22link%22%3D%3D%3Dp%26%26%22a%22!%3D%3Db%7C%7C%22button%22%3D%3D%3Dp%26%26%22button%22!%3D%3Db%7C%7C(%22image%22%3D%3D%3Dp%7C%7C%22image%22%3D%3D%3Dp)%26%26%22img%22!%3D%3Db%7C%7C%22navigation%22%3D%3D%3Dp%26%26%22nav%22!%3D%3Db%7C%7C%22heading%22%3D%3D%3Dp%26%26%22h1%22!%3D%3Db%26%26%22h2%22!%3D%3Db%26%26%22h3%22!%3D%3Db%26%26%22h4%22!%3D%3Db%26%26%22h5%22!%3D%3Db%26%26%22h6%22!%3D%3Db)%26%26(W%3D!0))%3Blet%20w%2CP%3Di.textContent%2CL%3Di.ariaLabel%2Cq%3Di.getAttribute(%22aria-labelledby%22)%2CM%3Di.getAttribute(%22placeholder%22)%2CB%3D%22%22%2Cz%3Di.getAttribute(%22value%22)%2CI%3Di.getAttribute(%22title%22)%2CH%3D%22%22%2Cj%3D%22%22%2CO%3D!1%2CR%3D!1%2CV%3D%22%22%2CD%3D!1%3Bf%26%26C(i)%2CP%3DP.trim()%3Bconst%20Y%3Dfunction(e%2Ct)%7Bfor(%3B(e%3De.parentElement)%26%26!(e.matches%7C%7Ce.matchesSelector).call(e%2Ct)%3B)%3Breturn%20e%7D(i%2C%22label%22)%3Bif(Y%26%26(O%3D!0%2CH%3Dj%3DY.textContent.trim())%2Ci.getAttribute(%22id%22))%7Bconst%20e%3Ddocument.querySelector(%22%5Bfor%3D'%22%2Bi.getAttribute(%22id%22)%2B%22'%5D%22)%3Be%26%26(R%3D!0%2Cj%3De.textContent)%7Dif(O%7C%7CR%7C%7C(j%3D%22N%2FA%22)%2CP%7C%7C(P%3D%22N%2FA%22)%2Cz%7C%7C(z%3D%22N%2FA%22)%2CI%7C%7C(I%3D%22N%2FA%22)%2CM%7C%7C(M%3D%22N%2FA%22)%2CL%7C%7C(L%3D%22N%2FA%22)%2Cq)%7Bconst%20e%3D(w%3Dq).split(%22%20%22)%3Be.length%3E1%3F(Array.from(e).forEach(function(e)%7Bdocument.querySelector(%22%23%22%2Be)%3FB%2B%3Ddocument.querySelector(%22%23%22%2Be).textContent%2B%22%20%22%3AB%2B%3D%22%E2%9D%93%E2%9D%93%E2%9D%93%20%22%7D)%2CB%3DB.trim())%3AB%3Ddocument.querySelector(%22%23%22%2Bw).textContent%7Delse%20q%3D%22N%2FA%22%3Bconst%20G%3Di.querySelectorAll(%22%5Baria-hidden%3D'true'%5D%2C%5Brole%3D'presentation'%5D%22)%3Blet%20J%3DP%3Bif(G.length%3E0%26%26(D%3D!0%2CArray.from(G).forEach(function(e)%7Bconst%20t%3De.textContent%3B%22%22!%3D%3Dt%26%26(J%3DJ.split(t).join(%22%20%22))%7D)%2CJ%3DJ.trim())%2C%22input%22%3D%3D%3Db)%7Bconst%20e%3Di.getAttribute(%22type%22)%3B%22submit%22%3D%3D%3De%26%26%22N%2FA%22%3D%3D%3Dz%26%26(H%3D%22Submit%22%2CV%3D%22Not%20provided%20(using%20default)%22)%2C%22image%22%3D%3D%3De%26%26%22N%2FA%22%3D%3D%3Dz%26%26(H%3D%22Submit%22%2CV%3D%22Not%20provided%20(using%20default)%22)%2C%22cancel%22%3D%3D%3De%26%26%22N%2FA%22%3D%3D%3Dz%26%26(H%3D%22Cancel%22%2CV%3D%22Not%20provided%20(using%20default)%22)%7Dif(%22N%2FA%22!%3D%3DI%26%26(H%3DI%2CV%3D%22title%20attribute%22)%2C%22N%2FA%22!%3D%3Dz%26%26(H%3Dz%2CV%3D%22value%20attribute%22)%2C%22N%2FA%22!%3D%3DM%26%26(H%3DM%2CV%3D%22placeholder%20attribute%22)%2C%22N%2FA%22!%3D%3DP%26%26(H%3DJ%2CV%3D%22Inner%20text%20content%22)%2C%22N%2FA%22!%3D%3Dj%26%26(H%3Dj%2CV%3D%22%3Clabel%3E%20text%22)%2C%22N%2FA%22!%3D%3DL%26%26(H%3DL%2CV%3D%22aria-label%22)%2C%22N%2FA%22!%3D%3Dq%26%26(H%3DB%2CV%3D%22aria-labelledby%22)%2Cconsole.log(%22%25cACTIVE%20ELEMENT%3A%20%22%2C%22background%3A%23193c10%3Bcolor%3Awhite%3B%22)%2Cconsole.log(i)%2CA%3D%22true%22%3D%3D%3Di.getAttribute(%22data-dupe%22)%2Cx%3DA%26%26%22%22%3D%3D%3DH%2C%22%22%3D%3D%3DH%7C%7CA)%7Bif(%22%22%3D%3D%3DH%26%26(h%3D!0%2Cf%26%26r.classList.add(%22error%22)%2Ck(m%2B%22No%20accessible%20name!%22%2C%22%22%2Ca)%2Ck(%22Accessible%20Name%20Source%3A%20N%2FA%22%2C%22%22%2Ca))%2CA%26%26%22%22!%3D%3DH)%7Bf%26%26r.classList.add(%22warning%22)%3Bconst%20e%3Ddocument.querySelectorAll(%22%5Bdata-accname%3D'%22%2BH%2B%22'%5D%22)%2Ct%3De.length%3Bk(m%2CH%2Ca%2C!1%2C!0)%2Cx%7C%7C(Array.from(e).forEach(function(e)%7Be.classList.add(%22dupeAccName%22)%7D)%2Ck(%22Duplicate%20warning!%22%2Ct%2B%22%20elements%20on%20page%20have%20the%20same%20accessible%20name%22%2Ca))%2Cconsole.log(%22Elements%20on%20page%20that%20have%20identical%20accessible%20names%3A%22)%2CArray.from(e).forEach(function(e)%7Bconsole.log(e)%7D)%2Ck(%22Accessible%20Name%20Source%3A%20%22%2CV%2Ca)%7D%7Delse%20f%26%26(r.classList.remove(%22error%22)%2Cr.classList.remove(%22warning%22))%2Ck(m%2CH%2Cn%2C!1%2C!0)%2Ck(%22Accessible%20Name%20Source%3A%20%22%2CV%2Cn)%3Bh%3D!1%2Ck(%22HTML%20Element%3A%20%22%2Cv%2Cn)%2Ck(%22Role%3A%20%22%2Cc%2C%22color%3A%23333%3Bbackground%3A%23fff%3B%22%2C!1%2C!0)%2Cf%7C%7Cconsole.log(%22%25cACCESSIBLE%20NAME%20COMES%20FROM%3A%20%22%2C%22background%3A%23193c10%3Bcolor%3Awhite%3B%22)%2CS%26%26(h%3D!0%2Ck(%22Superfluous%20%60role%60%20attribute%22%2C%22%22%2Ca))%2CW%26%26(h%3D!0%2Ck(%22Better%20to%20use%20a%20native%20HTML%20element%22%2C%22%22%2Ca))%2CP%3DP.trim()%2Cj%3Dj.trim()%2CI%3DI.trim()%2CL%3DL.trim()%2Cq%3Dq.trim()%2CT()%2C%22placeholder%20attribute%22%3D%3D%3DV%3F(y%3D!0%2Ck(%22%40placeholder%3A%20%22%2CM%2Cl%2C!0))%3Ak(%22%40placeholder%3A%20%22%2CM%2C%22N%2FA%22%3D%3D%3DM%3F%22color%3A%23333%3Bbackground%3A%23fff%3B%22%3Ao)%2CT()%2C%22title%20attribute%22%3D%3D%3DV%3F(y%3D!0%2Ck(%22%40title%3A%20%22%2CI%2Cl%2C!0))%3Ak(%22%40title%3A%20%22%2CI%2C%22N%2FA%22%3D%3D%3DI%3F%22color%3A%23333%3Bbackground%3A%23fff%3B%22%3Ao)%2CT()%2C%22value%20attribute%22%3D%3D%3DV%3F(y%3D!0%2Ck(%22%40value%3A%20%22%2Cz%2Cl%2C!0))%3Ak(%22%40value%3A%20%22%2Cz%2C%22N%2FA%22%3D%3D%3Dz%3F%22color%3A%23333%3Bbackground%3A%23fff%3B%22%3Ao)%2CT()%2C%22Inner%20text%20content%22%3D%3D%3DV%3F(y%3D!0%2Ck(u%3F%22Inner%20text%20content%20(includes%20image%20alt)%3A%20%22%3A%22Inner%20text%20content%3A%20%22%2CP%2Cl%2C!0)%2CD%26%26k(%22!%20elements%20hidden%20to%20AT%20removed%22%2C%22%22%2Cl))%3Ak(%22Text%20Content%3A%20%22%2CP%2C%22N%2FA%22%3D%3D%3DP%3F%22color%3A%23333%3Bbackground%3A%23fff%3B%22%3Ao)%2CT()%2C%22%3Clabel%3E%20text%22%3D%3D%3DV%3F(y%3D!0%2Ck(%22Visible%20%60label%60%20text%3A%20%22%2Cj%2Cl%2C!0))%3Ak(%22Visible%20%60label%60%20text%3A%20%22%2Cj%2C%22N%2FA%22%3D%3D%3Dj%3F%22color%3A%23333%3Bbackground%3A%23fff%3B%22%3Ao)%2CT()%2C%22aria-label%22%3D%3D%3DV%3FL%3D%3D%3DP%3F(h%3D!0%2Ck(%22%60aria-label%60%20content%20is%20same%20as%20inner%20text%20content%22%2C%22%22%2Ca))%3A(y%3D!0%2Ck(%22%40aria-label%20value%3A%20%22%2CL%2Cl%2C!0))%3Ak(%22%40aria-label%20value%3A%20%22%2CL%2C%22N%2FA%22%3D%3D%3DL%3F%22color%3A%23333%3Bbackground%3A%23fff%3B%22%3Ao)%2CT()%2C%22aria-labelledby%22%3D%3D%3DV%3FB%3D%3D%3DP%3F(h%3D!0%2Ck(%22%60aria-labelledby%60%20source%20content%20is%20same%20as%20inner%20text%20content%22%2C%22%22%2Ca))%3A(y%3D!0%2Ck(%22%40aria-labelledby%20value%3A%20%22%2Cq%2Cl%2C!0)%2Ck(%22%40aria-labelledby%20sources%3A%20%22%2CB%2Cl))%3A(k(%22%40aria-labelledby%20value%3A%20%22%2Cq%2C%22color%3A%23333%3Bbackground%3A%23fff%3B%22)%2Ck(%22%40aria-labelledby%20sources%3A%20%22%2C%22N%2FA%22%2C%22color%3A%23333%3Bbackground%3A%23fff%3B%22))%2Cf%26%26(document.querySelector(%22%23WTFocusPanel%22).innerHTML%3D'%3Cul%20role%3D%22list%22%3E'%2Bg%2B%22%3C%2Ful%3E%22%2Cdocument.querySelector(%22%23WTFocusPanel%22).removeAttribute(%22hidden%22)%2CF())%3Bconst%20K%3Ddocument.querySelectorAll(%22%5Bdata-temp-node%5D%22)%3BArray.from(K).forEach(function(e)%7Be.remove()%7D)%2Ci.setAttribute(%22data-accname%22%2CH)%2CE%7C%7Cfunction(e%2Ct)%7Blet%20o%3D!1%3Bif(Array.from(N).forEach(function(t)%7Bt%3D%3D%3De%26%26(o%3D!0)%7D)%2Co)%7Bt.setAttribute(%22data-dupe%22%2C%22true%22)%3Bconst%20o%3Ddocument.querySelector(%22%5Bdata-accname%3D'%22%2Be%2B%22'%5D%22)%3Bo.setAttribute(%22data-dupe%22%2C%22true%22)%7Delse%20N.push(e)%7D(H%2Ci)%7D)%7D)%3Blet%20E%3D!1%3B!function()%7Bif(p%3Ddocument.activeElement%2CArray.from(t).forEach(function(e)%7Bdocument.activeElement%3D%3D%3De%26%26e.blur()%2Ce.focus()%7D)%2CE%3D!0%2C%22BODY%22%3D%3D%3Dp.tagName)%7Bconst%20e%3Ddocument.querySelector(%22body%22)%3Be.setAttribute(%22tabindex%22%2C%22-1%22)%2Ce.focus()%2Cdocument.querySelector(%22%23WTFocusPanel%22).setAttribute(%22hidden%22%2C%22hidden%22)%7Delse%20p.focus()%3Bconsole.clear()%7D()%2Cconsole.log(%22had%20focus%20%3D%20%22%2Ce)%7DWTFocus()%3B%7D)()