Skip to content

Commit fd23c97

Browse files
committed
Merge branch 'trunk' into html-api/minimal-html-processor
2 parents 6ba5b39 + 12f854c commit fd23c97

42 files changed

Lines changed: 901 additions & 470 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/js/_enqueues/vendor/jquery/jquery-migrate.js

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Migrate - v3.4.0 - 2022-03-24T16:30Z
2+
* jQuery Migrate - v3.4.1 - 2023-02-23T15:31Z
33
* Copyright OpenJS Foundation and other contributors
44
*/
55
( function( factory ) {
@@ -24,7 +24,7 @@
2424
} )( function( jQuery, window ) {
2525
"use strict";
2626

27-
jQuery.migrateVersion = "3.4.0";
27+
jQuery.migrateVersion = "3.4.1";
2828

2929
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
3030
function compareVersions( v1, v2 ) {
@@ -91,9 +91,10 @@ jQuery.migrateIsPatchEnabled = function( patchCode ) {
9191
return;
9292
}
9393

94-
// Need jQuery 3.0.0+ and no older Migrate loaded
95-
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) {
96-
window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
94+
// Need jQuery 3.x-4.x and no older Migrate loaded
95+
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ||
96+
jQueryVersionSince( "5.0.0" ) ) {
97+
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" );
9798
}
9899
if ( jQuery.migrateWarnings ) {
99100
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );
@@ -206,9 +207,9 @@ var findProp,
206207
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
207208
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
208209

209-
// Support: Android <=4.0 only
210-
// Make sure we trim BOM and NBSP
211-
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
210+
// Require that the "whitespace run" starts from a non-whitespace
211+
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
212+
rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
212213

213214
migratePatchFunc( jQuery.fn, "init", function( arg1 ) {
214215
var args = Array.prototype.slice.call( arguments );
@@ -300,7 +301,7 @@ if ( jQueryVersionSince( "3.1.1" ) ) {
300301
migratePatchAndWarnFunc( jQuery, "trim", function( text ) {
301302
return text == null ?
302303
"" :
303-
( text + "" ).replace( rtrim, "" );
304+
( text + "" ).replace( rtrim, "$1" );
304305
}, "trim",
305306
"jQuery.trim is deprecated; use String.prototype.trim" );
306307
}
@@ -419,10 +420,24 @@ var oldRemoveAttr = jQuery.fn.removeAttr,
419420
rmatchNonSpace = /\S+/g;
420421

421422
migratePatchFunc( jQuery.fn, "removeAttr", function( name ) {
422-
var self = this;
423+
var self = this,
424+
patchNeeded = false;
423425

424426
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
425427
if ( jQuery.expr.match.bool.test( attr ) ) {
428+
429+
// Only warn if at least a single node had the property set to
430+
// something else than `false`. Otherwise, this Migrate patch
431+
// doesn't influence the behavior and there's no need to set or warn.
432+
self.each( function() {
433+
if ( jQuery( this ).prop( attr ) !== false ) {
434+
patchNeeded = true;
435+
return false;
436+
}
437+
} );
438+
}
439+
440+
if ( patchNeeded ) {
426441
migrateWarn( "removeAttr-bool",
427442
"jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
428443
self.prop( attr, false );
@@ -470,7 +485,7 @@ function camelCase( string ) {
470485
} );
471486
}
472487

473-
var origFnCss,
488+
var origFnCss, internalCssNumber,
474489
internalSwapCall = false,
475490
ralphaStart = /^[a-z]/,
476491

@@ -552,8 +567,11 @@ if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) {
552567
// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233
553568
// This way, number values for the CSS properties below won't start triggering
554569
// Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438).
555-
if ( jQueryVersionSince( "4.0.0" ) && typeof Proxy !== "undefined" ) {
556-
jQuery.cssNumber = new Proxy( {
570+
if ( jQueryVersionSince( "4.0.0" ) ) {
571+
572+
// We need to keep this as a local variable as we need it internally
573+
// in a `jQuery.fn.css` patch and this usage shouldn't warn.
574+
internalCssNumber = {
557575
animationIterationCount: true,
558576
columnCount: true,
559577
fillOpacity: true,
@@ -574,16 +592,31 @@ if ( jQueryVersionSince( "4.0.0" ) && typeof Proxy !== "undefined" ) {
574592
widows: true,
575593
zIndex: true,
576594
zoom: true
577-
}, {
578-
get: function() {
579-
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
580-
return Reflect.get.apply( this, arguments );
581-
},
582-
set: function() {
583-
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
584-
return Reflect.set.apply( this, arguments );
585-
}
586-
} );
595+
};
596+
597+
if ( typeof Proxy !== "undefined" ) {
598+
jQuery.cssNumber = new Proxy( internalCssNumber, {
599+
get: function() {
600+
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
601+
return Reflect.get.apply( this, arguments );
602+
},
603+
set: function() {
604+
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
605+
return Reflect.set.apply( this, arguments );
606+
}
607+
} );
608+
} else {
609+
610+
// Support: IE 9-11+
611+
// IE doesn't support proxies, but we still want to restore the legacy
612+
// jQuery.cssNumber there.
613+
jQuery.cssNumber = internalCssNumber;
614+
}
615+
} else {
616+
617+
// Make `internalCssNumber` defined for jQuery <4 as well as it's needed
618+
// in the `jQuery.fn.css` patch below.
619+
internalCssNumber = jQuery.cssNumber;
587620
}
588621

589622
function isAutoPx( prop ) {
@@ -610,7 +643,10 @@ migratePatchFunc( jQuery.fn, "css", function( name, value ) {
610643

611644
if ( typeof value === "number" ) {
612645
camelName = camelCase( name );
613-
if ( !isAutoPx( camelName ) && !jQuery.cssNumber[ camelName ] ) {
646+
647+
// Use `internalCssNumber` to avoid triggering our warnings in this
648+
// internal check.
649+
if ( !isAutoPx( camelName ) && !internalCssNumber[ camelName ] ) {
614650
migrateWarn( "css-number",
615651
"Number-typed values are deprecated for jQuery.fn.css( \"" +
616652
name + "\", value )" );

src/js/_enqueues/vendor/jquery/jquery-migrate.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/wp-admin/css/dashboard.css

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -889,31 +889,32 @@ body #dashboard-widgets .postbox form .submit {
889889

890890
#future-posts ul,
891891
#published-posts ul {
892-
clear: both;
893-
margin-bottom: 0;
892+
margin: 8px -12px 0 -12px;
894893
}
895894

896895
#future-posts li,
897896
#published-posts li {
898-
margin-bottom: 8px;
897+
display: grid;
898+
grid-template-columns: clamp(160px, calc(2vw + 140px), 200px) auto;
899+
column-gap: 10px;
900+
color: #646970;
901+
padding: 4px 12px;
899902
}
900903

901-
#future-posts ul span,
902-
#published-posts ul span {
903-
display: inline-block;
904-
margin-right: 5px;
905-
min-width: 150px;
906-
color: #646970;
904+
#future-posts li:nth-child(odd),
905+
#published-posts li:nth-child(odd) {
906+
background-color: #f6f7f7;
907907
}
908908

909909
.activity-block {
910910
border-bottom: 1px solid #f0f0f1;
911-
margin: 0 -12px;
911+
margin: 0 -12px 6px -12px;
912912
padding: 8px 12px 4px;
913913
}
914914

915915
.activity-block:last-child {
916916
border-bottom: none;
917+
margin-bottom: 0;
917918
}
918919

919920
.activity-block .subsubsub li {

src/wp-admin/includes/class-core-upgrader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function upgrade_strings() {
3030
$this->strings['locked'] = __( 'Another update is currently in progress.' );
3131
$this->strings['no_package'] = __( 'Update package not available.' );
3232
/* translators: %s: Package URL. */
33-
$this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class="code">%s</span>' );
33+
$this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class="code pre">%s</span>' );
3434
$this->strings['unpack_package'] = __( 'Unpacking the update&#8230;' );
3535
$this->strings['copy_failed'] = __( 'Could not copy files.' );
3636
$this->strings['copy_failed_space'] = __( 'Could not copy files. You may have run out of disk space.' );

src/wp-admin/includes/class-custom-background.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ public function __construct( $admin_header_callback = '', $admin_image_div_callb
6363
* @since 3.0.0
6464
*/
6565
public function init() {
66-
$page = add_theme_page( __( 'Background' ), __( 'Background' ), 'edit_theme_options', 'custom-background', array( $this, 'admin_page' ) );
66+
$page = add_theme_page(
67+
_x( 'Background', 'custom background' ),
68+
_x( 'Background', 'custom background' ),
69+
'edit_theme_options',
70+
'custom-background',
71+
array( $this, 'admin_page' )
72+
);
73+
6774
if ( ! $page ) {
6875
return;
6976
}

0 commit comments

Comments
 (0)