Skip to content

Commit d2f577f

Browse files
authored
Tests: Update jQuery Migrate from 3.3.0 to 3.3.1
That upgrade makes UI pass the whole test suite without a single jQuery Migrate warning. 🎉 Closes gh-1932
1 parent bcdaf14 commit d2f577f

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

Gruntfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,8 @@ grunt.initConfig( {
430430
"jquery-migrate-1.4.1/jquery-migrate.js": "jquery-migrate-1.4.1/dist/jquery-migrate.js",
431431
"jquery-migrate-1.4.1/LICENSE.txt": "jquery-migrate-1.4.1/LICENSE.txt",
432432

433-
"jquery-migrate-3.3.0/jquery-migrate.js": "jquery-migrate-3.3.0/dist/jquery-migrate.js",
434-
"jquery-migrate-3.3.0/LICENSE.txt": "jquery-migrate-3.3.0/LICENSE.txt"
433+
"jquery-migrate-3.3.1/jquery-migrate.js": "jquery-migrate-3.3.1/dist/jquery-migrate.js",
434+
"jquery-migrate-3.3.1/LICENSE.txt": "jquery-migrate-3.3.1/LICENSE.txt"
435435
}
436436
}
437437
},

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@
6767
"jquery-3.5.0": "jquery#3.5.0",
6868
"jquery-3.5.1": "jquery#3.5.1",
6969
"jquery-migrate-1.4.1": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-1.4.1.tgz",
70-
"jquery-migrate-3.3.0": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.3.0.tgz"
70+
"jquery-migrate-3.3.1": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.3.1.tgz"
7171
}
7272
}

external/jquery-migrate-3.3.0/jquery-migrate.js renamed to external/jquery-migrate-3.3.1/jquery-migrate.js

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Migrate - v3.3.0 - 2020-05-05T01:57Z
2+
* jQuery Migrate - v3.3.1 - 2020-06-25T01:07Z
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.3.0";
27+
jQuery.migrateVersion = "3.3.1";
2828

2929
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
3030
function compareVersions( v1, v2 ) {
@@ -469,14 +469,19 @@ function isAutoPx( prop ) {
469469
oldFnCss = jQuery.fn.css;
470470

471471
jQuery.fn.css = function( name, value ) {
472-
var origThis = this;
473-
if ( typeof name !== "string" ) {
472+
var camelName,
473+
origThis = this;
474+
if ( name && typeof name === "object" && !Array.isArray( name ) ) {
474475
jQuery.each( name, function( n, v ) {
475476
jQuery.fn.css.call( origThis, n, v );
476477
} );
477478
}
478-
if ( typeof value === "number" && !isAutoPx( camelCase( name ) ) ) {
479-
migrateWarn( "Use of number-typed values is deprecated in jQuery.fn.css" );
479+
if ( typeof value === "number" ) {
480+
camelName = camelCase( name );
481+
if ( !isAutoPx( camelName ) && !jQuery.cssNumber[ camelName ] ) {
482+
migrateWarn( "Number-typed values are deprecated for jQuery.fn.css( \"" +
483+
name + "\", value )" );
484+
}
480485
}
481486

482487
return oldFnCss.apply( this, arguments );
@@ -725,19 +730,11 @@ jQuery.htmlPrefilter = function( html ) {
725730
var oldOffset = jQuery.fn.offset;
726731

727732
jQuery.fn.offset = function() {
728-
var docElem,
729-
elem = this[ 0 ],
730-
bogus = { top: 0, left: 0 };
733+
var elem = this[ 0 ];
731734

732-
if ( !elem || !elem.nodeType ) {
735+
if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) {
733736
migrateWarn( "jQuery.fn.offset() requires a valid DOM element" );
734-
return undefined;
735-
}
736-
737-
docElem = ( elem.ownerDocument || window.document ).documentElement;
738-
if ( !jQuery.contains( docElem, elem ) ) {
739-
migrateWarn( "jQuery.fn.offset() requires an element connected to a document" );
740-
return bogus;
737+
return arguments.length ? this : undefined;
741738
}
742739

743740
return oldOffset.apply( this, arguments );

tests/lib/bootstrap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function migrateUrl() {
123123
if ( jqueryVersion === "git" ) {
124124
url = "https://code.jquery.com/jquery-migrate-git";
125125
} else if ( jqueryVersion[ 0 ] === "3" ) {
126-
url = "../../../external/jquery-migrate-3.3.0/jquery-migrate";
126+
url = "../../../external/jquery-migrate-3.3.1/jquery-migrate";
127127
} else if ( jqueryVersion[ 0 ] === "1" || jqueryVersion[ 0 ] === "2" ) {
128128
url = "../../../external/jquery-migrate-1.4.1/jquery-migrate";
129129
} else if ( jqueryVersion === "custom" ) {

0 commit comments

Comments
 (0)