From 77073cce6b4a4fa3db85cfd2a243cc86f4fcaee3 Mon Sep 17 00:00:00 2001 From: joedolson Date: Sat, 11 May 2024 18:28:08 +0000 Subject: [PATCH] Toolbar: Accessibility: Remove adminbar skiplink focus fix. Based on the current browser support policies and expectations, this is no longer needed. There are almost no browsers in use where this is still in use. The same fix was removed from core themes in #54421. Props joedolson, sabernhardt, shailu25. Fixes #60479. Built from https://develop.svn.wordpress.org/trunk@58133 git-svn-id: http://core.svn.wordpress.org/trunk@57598 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/admin-bar.js | 34 --------------------------------- wp-includes/js/admin-bar.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 2 insertions(+), 36 deletions(-) diff --git a/wp-includes/js/admin-bar.js b/wp-includes/js/admin-bar.js index dbee866325..eb18c61f8b 100644 --- a/wp-includes/js/admin-bar.js +++ b/wp-includes/js/admin-bar.js @@ -95,11 +95,6 @@ } ); } - if ( skipLink ) { - // Focus the target of skip link after pressing Enter. - skipLink.addEventListener( 'keydown', focusTargetAfterEnter ); - } - if ( shortlink ) { shortlink.addEventListener( 'click', clickShortlink ); } @@ -173,35 +168,6 @@ } } - /** - * Focus the target of skip link after pressing Enter. - * - * @since 5.3.1 - * - * @param {Event} event The keydown event. - */ - function focusTargetAfterEnter( event ) { - var id, userAgent; - - if ( event.which !== 13 ) { - return; - } - - id = event.target.getAttribute( 'href' ); - userAgent = navigator.userAgent.toLowerCase(); - - if ( userAgent.indexOf( 'applewebkit' ) > -1 && id && id.charAt( 0 ) === '#' ) { - setTimeout( function() { - var target = document.getElementById( id.replace( '#', '' ) ); - - if ( target ) { - target.setAttribute( 'tabIndex', '0' ); - target.focus(); - } - }, 100 ); - } - } - /** * Toggle hover class for mobile devices. * diff --git a/wp-includes/js/admin-bar.min.js b/wp-includes/js/admin-bar.min.js index 7beb6dfc6b..b01d377c94 100644 --- a/wp-includes/js/admin-bar.min.js +++ b/wp-includes/js/admin-bar.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(l,u,d){function f(e){27===e.which&&(e=w(e.target,".menupop"))&&(e.querySelector(".menupop > .ab-item").focus(),y(e,"hover"))}function p(e){var t;13!==e.which||e.ctrlKey||e.shiftKey||w(e.target,".ab-sub-wrapper")||(t=w(e.target,".menupop"))&&(e.preventDefault(),(a(t,"hover")?y:g)(t,"hover"))}function h(e){var t;13===e.which&&(t=e.target.getAttribute("href"),-1 .ab-item").focus(),y(e,"hover"))}function p(e){var t;13!==e.which||e.ctrlKey||e.shiftKey||E(e.target,".ab-sub-wrapper")||(t=E(e.target,".menupop"))&&(e.preventDefault(),(a(t,"hover")?y:v)(t,"hover"))}function m(e,t){!E(t.target,".ab-sub-wrapper")&&(t.preventDefault(),t=E(t.target,".menupop"))&&(a(t,"hover")?y:(b(e),v))(t,"hover")}function f(e){var t,r=e.target.parentNode;if(t=r?r.querySelector(".shortlink-input"):t)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,v(r,"selected"),t.focus(),t.select(),!(t.onblur=function(){y(r,"selected")})}function h(){if("sessionStorage"in l)try{for(var e in sessionStorage)-1