|
1 | 1 | /*!
|
2 |
| - * jQuery Migrate - v3.3.0 - 2020-05-05T01:57Z |
| 2 | + * jQuery Migrate - v3.3.1 - 2020-06-25T01:07Z |
3 | 3 | * Copyright OpenJS Foundation and other contributors
|
4 | 4 | */
|
5 | 5 | ( function( factory ) {
|
|
24 | 24 | } )( function( jQuery, window ) {
|
25 | 25 | "use strict";
|
26 | 26 |
|
27 |
| -jQuery.migrateVersion = "3.3.0"; |
| 27 | +jQuery.migrateVersion = "3.3.1"; |
28 | 28 |
|
29 | 29 | // Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
|
30 | 30 | function compareVersions( v1, v2 ) {
|
@@ -469,14 +469,19 @@ function isAutoPx( prop ) {
|
469 | 469 | oldFnCss = jQuery.fn.css;
|
470 | 470 |
|
471 | 471 | 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 ) ) { |
474 | 475 | jQuery.each( name, function( n, v ) {
|
475 | 476 | jQuery.fn.css.call( origThis, n, v );
|
476 | 477 | } );
|
477 | 478 | }
|
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 | + } |
480 | 485 | }
|
481 | 486 |
|
482 | 487 | return oldFnCss.apply( this, arguments );
|
@@ -725,19 +730,11 @@ jQuery.htmlPrefilter = function( html ) {
|
725 | 730 | var oldOffset = jQuery.fn.offset;
|
726 | 731 |
|
727 | 732 | jQuery.fn.offset = function() {
|
728 |
| - var docElem, |
729 |
| - elem = this[ 0 ], |
730 |
| - bogus = { top: 0, left: 0 }; |
| 733 | + var elem = this[ 0 ]; |
731 | 734 |
|
732 |
| - if ( !elem || !elem.nodeType ) { |
| 735 | + if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) { |
733 | 736 | 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; |
741 | 738 | }
|
742 | 739 |
|
743 | 740 | return oldOffset.apply( this, arguments );
|
|
0 commit comments