Make WordPress Core

Changeset 60961


Ignore:
Timestamp:
10/17/2025 08:59:33 PM (3 months ago)
Author:
joedolson
Message:

Twenty Twelve: Remove code and checks for obsolete browsers.

Remove IE specific code from Twenty Twelve. Remove custom IE stylesheet contents, the HTML5 shiv contents (also targeting Safari 4.x and Firefox 3.x), and IE-specific code. Change relevant enqueues to registrations.

Props desrosj, sabernhardt, karmatosed, neychok, metodiew, mukesh27, joedolson.
See #58836.

Location:
trunk/src/wp-content/themes/twentytwelve
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwelve/css/ie.css

    r58776 r60961  
    1 /*
    2 Styles for older IE versions (previous to IE9).
    3 */
    4 
    5 body {
    6     background-color: #e6e6e6;
    7 }
    8 body.custom-background-empty {
    9     background-color: #fff;
    10 }
    11 body.custom-background-empty .site,
    12 body.custom-background-white .site {
    13     box-shadow: none;
    14     margin-bottom: 0;
    15     margin-top: 0;
    16     padding: 0;
    17 }
    18 .assistive-text,
    19 .site .screen-reader-text {
    20     clip: rect(1px 1px 1px 1px);
    21 }
    22 .full-width .site-content {
    23     float: none;
    24     width: 100%;
    25 }
    26 img.size-full,
    27 img.size-large,
    28 img.header-image,
    29 img.wp-post-image,
    30 img[class*="align"],
    31 img[class*="wp-image-"],
    32 img[class*="attachment-"] {
    33     width: auto; /* Prevent stretching of full-size and large-size images with height and width attributes in IE8 */
    34 }
    35 .author-avatar {
    36     float: left;
    37     margin-top: 8px;
    38     margin-top: 0.571428571rem;
    39 }
    40 .author-description {
    41     float: right;
    42     width: 80%;
    43 }
    44 .site {
    45     box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
    46     margin: 48px auto;
    47     max-width: 960px;
    48     overflow: hidden;
    49     padding: 0 40px;
    50 }
    51 .site-content {
    52     float: left;
    53     width: 65.104166667%;
    54 }
    55 body.template-front-page .site-content,
    56 body.attachment .site-content,
    57 body.full-width .site-content {
    58     width: 100%;
    59 }
    60 .widget-area {
    61     float: right;
    62     width: 26.041666667%;
    63 }
    64 .site-header h1,
    65 .site-header h2 {
    66     text-align: left;
    67 }
    68 .site-header h1 {
    69     font-size: 26px;
    70     line-height: 1.846153846;
    71 }
    72 .main-navigation ul.nav-menu,
    73 .main-navigation div.nav-menu > ul {
    74     border-bottom: 1px solid #ededed;
    75     border-top: 1px solid #ededed;
    76     display: inline-block !important;
    77     text-align: left;
    78     width: 100%;
    79 }
    80 .main-navigation ul {
    81     margin: 0;
    82     text-indent: 0;
    83 }
    84 .main-navigation li a,
    85 .main-navigation li {
    86     display: inline-block;
    87     text-decoration: none;
    88 }
    89 .ie7 .main-navigation li a,
    90 .ie7 .main-navigation li {
    91     display: inline;
    92 }
    93 .main-navigation li a {
    94     border-bottom: 0;
    95     color: #6a6a6a;
    96     line-height: 3.692307692;
    97     text-transform: uppercase;
    98 }
    99 .main-navigation li a:hover {
    100     color: #000;
    101 }
    102 .main-navigation li {
    103     margin: 0 40px 0 0;
    104     position: relative;
    105 }
    106 .main-navigation li ul {
    107     margin: 0;
    108     padding: 0;
    109     position: absolute;
    110     top: 100%;
    111     z-index: 99999;
    112     height: 1px;
    113     width: 1px;
    114     overflow: hidden;
    115     clip: rect(1px, 1px, 1px, 1px);
    116 }
    117 .ie7 .main-navigation li ul {
    118     clip: inherit;
    119     display: none;
    120     left: 0;
    121     overflow: visible;
    122 }
    123 .main-navigation li ul ul,
    124 .ie7 .main-navigation li ul ul {
    125     top: 0;
    126     left: 100%;
    127 }
    128 .main-navigation ul li:hover > ul,
    129 .main-navigation ul li:focus > ul,
    130 .main-navigation .focus > ul {
    131     border-left: 0;
    132     clip: inherit;
    133     overflow: inherit;
    134     height: inherit;
    135     width: inherit;
    136 }
    137 .ie7 .main-navigation ul li:hover > ul,
    138 .ie7 .main-navigation ul li:focus > ul {
    139     display: block;
    140 }
    141 .main-navigation li ul li a {
    142     background: #efefef;
    143     border-bottom: 1px solid #ededed;
    144     display: block;
    145     font-size: 11px;
    146     line-height: 2.181818182;
    147     padding: 8px 10px;
    148     width: 180px;
    149 }
    150 .main-navigation li ul li a:hover {
    151     background: #e3e3e3;
    152     color: #444;
    153 }
    154 .main-navigation .current-menu-item > a,
    155 .main-navigation .current-menu-ancestor > a,
    156 .main-navigation .current_page_item > a,
    157 .main-navigation .current_page_ancestor > a {
    158     color: #636363;
    159     font-weight: bold;
    160 }
    161 .main-navigation .menu-toggle {
    162     display: none;
    163 }
    164 .entry-header .entry-title {
    165     font-size: 22px;
    166 }
    167 #respond form input[type="text"] {
    168     width: 46.333333333%;
    169 }
    170 #respond form textarea.blog-textarea {
    171     width: 79.666666667%;
    172 }
    173 .template-front-page .site-content,
    174 .template-front-page article {
    175     overflow: hidden;
    176 }
    177 .template-front-page.has-post-thumbnail article {
    178     float: left;
    179     width: 47.916666667%;
    180 }
    181 .entry-page-image {
    182     float: right;
    183     margin-bottom: 0;
    184     width: 47.916666667%;
    185 }
    186 /* IE Front Page Template Widget fix */
    187 .template-front-page .widget-area {
    188     clear: both;
    189 }
    190 .template-front-page .widget {
    191     width: 100% !important;
    192     border: none;
    193 }
    194 .template-front-page .widget-area .widget,
    195 .template-front-page .first.front-widgets,
    196 .template-front-page.two-sidebars .widget-area .front-widgets {
    197     float: left;
    198     margin-bottom: 24px;
    199     width: 51.875%;
    200 }
    201 .template-front-page .second.front-widgets,
    202 .template-front-page .widget-area .widget:nth-child(odd) {
    203     clear: right;
    204 }
    205 .template-front-page .first.front-widgets,
    206 .template-front-page .second.front-widgets,
    207 .template-front-page.two-sidebars .widget-area .front-widgets + .front-widgets {
    208     float: right;
    209     margin: 0 0 24px;
    210     width: 39.0625%;
    211 }
    212 .template-front-page.two-sidebars .widget,
    213 .template-front-page.two-sidebars .widget:nth-child(even) {
    214     float: none;
    215     width: auto;
    216 }
    217 /* add input font for <IE9 Password Box to make the bullets show up */
    218 input[type="password"] {
    219     font-family: Helvetica, Arial, sans-serif;
    220 }
    221 
    222 /* RTL overrides for IE7 and IE8
    223 -------------------------------------------------------------- */
    224 .rtl .site-header h1,
    225 .rtl .site-header h2 {
    226     text-align: right;
    227 }
    228 .rtl .widget-area,
    229 .rtl .author-description {
    230     float: left;
    231 }
    232 .rtl .author-avatar,
    233 .rtl .site-content {
    234     float: right;
    235 }
    236 .rtl .main-navigation ul.nav-menu,
    237 .rtl .main-navigation div.nav-menu > ul {
    238     text-align: right;
    239 }
    240 .rtl .main-navigation ul li ul li,
    241 .rtl .main-navigation ul li ul li ul li {
    242     margin-left: 40px;
    243     margin-right: auto;
    244 }
    245 .rtl .main-navigation li ul ul {
    246     position: absolute;
    247     bottom: 0;
    248     right: 100%;
    249     z-index: 1;
    250 }
    251 .ie7 .rtl .main-navigation li ul ul {
    252     position: absolute;
    253     bottom: 0;
    254     right: 100%;
    255     z-index: 1;
    256 }
    257 .ie7 .rtl .main-navigation ul li {
    258     z-index: 99;
    259 }
    260 .ie7 .rtl .main-navigation li ul {
    261     position: absolute;
    262     bottom: 100%;
    263     right: 0;
    264     z-index: 1;
    265 }
    266 .ie7 .rtl .main-navigation li {
    267     margin-right: auto;
    268     margin-left: 40px;
    269 }
    270 .ie7 .rtl .main-navigation li ul ul ul {
    271     position: relative;
    272     z-index: 1;
    273 }
     1/* This theme does not support Internet Explorer since version 4.7. */
  • trunk/src/wp-content/themes/twentytwelve/editor-style.css

    r58816 r60961  
    300300    max-width: 100%;
    301301}
    302 img.size-full {
    303     width: auto/9; /* Prevent stretching of full-size images in IE8 */
    304 }
    305302img[class*="wp-image-"] {
    306303    height: auto;
  • trunk/src/wp-content/themes/twentytwelve/functions.php

    r60514 r60961  
    218218    wp_enqueue_style( 'twentytwelve-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentytwelve-style' ), '20240812' );
    219219
    220     // Loads the Internet Explorer specific stylesheet.
    221     wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20240722' );
    222     $wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' );
     220    // Register the Internet Explorer specific stylesheet.
     221    wp_register_style( 'twentytwelve-ie', false, array( 'twentytwelve-style' ) );
    223222}
    224223add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
  • trunk/src/wp-content/themes/twentytwelve/header.php

    r60483 r60961  
    1010 */
    1111?><!DOCTYPE html>
    12 <!--[if IE 7]>
    13 <html class="ie ie7" <?php language_attributes(); ?>>
    14 <![endif]-->
    15 <!--[if IE 8]>
    16 <html class="ie ie8" <?php language_attributes(); ?>>
    17 <![endif]-->
    18 <!--[if !(IE 7) & !(IE 8)]><!-->
    1912<html <?php language_attributes(); ?>>
    20 <!--<![endif]-->
    2113<head>
    2214<meta charset="<?php bloginfo( 'charset' ); ?>" />
     
    2517<link rel="profile" href="https://gmpg.org/xfn/11" />
    2618<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
    27 <?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
    28 <!--[if lt IE 9]>
    29 <script src="<?php echo esc_url( get_template_directory_uri() ); ?>/js/html5.js?ver=3.7.0" type="text/javascript"></script>
    30 <![endif]-->
    3119<?php wp_head(); ?>
    3220</head>
  • trunk/src/wp-content/themes/twentytwelve/js/html5.js

    r27263 r60961  
    1 /*
    2  HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
    3 */
    4 (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();
    5 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>";
    6 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||
    7 "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);
    8 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);
     1// This theme does not support Internet Explorer since version 4.7.
  • trunk/src/wp-content/themes/twentytwelve/readme.txt

    r60456 r60961  
    3939Twenty Twelve Theme bundles the following third-party resources:
    4040
    41 HTML5 Shiv v3.7.0, Copyright 2014 Alexander Farkas
    42 Licenses: MIT/GPL2
    43 Source: https://github.com/aFarkas/html5shiv
    44 
    4541Open Sans Font
    4642Copyright 2020 The Open Sans Project Authors (https://github.com/googlefonts/opensans)
Note: See TracChangeset for help on using the changeset viewer.