Make WordPress Core


Ignore:
Timestamp:
05/19/2021 07:59:55 PM (4 years ago)
Author:
desrosj
Message:

Script Loader: Stop loading polyfills specific to Internet Explorer

This change removes the inline JavaScript attached to the wp-polyfill script responsible for loading polyfill libraries included specifically for Internet Explorer support.

Support for the final version of IE supported in WordPress Core (IE11) was removed in [50784] and will on longer be supported when the next version of WordPress is released.

These scripts are still registered and available to be enqueued, but WordPress will no longer load them by default.

For more information, see https://wordpress.org/news/2021/05/dropping-support-for-internet-explorer-11/.

Props youknowriad, gziolo, sergiomdgomes, desrosj.
Fixes #53078.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r50441 r50934  
    724724        $ver       = get_bloginfo( 'version' );
    725725        $suffix    = wp_scripts_get_suffix();
    726         $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery-core,jquery-migrate&amp;ver={$ver}'></script>\n";
     726        $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery-core,jquery-migrate,wp-polyfill,wp-dom-ready,wp-hooks&amp;ver={$ver}'></script>\n";
    727727        $expected .= "<script type='text/javascript' id='test-example-js-before'>\nconsole.log(\"before\");\n</script>\n";
    728728        $expected .= "<script type='text/javascript' src='http://example.com' id='test-example-js'></script>\n";
    729         $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/vendor/wp-polyfill{$suffix}.js' id='wp-polyfill-js'></script>\n";
    730         $expected .= "<script type='text/javascript' id='wp-polyfill-js-after'>\n";
    731         $expected .= "( 'fetch' in window ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-fetch{$suffix}.js\"></scr' + 'ipt>' );( document.contains ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-node-contains{$suffix}.js\"></scr' + 'ipt>' );( window.DOMRect ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-dom-rect{$suffix}.js\"></scr' + 'ipt>' );( window.URL && window.URL.prototype && window.URLSearchParams ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-url{$suffix}.js\"></scr' + 'ipt>' );( window.FormData && window.FormData.prototype.keys ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-formdata{$suffix}.js\"></scr' + 'ipt>' );( Element.prototype.matches && Element.prototype.closest ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-element-closest{$suffix}.js\"></scr' + 'ipt>' );( 'objectFit' in document.documentElement.style ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-object-fit{$suffix}.js\"></scr' + 'ipt>' );\n";
    732         $expected .= "</script>\n";
    733         $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/dom-ready{$suffix}.js' id='wp-dom-ready-js'></script>\n";
    734         $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/hooks{$suffix}.js' id='wp-hooks-js'></script>\n";
    735729        $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/i18n{$suffix}.js' id='wp-i18n-js'></script>\n";
    736730        $expected .= "<script type='text/javascript' id='wp-i18n-js-after'>\n";
Note: See TracChangeset for help on using the changeset viewer.