<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[46164] trunk: Script Loader: Introduce HTML5 support for scripts and styles.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/46164">46164</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/46164","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-09-18 14:49:30 +0000 (Wed, 18 Sep 2019)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Script Loader: Introduce HTML5 support for scripts and styles.
When a theme declares HTML5 support for script and styles via `add_theme_support( 'html5', array( 'script', 'style' ) )`, the `type="text/javascript"` and `type="text/css"` attributes are omitted.
These attributes are unnecessary in HTML5 and cause warnings in the W3C Markup Validation Service.
Props sasiddiqui, swissspidy, knutsp, SergeyBiryukov.
See <a href="https://core.trac.wordpress.org/ticket/42804">#42804</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesadminbarphp">trunk/src/wp-includes/admin-bar.php</a></li>
<li><a href="#trunksrcwpincludesclasswpscriptsphp">trunk/src/wp-includes/class.wp-scripts.php</a></li>
<li><a href="#trunksrcwpincludesclasswpstylesphp">trunk/src/wp-includes/class.wp-styles.php</a></li>
<li><a href="#trunksrcwpincludesembedphp">trunk/src/wp-includes/embed.php</a></li>
<li><a href="#trunksrcwpincludesformattingphp">trunk/src/wp-includes/formatting.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
<li><a href="#trunksrcwpincludesthemephp">trunk/src/wp-includes/theme.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetarchivesphp">trunk/src/wp-includes/widgets/class-wp-widget-archives.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetcategoriesphp">trunk/src/wp-includes/widgets/class-wp-widget-categories.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsclasswpwidgetrecentcommentsphp">trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php</a></li>
<li><a href="#trunktestsphpunittestsdependenciesscriptsphp">trunk/tests/phpunit/tests/dependencies/scripts.php</a></li>
<li><a href="#trunktestsphpunittestsdependenciesstylesphp">trunk/tests/phpunit/tests/dependencies/styles.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesadminbarphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/admin-bar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/admin-bar.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/admin-bar.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1117,8 +1117,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_admin_bar_header() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<style type="text/css" media="print">#wpadminbar { display:none; }</style>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1128,9 +1129,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _admin_bar_bump_cb() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<style type="text/css" media="screen">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<style<?php echo $type_attr; ?> media="screen">
</ins><span class="cx" style="display: block; padding: 0 10px"> html { margin-top: 32px !important; }
</span><span class="cx" style="display: block; padding: 0 10px"> * html body { margin-top: 32px !important; }
</span><span class="cx" style="display: block; padding: 0 10px"> @media screen and ( max-width: 782px ) {
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpscriptsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class.wp-scripts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class.wp-scripts.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/class.wp-scripts.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,6 +123,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $default_dirs;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Holds a string which contains the type attribute for script tag.
+ *
+ * If the current theme does not declare HTML5 support for 'script',
+ * then it initializes as `type='text/javascript'`.
+ *
+ * @since 5.3.0
+ * @var string
+ */
+ private $type_attr = '';
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Constructor.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.6.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -130,6 +141,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct() {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->init();
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'init', array( $this, 'init' ), 0 );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( ! current_theme_supports( 'html5', 'script' ) ) {
+ $this->type_attr = " type='text/javascript'";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +220,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo "<script{$this->type_attr}>\n"; // CDATA and type="text/javascript" is not needed for HTML 5.
</ins><span class="cx" style="display: block; padding: 0 10px"> echo "/* <![CDATA[ */\n";
</span><span class="cx" style="display: block; padding: 0 10px"> echo "$output\n";
</span><span class="cx" style="display: block; padding: 0 10px"> echo "/* ]]> */\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,15 +281,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $after_handle = $this->print_inline_script( $handle, 'after', false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $before_handle ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $before_handle = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $before_handle );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $before_handle = sprintf( "<script%s>\n%s\n</script>\n", $this->type_attr, $before_handle );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $after_handle ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $after_handle = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $after_handle );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $after_handle = sprintf( "<script%s>\n%s\n</script>\n", $this->type_attr, $after_handle );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $before_handle || $after_handle ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $inline_script_tag = "{$cond_before}{$before_handle}{$after_handle}{$cond_after}";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $inline_script_tag = $cond_before . $before_handle . $after_handle . $cond_after;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $inline_script_tag = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,7 +349,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $translations = $this->print_translations( $handle, false );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $translations ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $translations = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $translations );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $translations = sprintf( "<script%s>\n%s\n</script>\n", $this->type_attr, $translations );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,7 +367,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tag = "{$translations}{$cond_before}{$before_handle}<script type='text/javascript' src='$src'></script>\n{$after_handle}{$cond_after}";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tag = $translations . $cond_before . $before_handle;
+ $tag .= sprintf( "<script%s src='%s'></script>\n", $this->type_attr, $src );
+ $tag .= $after_handle . $cond_after;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the HTML script tag of an enqueued script.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -422,7 +439,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $output = trim( implode( "\n", $output ), "\n" );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $echo ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf( "<script type='text/javascript'>\n%s\n</script>\n", $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ printf( "<script%s>\n%s\n</script>\n", $this->type_attr, $output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -557,7 +574,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> JS;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $echo ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf( "<script type='text/javascript'>\n%s\n</script>\n", $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ printf( "<script%s>\n%s\n</script>\n", $this->type_attr, $output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpstylesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class.wp-styles.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class.wp-styles.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/class.wp-styles.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,6 +101,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $default_dirs;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Holds a string which contains the type attribute for style tag.
+ *
+ * If the current theme does not declare HTML5 support for 'style',
+ * then it initializes as `type='text/css'`.
+ *
+ * @since 5.3.0
+ * @var string
+ */
+ private $type_attr = '';
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Constructor.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.6.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,6 +125,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Styles $this WP_Styles instance (passed by reference).
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action_ref_array( 'wp_default_styles', array( &$this ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( ! current_theme_supports( 'html5', 'style' ) ) {
+ $this->type_attr = " type='text/css'";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +171,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $inline_style = $this->print_inline_style( $handle, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $inline_style ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $inline_style_tag = sprintf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $inline_style );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $inline_style_tag = sprintf(
+ "<style id='%s-inline-css'%s>\n%s\n</style>\n",
+ esc_attr( $handle ),
+ $this->type_attr,
+ $inline_style
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $inline_style_tag = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -197,9 +217,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $rel = isset( $obj->extra['alt'] ) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = isset( $obj->extra['title'] ) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $title = isset( $obj->extra['title'] ) ? sprintf( "title='%s'", esc_attr( $obj->extra['title'] ) ) : '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tag = "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tag = sprintf(
+ "<link rel='%s' id='%s-css' %s href='%s'%s media='%s' />\n",
+ $rel,
+ $handle,
+ $title,
+ $href,
+ $this->type_attr,
+ $media
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the HTML link tag of an enqueued style.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,7 +251,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $rtl_tag = "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $rtl_tag = sprintf(
+ "<link rel='%s' id='%s-rtl-css' %s href='%s'%s media='%s' />\n",
+ $rel,
+ $handle,
+ $title,
+ $rtl_href,
+ $this->type_attr,
+ $media
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/class.wp-styles.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,7 +335,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ printf(
+ "<style id='%s-inline-css'%s>\n%s\n</style>\n",
+ esc_attr( $handle ),
+ $this->type_attr,
+ $output
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesembedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/embed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/embed.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/embed.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1000,8 +1000,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function print_embed_styles() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <style type="text/css">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <style<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( SCRIPT_DEBUG ) {
</span><span class="cx" style="display: block; padding: 0 10px"> readfile( ABSPATH . WPINC . '/css/wp-embed-template.css' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1031,8 +1032,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function print_embed_scripts() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <script type="text/javascript">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <script<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( SCRIPT_DEBUG ) {
</span><span class="cx" style="display: block; padding: 0 10px"> readfile( ABSPATH . WPINC . '/js/wp-embed-template.js' );
</span></span></pre></div>
<a id="trunksrcwpincludesformattingphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/formatting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/formatting.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/formatting.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5435,8 +5435,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $printed = true;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<style type="text/css">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<style<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> img.wp-smiley,
</span><span class="cx" style="display: block; padding: 0 10px"> img.emoji {
</span><span class="cx" style="display: block; padding: 0 10px"> display: inline !important;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5517,7 +5519,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'svgExt' => apply_filters( 'emoji_svg_ext', '.svg' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $version = 'ver=' . get_bloginfo( 'version' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $version = 'ver=' . get_bloginfo( 'version' );
+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/javascript"';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( SCRIPT_DEBUG ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $settings['source'] = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5528,7 +5531,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <script type="text/javascript">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <script<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
</span><span class="cx" style="display: block; padding: 0 10px"> <?php readfile( ABSPATH . WPINC . '/js/wp-emoji-loader.js' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </script>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5550,7 +5553,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * and edit wp-emoji-loader.js directly.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <script type="text/javascript">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <script<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
</span><span class="cx" style="display: block; padding: 0 10px"> include "js/wp-emoji-loader.min.js"
</span><span class="cx" style="display: block; padding: 0 10px"> </script>
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/media.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1944,8 +1944,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Otherwise, defaults to true.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $gallery_style = "
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <style type='text/css'>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <style{$type_attr}>
</ins><span class="cx" style="display: block; padding: 0 10px"> #{$selector} {
</span><span class="cx" style="display: block; padding: 0 10px"> margin: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/script-loader.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2465,11 +2465,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $zip = 'gzip';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $concat = trim( $wp_scripts->concat, ', ' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $concat = trim( $wp_scripts->concat, ', ' );
+ $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : " type='text/javascript'";
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $concat ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $wp_scripts->print_code ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "\n<script type='text/javascript'>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo "\n<script{$type_attr}>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> echo "/* <![CDATA[ */\n"; // not needed in HTML 5
</span><span class="cx" style="display: block; padding: 0 10px"> echo $wp_scripts->print_code;
</span><span class="cx" style="display: block; padding: 0 10px"> echo "/* ]]> */\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2484,7 +2485,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}" . $concatenated . '&ver=' . $wp_scripts->default_version;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<script type='text/javascript' src='" . esc_attr( $src ) . "'></script>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo "<script{$type_attr} src='" . esc_attr( $src ) . "'></script>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $wp_scripts->print_html ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2646,7 +2647,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $zip = 'gzip';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $concat = trim( $wp_styles->concat, ', ' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $concat = trim( $wp_styles->concat, ', ' );
+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $concat ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = $wp_styles->text_direction;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2660,10 +2662,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}" . $concatenated . '&ver=' . $ver;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "' type='text/css' media='all' />\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "'{$type_attr} media='all' />\n";
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $wp_styles->print_code ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<style type='text/css'>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo "<style{$type_attr}>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $wp_styles->print_code;
</span><span class="cx" style="display: block; padding: 0 10px"> echo "\n</style>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/theme.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -702,7 +702,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $stylesheet ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
+
+ printf(
+ '<link rel="stylesheet" href="%s"%s media="screen" />',
+ $stylesheet,
+ $type_attr
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1641,7 +1648,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $background && ! $color ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_customize_preview() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<style type="text/css" id="custom-background-css"></style>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
+ printf( '<style%s id="custom-background-css"></style>', $type_attr );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1693,9 +1701,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment = " background-attachment: $attachment;";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $style .= $image . $position . $size . $repeat . $attachment;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<style type="text/css" id="custom-background-css">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<style<?php echo $type_attr; ?> id="custom-background-css">
</ins><span class="cx" style="display: block; padding: 0 10px"> body.custom-background { <?php echo trim( $style ); ?> }
</span><span class="cx" style="display: block; padding: 0 10px"> </style>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1709,8 +1719,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_custom_css_cb() {
</span><span class="cx" style="display: block; padding: 0 10px"> $styles = wp_get_custom_css();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $styles || is_customize_preview() ) :
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <style type="text/css" id="wp-custom-css">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <style<?php echo $type_attr; ?> id="wp-custom-css">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php echo strip_tags( $styles ); // Note that esc_html() cannot be used because `div > span` is not interpreted properly. ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </style>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2335,14 +2346,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * ) );
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 3.6.0 The `html5` feature was added
- * @since 3.9.0 The `html5` feature now also accepts 'gallery' and 'caption'
- * @since 4.1.0 The `title-tag` feature was added
- * @since 4.5.0 The `customize-selective-refresh-widgets` feature was added
- * @since 4.7.0 The `starter-content` feature was added
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 3.6.0 The `html5` feature was added.
+ * @since 3.9.0 The `html5` feature now also accepts 'gallery' and 'caption'.
+ * @since 4.1.0 The `title-tag` feature was added.
+ * @since 4.5.0 The `customize-selective-refresh-widgets` feature was added.
+ * @since 4.7.0 The `starter-content` feature was added.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0 The `responsive-embeds`, `align-wide`, `dark-editor-style`, `disable-custom-colors`,
</span><span class="cx" style="display: block; padding: 0 10px"> * `disable-custom-font-sizes`, `editor-color-palette`, `editor-font-sizes`,
</span><span class="cx" style="display: block; padding: 0 10px"> * `editor-styles`, and `wp-block-styles` features were added.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 5.3.0 The `html5` feature now also accepts 'script' and 'style'.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $_wp_theme_features
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2635,9 +2647,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $classes = array_map( 'sanitize_html_class', $classes );
</span><span class="cx" style="display: block; padding: 0 10px"> $classes = '.' . implode( ', .', $classes );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- Custom Logo: hide header text -->
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <style id="custom-logo-css" type="text/css">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <style id="custom-logo-css"<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php echo $classes; ?> {
</span><span class="cx" style="display: block; padding: 0 10px"> position: absolute;
</span><span class="cx" style="display: block; padding: 0 10px"> clip: rect(1px, 1px, 1px, 1px);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3196,15 +3209,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $admin_origin = parse_url( admin_url() );
</span><span class="cx" style="display: block; padding: 0 10px"> $home_origin = parse_url( home_url() );
</span><span class="cx" style="display: block; padding: 0 10px"> $cross_domain = ( strtolower( $admin_origin['host'] ) != strtolower( $home_origin['host'] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <!--[if lte IE 8]>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <script type="text/javascript">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <script<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> document.body.className = document.body.className.replace( /(^|\s)(no-)?customize-support(?=\s|$)/, '' ) + ' no-customize-support';
</span><span class="cx" style="display: block; padding: 0 10px"> </script>
</span><span class="cx" style="display: block; padding: 0 10px"> <![endif]-->
</span><span class="cx" style="display: block; padding: 0 10px"> <!--[if gte IE 9]><!-->
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <script type="text/javascript">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <script<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> (function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetarchivesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-archives.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-archives.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/widgets/class-wp-widget-archives.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,6 +98,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $label = __( 'Select Post' );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <option value=""><?php echo esc_attr( $label ); ?></option>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> </select>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<script type='text/javascript'>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<script<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> /* <![CDATA[ */
</span><span class="cx" style="display: block; padding: 0 10px"> (function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var dropdown = document.getElementById( "<?php echo esc_js( $dropdown_id ); ?>" );
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetcategoriesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-categories.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-categories.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/widgets/class-wp-widget-categories.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -89,9 +89,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args, $instance ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</form>';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<script type='text/javascript'>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<script<?php echo $type_attr; ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> /* <![CDATA[ */
</span><span class="cx" style="display: block; padding: 0 10px"> (function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var dropdown = document.getElementById( "<?php echo esc_js( $dropdown_id ); ?>" );
</span></span></pre></div>
<a id="trunksrcwpincludeswidgetsclasswpwidgetrecentcommentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,9 +53,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> || ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
+
+ printf(
+ '<style%s>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>',
+ $type_attr
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsdependenciesscriptsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/dependencies/scripts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dependencies/scripts.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/tests/phpunit/tests/dependencies/scripts.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,6 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'empty-deps-no-version', 'example.com' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'empty-deps-version', 'example.com', array(), 1.2 );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'empty-deps-null-version', 'example.com', array(), null );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $ver = get_bloginfo( 'version' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<script type='text/javascript' src='http://example.com?ver=$ver'></script>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<script type='text/javascript' src='http://example.com?ver=$ver'></script>\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,6 +58,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 42804
+ */
+ function test_wp_enqueue_script_with_html5_support_does_not_contain_type_attribute() {
+ add_theme_support( 'html5', array( 'script' ) );
+
+ $GLOBALS['wp_scripts'] = new WP_Scripts();
+ $GLOBALS['wp_scripts']->default_version = get_bloginfo( 'version' );
+
+ wp_enqueue_script( 'empty-deps-no-version', 'example.com' );
+
+ $ver = get_bloginfo( 'version' );
+ $expected = "<script src='http://example.com?ver=$ver'></script>\n";
+
+ $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Test the different protocol references in wp_enqueue_script
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global WP_Scripts $wp_scripts
</span></span></pre></div>
<a id="trunktestsphpunittestsdependenciesstylesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/dependencies/styles.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/dependencies/styles.php 2019-09-18 12:24:35 UTC (rev 46163)
+++ trunk/tests/phpunit/tests/dependencies/styles.php 2019-09-18 14:49:30 UTC (rev 46164)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,6 +56,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'no-deps-version', 'example.com', array(), 1.2 );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'no-deps-null-version', 'example.com', array(), null );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'no-deps-null-version-print-media', 'example.com', array(), null, 'print' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $ver = get_bloginfo( 'version' );
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = "<link rel='stylesheet' id='no-deps-no-version-css' href='http://example.com?ver=$ver' type='text/css' media='all' />\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $expected .= "<link rel='stylesheet' id='no-deps-version-css' href='http://example.com?ver=1.2' type='text/css' media='all' />\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,6 +70,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 42804
+ */
+ function test_wp_enqueue_style_with_html5_support_does_not_contain_type_attribute() {
+ add_theme_support( 'html5', array( 'style' ) );
+
+ $GLOBALS['wp_styles'] = new WP_Styles();
+ $GLOBALS['wp_styles']->default_version = get_bloginfo( 'version' );
+
+ wp_enqueue_style( 'no-deps-no-version', 'example.com' );
+
+ $ver = get_bloginfo( 'version' );
+ $expected = "<link rel='stylesheet' id='no-deps-no-version-css' href='http://example.com?ver=$ver' media='all' />\n";
+
+ $this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Test the different protocol references in wp_enqueue_style
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global WP_Styles $wp_styles
</span></span></pre>
</div>
</div>
</body>
</html>