Skip to content

Commit

Permalink
Update jQuery to 3.2.1
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information
MauricioFauth committed Jun 12, 2017
1 parent de2a81d commit 5346c7d
Show file tree
Hide file tree
Showing 23 changed files with 255 additions and 159 deletions.
8 changes: 4 additions & 4 deletions js/jquery/jquery.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions js/jquery/src/jquery/attributes/attr.js
@@ -1,10 +1,11 @@
define( [
"../core",
"../core/access",
"../core/nodeName",
"./support",
"../var/rnothtmlwhite",
"../selector"
], function( jQuery, access, support, rnothtmlwhite ) {
], function( jQuery, access, nodeName, support, rnothtmlwhite ) {

"use strict";

Expand Down Expand Up @@ -74,7 +75,7 @@ jQuery.extend( {
type: {
set: function( elem, value ) {
if ( !support.radioValue && value === "radio" &&
jQuery.nodeName( elem, "input" ) ) {
nodeName( elem, "input" ) ) {
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
Expand Down
10 changes: 6 additions & 4 deletions js/jquery/src/jquery/attributes/val.js
Expand Up @@ -2,8 +2,10 @@ define( [
"../core",
"../core/stripAndCollapse",
"./support",
"../core/nodeName",

"../core/init"
], function( jQuery, stripAndCollapse, support ) {
], function( jQuery, stripAndCollapse, support, nodeName ) {

"use strict";

Expand Down Expand Up @@ -62,7 +64,7 @@ jQuery.fn.extend( {
} else if ( typeof val === "number" ) {
val += "";

} else if ( jQuery.isArray( val ) ) {
} else if ( Array.isArray( val ) ) {
val = jQuery.map( val, function( value ) {
return value == null ? "" : value + "";
} );
Expand Down Expand Up @@ -121,7 +123,7 @@ jQuery.extend( {
// Don't return options that are disabled or in a disabled optgroup
!option.disabled &&
( !option.parentNode.disabled ||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
!nodeName( option.parentNode, "optgroup" ) ) ) {

// Get the specific value for the option
value = jQuery( option ).val();
Expand Down Expand Up @@ -173,7 +175,7 @@ jQuery.extend( {
jQuery.each( [ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
if ( Array.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/jquery/src/jquery/callbacks.js
Expand Up @@ -69,7 +69,7 @@ jQuery.Callbacks = function( options ) {
fire = function() {

// Enforce single-firing
locked = options.once;
locked = locked || options.once;

// Execute callbacks for all pending executions,
// respecting firingIndex overrides and runtime changes
Expand Down
12 changes: 3 additions & 9 deletions js/jquery/src/jquery/core.js
Expand Up @@ -24,7 +24,7 @@ define( [
"use strict";

var
version = "3.1.1",
version = "3.2.1",

// Define a local copy of jQuery
jQuery = function( selector, context ) {
Expand Down Expand Up @@ -172,11 +172,11 @@ jQuery.extend = jQuery.fn.extend = function() {

// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
( copyIsArray = jQuery.isArray( copy ) ) ) ) {
( copyIsArray = Array.isArray( copy ) ) ) ) {

if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray( src ) ? src : [];
clone = src && Array.isArray( src ) ? src : [];

} else {
clone = src && jQuery.isPlainObject( src ) ? src : {};
Expand Down Expand Up @@ -215,8 +215,6 @@ jQuery.extend( {
return jQuery.type( obj ) === "function";
},

isArray: Array.isArray,

isWindow: function( obj ) {
return obj != null && obj === obj.window;
},
Expand Down Expand Up @@ -291,10 +289,6 @@ jQuery.extend( {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},

nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},

each: function( obj, callback ) {
var length, i = 0;

Expand Down
1 change: 1 addition & 0 deletions js/jquery/src/jquery/core/init.js
Expand Up @@ -3,6 +3,7 @@ define( [
"../core",
"../var/document",
"./var/rsingleTag",

"../traversing/findFilter"
], function( jQuery, document, rsingleTag ) {

Expand Down
13 changes: 13 additions & 0 deletions js/jquery/src/jquery/core/nodeName.js
@@ -0,0 +1,13 @@
define( function() {

"use strict";

function nodeName( elem, name ) {

return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();

};

return nodeName;

} );
9 changes: 0 additions & 9 deletions js/jquery/src/jquery/core/ready-no-deferred.js
Expand Up @@ -32,15 +32,6 @@ jQuery.extend( {
// the ready event fires. See #6781
readyWait: 1,

// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},

ready: function( wait ) {

// Abort if there are pending holds or we're already ready
Expand Down
9 changes: 0 additions & 9 deletions js/jquery/src/jquery/core/ready.js
Expand Up @@ -34,15 +34,6 @@ jQuery.extend( {
// the ready event fires. See #6781
readyWait: 1,

// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},

// Handle when the DOM is ready
ready: function( wait ) {

Expand Down
88 changes: 50 additions & 38 deletions js/jquery/src/jquery/css.js
Expand Up @@ -28,6 +28,7 @@ var
// except "table", "table-cell", or "table-caption"
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
rcustomProp = /^--/,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: "0",
Expand Down Expand Up @@ -57,6 +58,16 @@ function vendorPropName( name ) {
}
}

// Return a property mapped along what jQuery.cssProps suggests or to
// a vendor prefixed property.
function finalPropName( name ) {
var ret = jQuery.cssProps[ name ];
if ( !ret ) {
ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
}
return ret;
}

function setPositiveNumber( elem, value, subtract ) {

// Any relative (+/-) values have already been
Expand Down Expand Up @@ -117,44 +128,31 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {

function getWidthOrHeight( elem, name, extra ) {

// Start with offset property, which is equivalent to the border-box value
var val,
valueIsBorderBox = true,
// Start with computed style
var valueIsBorderBox,
styles = getStyles( elem ),
val = curCSS( elem, name, styles ),
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";

// Support: IE <=11 only
// Running getBoundingClientRect on a disconnected node
// in IE throws an error.
if ( elem.getClientRects().length ) {
val = elem.getBoundingClientRect()[ name ];
// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test( val ) ) {
return val;
}

// Some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if ( val <= 0 || val == null ) {

// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, styles );
if ( val < 0 || val == null ) {
val = elem.style[ name ];
}

// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test( val ) ) {
return val;
}

// Check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox = isBorderBox &&
( support.boxSizingReliable() || val === elem.style[ name ] );
// Check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox = isBorderBox &&
( support.boxSizingReliable() || val === elem.style[ name ] );

// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
// Fall back to offsetWidth/Height when value is "auto"
// This happens for inline elements with no explicit setting (gh-3571)
if ( val === "auto" ) {
val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ];
}

// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;

// Use the active box-sizing model to add/subtract irrelevant styles
return ( val +
augmentWidthOrHeight(
Expand Down Expand Up @@ -218,10 +216,15 @@ jQuery.extend( {
// Make sure that we're working with the right name
var ret, type, hooks,
origName = jQuery.camelCase( name ),
isCustomProp = rcustomProp.test( name ),
style = elem.style;

name = jQuery.cssProps[ origName ] ||
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
// Make sure that we're working with the right name. We don't
// want to query the value if it is a CSS custom property
// since they are user-defined.
if ( !isCustomProp ) {
name = finalPropName( origName );
}

// Gets hook for the prefixed version, then unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
Expand Down Expand Up @@ -257,7 +260,11 @@ jQuery.extend( {
if ( !hooks || !( "set" in hooks ) ||
( value = hooks.set( elem, value, extra ) ) !== undefined ) {

style[ name ] = value;
if ( isCustomProp ) {
style.setProperty( name, value );
} else {
style[ name ] = value;
}
}

} else {
Expand All @@ -276,11 +283,15 @@ jQuery.extend( {

css: function( elem, name, extra, styles ) {
var val, num, hooks,
origName = jQuery.camelCase( name );
origName = jQuery.camelCase( name ),
isCustomProp = rcustomProp.test( name );

// Make sure that we're working with the right name
name = jQuery.cssProps[ origName ] ||
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
// Make sure that we're working with the right name. We don't
// want to modify the value if it is a CSS custom property
// since they are user-defined.
if ( !isCustomProp ) {
name = finalPropName( origName );
}

// Try prefixed name followed by the unprefixed name
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
Expand All @@ -305,6 +316,7 @@ jQuery.extend( {
num = parseFloat( val );
return extra === true || isFinite( num ) ? num || 0 : val;
}

return val;
}
} );
Expand Down Expand Up @@ -404,7 +416,7 @@ jQuery.fn.extend( {
map = {},
i = 0;

if ( jQuery.isArray( name ) ) {
if ( Array.isArray( name ) ) {
styles = getStyles( elem );
len = name.length;

Expand Down
10 changes: 8 additions & 2 deletions js/jquery/src/jquery/css/curCSS.js
Expand Up @@ -11,12 +11,18 @@ define( [

function curCSS( elem, name, computed ) {
var width, minWidth, maxWidth, ret,

// Support: Firefox 51+
// Retrieving style before computed somehow
// fixes an issue with getting wrong values
// on detached elements
style = elem.style;

computed = computed || getStyles( elem );

// Support: IE <=9 only
// getPropertyValue is only needed for .css('filter') (#12537)
// getPropertyValue is needed for:
// .css('filter') (IE 9 only, #12537)
// .css('--customProperty) (#3144)
if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];

Expand Down
2 changes: 1 addition & 1 deletion js/jquery/src/jquery/data/Data.js
Expand Up @@ -115,7 +115,7 @@ Data.prototype = {
if ( key !== undefined ) {

// Support array or space separated string of keys
if ( jQuery.isArray( key ) ) {
if ( Array.isArray( key ) ) {

// If key is an array of keys...
// We always set camelCase keys, so remove that.
Expand Down
14 changes: 8 additions & 6 deletions js/jquery/src/jquery/deferred.js
Expand Up @@ -13,7 +13,7 @@ function Thrower( ex ) {
throw ex;
}

function adoptValue( value, resolve, reject ) {
function adoptValue( value, resolve, reject, noValue ) {
var method;

try {
Expand All @@ -29,9 +29,10 @@ function adoptValue( value, resolve, reject ) {
// Other non-thenables
} else {

// Support: Android 4.0 only
// Strict mode functions invoked without .call/.apply get global-object context
resolve.call( undefined, value );
// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
// * false: [ value ].slice( 0 ) => resolve( value )
// * true: [ value ].slice( 1 ) => resolve()
resolve.apply( undefined, [ value ].slice( noValue ) );
}

// For Promises/A+, convert exceptions into rejections
Expand All @@ -41,7 +42,7 @@ function adoptValue( value, resolve, reject ) {

// Support: Android 4.0 only
// Strict mode functions invoked without .call/.apply get global-object context
reject.call( undefined, value );
reject.apply( undefined, [ value ] );
}
}

Expand Down Expand Up @@ -366,7 +367,8 @@ jQuery.extend( {

// Single- and empty arguments are adopted like Promise.resolve
if ( remaining <= 1 ) {
adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
!remaining );

// Use .then() to unwrap secondary thenables (cf. gh-3000)
if ( master.state() === "pending" ||
Expand Down

0 comments on commit 5346c7d

Please sign in to comment.