Twenty Twenty One: Remove Skiplink shim for Internet Explorer.

No version of Internet Explorer is still supported by WordPress or Microsoft. Usage of Internet Explorer has dropped to about 0.1%.

Follow up to [61628] to also remove JS that fixed skip link behavior for IE. Also remove overlooked contents of `ie-editor.css.map`.

Props sabernhardt, westonruter, joedolson.
Fixes #64590.
Built from https://develop.svn.wordpress.org/trunk@61635


git-svn-id: http://core.svn.wordpress.org/trunk@60946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson
2026-02-13 16:14:43 +00:00
parent e3a446c81e
commit 6d61ccdc29
3 changed files with 8 additions and 53 deletions

View File

@@ -1,35 +1 @@
/**
* File skip-link-focus-fix.js.
*
* Helps with accessibility for keyboard only users.
*
* This is the source file for what is minified in the twenty_twenty_one_skip_link_focus_fix() PHP function.
*
* Learn more: https://git.io/vWdr2
*
* @since Twenty Twenty-One 1.0
*/
( function() {
var isIe = /(trident|msie)/i.test( navigator.userAgent );
if ( isIe && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var id = location.hash.substring( 1 ),
element;
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
return;
}
element = document.getElementById( id );
if ( element ) {
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
element.tabIndex = -1;
}
element.focus();
}
}, false );
}
}() );
// Internet Explorer support was removed.

View File

@@ -457,31 +457,20 @@ function twentytwentyone_block_editor_script() {
add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' );
/**
* Fixes skip link focus in IE11.
* Adds an HTML comment about the lack of Internet Explorer support.
*
* This does not enqueue the script because it is tiny and because it is only for IE11,
* thus it does not warrant having an entire dedicated blocking script being loaded.
* This originally printed a script to fix the skip link focus behavior in IE11.
*
* @since Twenty Twenty-One 1.0
* @deprecated Twenty Twenty-One 1.9 Removed from wp_print_footer_scripts action.
* @deprecated Twenty Twenty-One 2.8 Removed Internet Explorer support.
*
* @link https://git.io/vWdr2
*/
function twenty_twenty_one_skip_link_focus_fix() {
// If SCRIPT_DEBUG is defined and true, print the unminified file.
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
echo '<script>';
include get_template_directory() . '/assets/js/skip-link-focus-fix.js';
echo '</script>';
} else {
// The following is minified via `npx terser --compress --mangle -- assets/js/skip-link-focus-fix.js`.
?>
<script>
/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",(function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}),!1);
</script>
<?php
}
?>
<!-- <?php echo __FUNCTION__; ?>(): Internet Explorer support was removed. -->
<?php
}
/**

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '7.0-alpha-61634';
$wp_version = '7.0-alpha-61635';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.