Twenty Fifteen: Remove IE specific resources.

This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all 
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.

It also replaces the content of `html5.js` shiv with a comment (to avoid 404s), removes IE-specific code in general stylesheets, and removes IE specific code 
from Customizer, header.php and custom-header.php.

Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.



Built from https://develop.svn.wordpress.org/trunk@55981


git-svn-id: http://core.svn.wordpress.org/trunk@55493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-06-22 06:11:26 +00:00
parent 5cf8f0125b
commit 7df806c930
6 changed files with 6 additions and 31 deletions

View File

@ -435,12 +435,12 @@ function twentyfifteen_scripts() {
// Theme block stylesheet.
wp_enqueue_style( 'twentyfifteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentyfifteen-style' ), '20230122' );
// Load the Internet Explorer specific stylesheet.
wp_enqueue_style( 'twentyfifteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfifteen-style' ), '20220908' );
// Register the Internet Explorer specific stylesheet.
wp_register_style( 'twentyfifteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfifteen-style' ), '20220908' );
wp_style_add_data( 'twentyfifteen-ie', 'conditional', 'lt IE 9' );
// Load the Internet Explorer 7 specific stylesheet.
wp_enqueue_style( 'twentyfifteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentyfifteen-style' ), '20141210' );
// Register the Internet Explorer 7 specific stylesheet.
wp_register_style( 'twentyfifteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentyfifteen-style' ), '20141210' );
wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' );
// Skip-link fix is no longer enqueued by default.

View File

@ -15,9 +15,6 @@
<meta name="viewport" content="width=device-width">
<link rel="profile" href="https://gmpg.org/xfn/11">
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
<!--[if lt IE 9]>
<script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/html5.js?ver=3.7.0"></script>
<![endif]-->
<?php wp_head(); ?>
</head>

View File

@ -272,23 +272,19 @@ function twentyfifteen_sidebar_text_color_css() {
.site-title a:hover,
.site-title a:focus {
color: %1$s; /* Fallback for IE7 and IE8 */
color: %2$s;
}
.secondary-toggle {
border-color: %1$s; /* Fallback for IE7 and IE8 */
border-color: %3$s;
}
.secondary-toggle:hover,
.secondary-toggle:focus {
border-color: %1$s; /* Fallback for IE7 and IE8 */
border-color: %4$s;
}
.site-title a {
outline-color: %1$s; /* Fallback for IE7 and IE8 */
outline-color: %4$s;
}

View File

@ -516,7 +516,6 @@ function twentyfifteen_get_color_scheme_css( $colors ) {
.widget_calendar tbody a:focus,
.page-links a:hover,
.page-links a:focus {
background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
background-color: {$colors['secondary_textcolor']};
}
@ -558,7 +557,6 @@ function twentyfifteen_get_color_scheme_css( $colors ) {
.comment-list .reply a,
.widecolumn label,
.widecolumn .mu_register label {
color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
color: {$colors['secondary_textcolor']};
}
@ -566,7 +564,6 @@ function twentyfifteen_get_color_scheme_css( $colors ) {
blockquote,
.logged-in-as a:hover,
.comment-author a:hover {
border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
border-color: {$colors['secondary_textcolor']};
}
@ -574,7 +571,6 @@ function twentyfifteen_get_color_scheme_css( $colors ) {
hr,
.dropdown-toggle:hover,
.dropdown-toggle:focus {
background-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
background-color: {$colors['border_color']};
}
@ -610,7 +606,6 @@ function twentyfifteen_get_color_scheme_css( $colors ) {
.comment-list .trackback,
.comment-list .reply a,
.no-comments {
border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
border-color: {$colors['border_color']};
}
@ -618,13 +613,11 @@ function twentyfifteen_get_color_scheme_css( $colors ) {
a:focus,
button:focus,
input:focus {
outline-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
outline-color: {$colors['border_focus_color']};
}
input:focus,
textarea:focus {
border-color: {$colors['textcolor']}; /* Fallback for IE7 and IE8 */
border-color: {$colors['border_focus_color']};
}
@ -646,19 +639,16 @@ function twentyfifteen_get_color_scheme_css( $colors ) {
/* Sidebar Border Color */
.secondary-toggle {
border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */
border-color: {$colors['sidebar_border_color']};
}
/* Sidebar Border Focus Color */
.secondary-toggle:hover,
.secondary-toggle:focus {
border-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */
border-color: {$colors['sidebar_border_focus_color']};
}
.site-title a {
outline-color: {$colors['sidebar_textcolor']}; /* Fallback for IE7 and IE8 */
outline-color: {$colors['sidebar_border_focus_color']};
}

View File

@ -1,9 +1 @@
/*
* HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
// This theme does not support old versions of Microsoft Internet Explorer anymore.

View File

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