Release 3.5.0

parent 55b7d19f
...@@ -319,3 +319,9 @@ Andrei Fangli <andrei_fangli@outlook.com> ...@@ -319,3 +319,9 @@ Andrei Fangli <andrei_fangli@outlook.com>
Marja Hölttä <marja.holtta@gmail.com> Marja Hölttä <marja.holtta@gmail.com>
abnud1 <ahmad13932013@hotmail.com> abnud1 <ahmad13932013@hotmail.com>
buddh4 <mail@jharrer.de> buddh4 <mail@jharrer.de>
Pat O'Callaghan <patocallaghan@gmail.com>
Ahmed.S.ElAfifi <ahmed.s.elafifi@gmail.com>
Wonseop Kim <wonseop.kim@samsung.com>
Christian Oliff <christianoliff@pm.me>
Christian Wenz <christian@wenz.org>
Sean Robinson <sean.robinson@scottsdalecc.edu>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
For information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/). For information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/).
For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery). For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery).
If upgrading, please see the [blog post for 3.4.1](https://blog.jquery.com/2019/05/01/jquery-3-4-1-triggering-focus-events-in-ie-and-finding-root-elements-in-ios-10/). This includes notable differences from the previous version and a more readable changelog. If upgrading, please see the [blog post for 3.5.0](https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/). This includes notable differences from the previous version and a more readable changelog.
## Including jQuery ## Including jQuery
...@@ -16,7 +16,7 @@ Below are some of the most common ways to include jQuery. ...@@ -16,7 +16,7 @@ Below are some of the most common ways to include jQuery.
#### Script tag #### Script tag
```html ```html
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
``` ```
#### Babel #### Babel
......
/* global Symbol */
// Defining this global in .eslintrc.json would create a danger of using the global
// unguarded in another place, it seems safer to define global only for this module
define( [
"./var/arr",
"./var/document",
"./var/getProto",
"./var/slice",
"./var/concat",
"./var/push",
"./var/indexOf",
"./var/class2type",
"./var/toString",
"./var/hasOwn",
"./var/fnToString",
"./var/ObjectFunctionString",
"./var/support",
"./var/isFunction",
"./var/isWindow",
"./core/DOMEval",
"./core/toType"
], function( arr, document, getProto, slice, concat, push, indexOf,
class2type, toString, hasOwn, fnToString, ObjectFunctionString,
support, isFunction, isWindow, DOMEval, toType ) {
"use strict";
var
version = "3.4.1",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init( selector, context );
},
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: version,
constructor: jQuery,
// The default length of a jQuery object is 0
length: 0,
toArray: function() {
return slice.call( this );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
// Return all the elements in a clean array
if ( num == null ) {
return slice.call( this );
}
// Return just the one element from the set
return num < 0 ? this[ num + this.length ] : this[ num ];
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
each: function( callback ) {
return jQuery.each( this, callback );
},
map: function( callback ) {
return this.pushStack( jQuery.map( this, function( elem, i ) {
return callback.call( elem, i, elem );
} ) );
},
slice: function() {
return this.pushStack( slice.apply( this, arguments ) );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
},
end: function() {
return this.prevObject || this.constructor();
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: arr.sort,
splice: arr.splice
};
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[ 0 ] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
// Skip the boolean and the target
target = arguments[ i ] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !isFunction( target ) ) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if ( i === length ) {
target = this;
i--;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( ( options = arguments[ i ] ) != null ) {
// Extend the base object
for ( name in options ) {
copy = options[ name ];
// Prevent Object.prototype pollution
// Prevent never-ending loop
if ( name === "__proto__" || target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
( copyIsArray = Array.isArray( copy ) ) ) ) {
src = target[ name ];
// Ensure proper type for the source value
if ( copyIsArray && !Array.isArray( src ) ) {
clone = [];
} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
clone = {};
} else {
clone = src;
}
copyIsArray = false;
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend( {
// Unique for each copy of jQuery on the page
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
// Assume jQuery is ready without the ready module
isReady: true,
error: function( msg ) {
throw new Error( msg );
},
noop: function() {},
isPlainObject: function( obj ) {
var proto, Ctor;
// Detect obvious negatives
// Use toString instead of jQuery.type to catch host objects
if ( !obj || toString.call( obj ) !== "[object Object]" ) {
return false;
}
proto = getProto( obj );
// Objects with no prototype (e.g., `Object.create( null )`) are plain
if ( !proto ) {
return true;
}
// Objects with prototype are plain iff they were constructed by a global Object function
Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
// Evaluates a script in a global context
globalEval: function( code, options ) {
DOMEval( code, { nonce: options && options.nonce } );
},
each: function( obj, callback ) {
var length, i = 0;
if ( isArrayLike( obj ) ) {
length = obj.length;
for ( ; i < length; i++ ) {
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
break;
}
}
} else {
for ( i in obj ) {
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
break;
}
}
}
return obj;
},
// Support: Android <=4.0 only
trim: function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
makeArray: function( arr, results ) {
var ret = results || [];
if ( arr != null ) {
if ( isArrayLike( Object( arr ) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
[ arr ] : arr
);
} else {
push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
return arr == null ? -1 : indexOf.call( arr, elem, i );
},
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
merge: function( first, second ) {
var len = +second.length,
j = 0,
i = first.length;
for ( ; j < len; j++ ) {
first[ i++ ] = second[ j ];
}
first.length = i;
return first;
},
grep: function( elems, callback, invert ) {
var callbackInverse,
matches = [],
i = 0,
length = elems.length,
callbackExpect = !invert;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
callbackInverse = !callback( elems[ i ], i );
if ( callbackInverse !== callbackExpect ) {
matches.push( elems[ i ] );
}
}
return matches;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var length, value,
i = 0,
ret = [];
// Go through the array, translating each of the items to their new values
if ( isArrayLike( elems ) ) {
length = elems.length;
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret.push( value );
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret.push( value );
}
}
}
// Flatten any nested arrays
return concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// jQuery.support is not used in Core but other projects attach their
// properties to it so it needs to exist.
support: support
} );
if ( typeof Symbol === "function" ) {
jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
}
// Populate the class2type map
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
function( i, name ) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
} );
function isArrayLike( obj ) {
// Support: real iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = !!obj && "length" in obj && obj.length,
type = toType( obj );
if ( isFunction( obj ) || isWindow( obj ) ) {
return false;
}
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}
return jQuery;
} );
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
"name": "jquery", "name": "jquery",
"title": "jQuery", "title": "jQuery",
"description": "JavaScript library for DOM operations", "description": "JavaScript library for DOM operations",
"version": "3.4.1", "version": "3.5.0",
"main": "dist/jquery.js", "main": "dist/jquery.js",
"homepage": "https://jquery.com", "homepage": "https://jquery.com",
"author": { "author": {
"name": "JS Foundation and other contributors", "name": "JS Foundation and other contributors",
"url": "https://github.com/jquery/jquery/blob/3.4.1/AUTHORS.txt" "url": "https://github.com/jquery/jquery/blob/3.5.0/AUTHORS.txt"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
"@babel/plugin-transform-for-of": "7.2.0", "@babel/plugin-transform-for-of": "7.2.0",
"commitplease": "3.2.0", "commitplease": "3.2.0",
"core-js": "2.6.5", "core-js": "2.6.5",
"eslint-config-jquery": "1.0.1", "eslint-config-jquery": "2.0.0",
"grunt": "1.0.3", "grunt": "1.0.3",
"grunt-babel": "8.0.0", "grunt-babel": "8.0.0",
"grunt-cli": "1.3.2", "grunt-cli": "1.3.2",
"grunt-compare-size": "0.4.2", "grunt-compare-size": "0.4.2",
"grunt-contrib-uglify": "3.4.0", "grunt-contrib-uglify": "3.4.0",
"grunt-contrib-watch": "1.1.0", "grunt-contrib-watch": "1.1.0",
"grunt-eslint": "21.0.0", "grunt-eslint": "22.0.0",
"grunt-git-authors": "3.2.0", "grunt-git-authors": "3.2.0",
"grunt-jsonlint": "1.1.0", "grunt-jsonlint": "1.1.0",
"grunt-karma": "3.0.1", "grunt-karma": "3.0.1",
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
"raw-body": "2.3.3", "raw-body": "2.3.3",
"requirejs": "2.3.6", "requirejs": "2.3.6",
"sinon": "2.3.7", "sinon": "2.3.7",
"sizzle": "2.3.4", "sizzle": "2.3.5",
"strip-json-comments": "2.0.1", "strip-json-comments": "2.0.1",
"testswarm": "1.1.0", "testswarm": "1.1.0",
"uglify-js": "3.4.7" "uglify-js": "3.4.7"
...@@ -71,7 +71,11 @@ ...@@ -71,7 +71,11 @@
"start": "grunt watch", "start": "grunt watch",
"test:browserless": "grunt && grunt test:slow", "test:browserless": "grunt && grunt test:slow",
"test:browser": "grunt && grunt karma:main", "test:browser": "grunt && grunt karma:main",
"test": "grunt && grunt test:slow && grunt karma:main", "test:amd": "grunt && grunt karma:amd",
"test:no-deprecated": "grunt test:prepare && grunt custom:-deprecated && grunt karma:main",
"test:no-sizzle": "grunt test:prepare && grunt custom:-sizzle && grunt karma:main",
"test:slim": "grunt test:prepare && grunt custom:slim && grunt karma:main",
"test": "npm run test:slim && npm run test:no-deprecated && npm run test:no-sizzle && grunt && grunt test:slow && grunt karma:main && grunt karma:amd",
"jenkins": "npm run test:browserless" "jenkins": "npm run test:browserless"
}, },
"commitplease": { "commitplease": {
......
{
"root": true,
"extends": "../.eslintrc-browser.json",
"overrides": [
{
"files": "wrapper.js",
"globals": {
"jQuery": false
}
}
]
}
...@@ -8,7 +8,7 @@ define( [ ...@@ -8,7 +8,7 @@ define( [
"./ajax/var/rquery", "./ajax/var/rquery",
"./core/init", "./core/init",
"./ajax/parseXML", "./core/parseXML",
"./event/trigger", "./event/trigger",
"./deferred", "./deferred",
"./serialize" // jQuery.param "./serialize" // jQuery.param
...@@ -610,7 +610,8 @@ jQuery.extend( { ...@@ -610,7 +610,8 @@ jQuery.extend( {
// Add or update anti-cache param if needed // Add or update anti-cache param if needed
if ( s.cache === false ) { if ( s.cache === false ) {
cacheURL = cacheURL.replace( rantiCache, "$1" ); cacheURL = cacheURL.replace( rantiCache, "$1" );
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
uncached;
} }
// Put hash and anti-cache on the URL that will be requested (gh-1732) // Put hash and anti-cache on the URL that will be requested (gh-1732)
...@@ -743,6 +744,11 @@ jQuery.extend( { ...@@ -743,6 +744,11 @@ jQuery.extend( {
response = ajaxHandleResponses( s, jqXHR, responses ); response = ajaxHandleResponses( s, jqXHR, responses );
} }
// Use a noop converter for missing script
if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
s.converters[ "text script" ] = function() {};
}
// Convert no matter what (that way responseXXX fields are always set) // Convert no matter what (that way responseXXX fields are always set)
response = ajaxConvert( s, response, jqXHR, isSuccess ); response = ajaxConvert( s, response, jqXHR, isSuccess );
...@@ -833,7 +839,7 @@ jQuery.extend( { ...@@ -833,7 +839,7 @@ jQuery.extend( {
} }
} ); } );
jQuery.each( [ "get", "post" ], function( i, method ) { jQuery.each( [ "get", "post" ], function( _i, method ) {
jQuery[ method ] = function( url, data, callback, type ) { jQuery[ method ] = function( url, data, callback, type ) {
// Shift arguments if data argument was omitted // Shift arguments if data argument was omitted
...@@ -854,5 +860,14 @@ jQuery.each( [ "get", "post" ], function( i, method ) { ...@@ -854,5 +860,14 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
}; };
} ); } );
jQuery.ajaxPrefilter( function( s ) {
var i;
for ( i in s.headers ) {
if ( i.toLowerCase() === "content-type" ) {
s.contentType = s.headers[ i ] || "";
}
}
} );
return jQuery; return jQuery;
} ); } );
...@@ -15,7 +15,7 @@ var oldCallbacks = [], ...@@ -15,7 +15,7 @@ var oldCallbacks = [],
jQuery.ajaxSetup( { jQuery.ajaxSetup( {
jsonp: "callback", jsonp: "callback",
jsonpCallback: function() { jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
this[ callback ] = true; this[ callback ] = true;
return callback; return callback;
} }
......
define( function() { define( function() {
"use strict"; "use strict";
return Date.now(); return { guid: Date.now() };
} ); } );
...@@ -117,7 +117,7 @@ boolHook = { ...@@ -117,7 +117,7 @@ boolHook = {
} }
}; };
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
var getter = attrHandle[ name ] || jQuery.find.attr; var getter = attrHandle[ name ] || jQuery.find.attr;
attrHandle[ name ] = function( elem, name, isXML ) { attrHandle[ name ] = function( elem, name, isXML ) {
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
define( [ define( [
"./var/arr", "./var/arr",
"./var/document",
"./var/getProto", "./var/getProto",
"./var/slice", "./var/slice",
"./var/concat", "./var/flat",
"./var/push", "./var/push",
"./var/indexOf", "./var/indexOf",
"./var/class2type", "./var/class2type",
...@@ -20,14 +19,14 @@ define( [ ...@@ -20,14 +19,14 @@ define( [
"./var/isWindow", "./var/isWindow",
"./core/DOMEval", "./core/DOMEval",
"./core/toType" "./core/toType"
], function( arr, document, getProto, slice, concat, push, indexOf, ], function( arr, getProto, slice, flat, push, indexOf,
class2type, toString, hasOwn, fnToString, ObjectFunctionString, class2type, toString, hasOwn, fnToString, ObjectFunctionString,
support, isFunction, isWindow, DOMEval, toType ) { support, isFunction, isWindow, DOMEval, toType ) {
"use strict"; "use strict";
var var
version = "3.4.1", version = "3.5.0",
// Define a local copy of jQuery // Define a local copy of jQuery
jQuery = function( selector, context ) { jQuery = function( selector, context ) {
...@@ -35,11 +34,7 @@ var ...@@ -35,11 +34,7 @@ var
// The jQuery object is actually just the init constructor 'enhanced' // The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included) // Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init( selector, context ); return new jQuery.fn.init( selector, context );
}, };
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
jQuery.fn = jQuery.prototype = { jQuery.fn = jQuery.prototype = {
...@@ -105,6 +100,18 @@ jQuery.fn = jQuery.prototype = { ...@@ -105,6 +100,18 @@ jQuery.fn = jQuery.prototype = {
return this.eq( -1 ); return this.eq( -1 );
}, },
even: function() {
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
return ( i + 1 ) % 2;
} ) );
},
odd: function() {
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
return i % 2;
} ) );
},
eq: function( i ) { eq: function( i ) {
var len = this.length, var len = this.length,
j = +i + ( i < 0 ? len : 0 ); j = +i + ( i < 0 ? len : 0 );
...@@ -238,9 +245,10 @@ jQuery.extend( { ...@@ -238,9 +245,10 @@ jQuery.extend( {
return true; return true;
}, },
// Evaluates a script in a global context // Evaluates a script in a provided context; falls back to the global one
globalEval: function( code, options ) { // if not specified.
DOMEval( code, { nonce: options && options.nonce } ); globalEval: function( code, options, doc ) {
DOMEval( code, { nonce: options && options.nonce }, doc );
}, },
each: function( obj, callback ) { each: function( obj, callback ) {
...@@ -264,13 +272,6 @@ jQuery.extend( { ...@@ -264,13 +272,6 @@ jQuery.extend( {
return obj; return obj;
}, },
// Support: Android <=4.0 only
trim: function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only // results is for internal usage only
makeArray: function( arr, results ) { makeArray: function( arr, results ) {
var ret = results || []; var ret = results || [];
...@@ -357,7 +358,7 @@ jQuery.extend( { ...@@ -357,7 +358,7 @@ jQuery.extend( {
} }
// Flatten any nested arrays // Flatten any nested arrays
return concat.apply( [], ret ); return flat( ret );
}, },
// A global GUID counter for objects // A global GUID counter for objects
...@@ -374,7 +375,7 @@ if ( typeof Symbol === "function" ) { ...@@ -374,7 +375,7 @@ if ( typeof Symbol === "function" ) {
// Populate the class2type map // Populate the class2type map
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
function( i, name ) { function( _i, name ) {
class2type[ "[object " + name + "]" ] = name.toLowerCase(); class2type[ "[object " + name + "]" ] = name.toLowerCase();
} ); } );
......
...@@ -38,7 +38,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { ...@@ -38,7 +38,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
// ...except when executing function values // ...except when executing function values
} else { } else {
bulk = fn; bulk = fn;
fn = function( elem, key, value ) { fn = function( elem, _key, value ) {
return bulk.call( jQuery( elem ), value ); return bulk.call( jQuery( elem ), value );
}; };
} }
......
...@@ -7,7 +7,7 @@ var rmsPrefix = /^-ms-/, ...@@ -7,7 +7,7 @@ var rmsPrefix = /^-ms-/,
rdashAlpha = /-([a-z])/g; rdashAlpha = /-([a-z])/g;
// Used by camelCase as callback to replace() // Used by camelCase as callback to replace()
function fcamelCase( all, letter ) { function fcamelCase( _all, letter ) {
return letter.toUpperCase(); return letter.toUpperCase();
} }
......
...@@ -2,6 +2,7 @@ define( [ ...@@ -2,6 +2,7 @@ define( [
"./core", "./core",
"./core/access", "./core/access",
"./core/camelCase", "./core/camelCase",
"./core/nodeName",
"./var/rcssNum", "./var/rcssNum",
"./css/var/rnumnonpx", "./css/var/rnumnonpx",
"./css/var/cssExpand", "./css/var/cssExpand",
...@@ -16,7 +17,7 @@ define( [ ...@@ -16,7 +17,7 @@ define( [
"./core/init", "./core/init",
"./core/ready", "./core/ready",
"./selector" // contains "./selector" // contains
], function( jQuery, access, camelCase, rcssNum, rnumnonpx, cssExpand, ], function( jQuery, access, camelCase, nodeName, rcssNum, rnumnonpx, cssExpand,
getStyles, swap, curCSS, adjustCSS, addGetHookIf, support, finalPropName ) { getStyles, swap, curCSS, adjustCSS, addGetHookIf, support, finalPropName ) {
"use strict"; "use strict";
...@@ -34,7 +35,7 @@ var ...@@ -34,7 +35,7 @@ var
fontWeight: "400" fontWeight: "400"
}; };
function setPositiveNumber( elem, value, subtract ) { function setPositiveNumber( _elem, value, subtract ) {
// Any relative (+/-) values have already been // Any relative (+/-) values have already been
// normalized at this point // normalized at this point
...@@ -139,17 +140,26 @@ function getWidthOrHeight( elem, dimension, extra ) { ...@@ -139,17 +140,26 @@ function getWidthOrHeight( elem, dimension, extra ) {
} }
// Fall back to offsetWidth/offsetHeight when value is "auto" // Support: IE 9 - 11 only
// This happens for inline elements with no explicit setting (gh-3571) // Use offsetWidth/offsetHeight for when box sizing is unreliable.
// Support: Android <=4.1 - 4.3 only // In those cases, the computed value can be trusted to be border-box.
// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
// Support: IE 9-11 only
// Also use offsetWidth/offsetHeight for when box sizing is unreliable
// We use getClientRects() to check for hidden/disconnected.
// In those cases, the computed value can be trusted to be border-box
if ( ( !support.boxSizingReliable() && isBorderBox || if ( ( !support.boxSizingReliable() && isBorderBox ||
// Support: IE 10 - 11+, Edge 15 - 18+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
// set in CSS while `offset*` properties report correct values.
// Interestingly, in some cases IE 9 doesn't suffer from this issue.
!support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
// Fall back to offsetWidth/offsetHeight when value is "auto"
// This happens for inline elements with no explicit setting (gh-3571)
val === "auto" || val === "auto" ||
// Support: Android <=4.1 - 4.3 only
// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
!parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
// Make sure the element is visible & connected
elem.getClientRects().length ) { elem.getClientRects().length ) {
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
...@@ -344,7 +354,7 @@ jQuery.extend( { ...@@ -344,7 +354,7 @@ jQuery.extend( {
} }
} ); } );
jQuery.each( [ "height", "width" ], function( i, dimension ) { jQuery.each( [ "height", "width" ], function( _i, dimension ) {
jQuery.cssHooks[ dimension ] = { jQuery.cssHooks[ dimension ] = {
get: function( elem, computed, extra ) { get: function( elem, computed, extra ) {
if ( computed ) { if ( computed ) {
......
...@@ -60,7 +60,7 @@ define( [ ...@@ -60,7 +60,7 @@ define( [
} }
var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
reliableMarginLeftVal, reliableTrDimensionsVal, reliableMarginLeftVal,
container = document.createElement( "div" ), container = document.createElement( "div" ),
div = document.createElement( "div" ); div = document.createElement( "div" );
...@@ -95,6 +95,35 @@ define( [ ...@@ -95,6 +95,35 @@ define( [
scrollboxSize: function() { scrollboxSize: function() {
computeStyleTests(); computeStyleTests();
return scrollboxSizeVal; return scrollboxSizeVal;
},
// Support: IE 9 - 11+, Edge 15 - 18+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
// set in CSS while `offset*` properties report correct values.
// Behavior in IE 9 is more subtle than in newer versions & it passes
// some versions of this test; make sure not to make it pass there!
reliableTrDimensions: function() {
var table, tr, trChild, trStyle;
if ( reliableTrDimensionsVal == null ) {
table = document.createElement( "table" );
tr = document.createElement( "tr" );
trChild = document.createElement( "div" );
table.style.cssText = "position:absolute;left:-11111px";
tr.style.height = "1px";
trChild.style.height = "9px";
documentElement
.appendChild( table )
.appendChild( tr )
.appendChild( trChild );
trStyle = window.getComputedStyle( tr );
reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
documentElement.removeChild( table );
}
return reliableTrDimensionsVal;
} }
} ); } );
} )(); } )();
......
...@@ -3,7 +3,7 @@ define( function() { ...@@ -3,7 +3,7 @@ define( function() {
"use strict"; "use strict";
// A method for quickly swapping in/out CSS properties to get correct calculations. // A method for quickly swapping in/out CSS properties to get correct calculations.
return function( elem, options, callback, args ) { return function( elem, options, callback ) {
var ret, name, var ret, name,
old = {}; old = {};
...@@ -13,7 +13,7 @@ return function( elem, options, callback, args ) { ...@@ -13,7 +13,7 @@ return function( elem, options, callback, args ) {
elem.style[ name ] = options[ name ]; elem.style[ name ] = options[ name ];
} }
ret = callback.apply( elem, args || [] ); ret = callback.call( elem );
// Revert the old values // Revert the old values
for ( name in options ) { for ( name in options ) {
......
...@@ -22,7 +22,7 @@ Data.prototype = { ...@@ -22,7 +22,7 @@ Data.prototype = {
// If not, create one // If not, create one
if ( !value ) { if ( !value ) {
value = {}; value = Object.create( null );
// We can accept data for non-element nodes in modern browsers, // We can accept data for non-element nodes in modern browsers,
// but we should not, see #8335. // but we should not, see #8335.
......
...@@ -79,7 +79,7 @@ jQuery.extend( { ...@@ -79,7 +79,7 @@ jQuery.extend( {
var fns = arguments; var fns = arguments;
return jQuery.Deferred( function( newDefer ) { return jQuery.Deferred( function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) { jQuery.each( tuples, function( _i, tuple ) {
// Map tuples (progress, done, fail) to arguments (done, fail, progress) // Map tuples (progress, done, fail) to arguments (done, fail, progress)
var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
......
...@@ -7,31 +7,15 @@ define( [ ...@@ -7,31 +7,15 @@ define( [
"./var/isWindow", "./var/isWindow",
"./var/slice", "./var/slice",
"./event/alias" "./deprecated/ajax-event-alias",
"./deprecated/event"
], function( jQuery, nodeName, camelCase, toType, isFunction, isWindow, slice ) { ], function( jQuery, nodeName, camelCase, toType, isFunction, isWindow, slice ) {
"use strict"; "use strict";
jQuery.fn.extend( { // Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
bind: function( types, data, fn ) { var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
}
} );
// Bind a function to a context, optionally partially applying any // Bind a function to a context, optionally partially applying any
// arguments. // arguments.
...@@ -95,4 +79,9 @@ jQuery.isNumeric = function( obj ) { ...@@ -95,4 +79,9 @@ jQuery.isNumeric = function( obj ) {
!isNaN( obj - parseFloat( obj ) ); !isNaN( obj - parseFloat( obj ) );
}; };
jQuery.trim = function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
};
} ); } );
define( [ define( [
"../core", "../core",
"../ajax",
"../event" "../event"
], function( jQuery ) { ], function( jQuery ) {
"use strict"; "use strict";
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ jQuery.each( [
"ajaxStart", "ajaxStart",
"ajaxStop", "ajaxStop",
...@@ -13,7 +13,7 @@ jQuery.each( [ ...@@ -13,7 +13,7 @@ jQuery.each( [
"ajaxError", "ajaxError",
"ajaxSuccess", "ajaxSuccess",
"ajaxSend" "ajaxSend"
], function( i, type ) { ], function( _i, type ) {
jQuery.fn[ type ] = function( fn ) { jQuery.fn[ type ] = function( fn ) {
return this.on( type, fn ); return this.on( type, fn );
}; };
......
...@@ -2,28 +2,47 @@ define( [ ...@@ -2,28 +2,47 @@ define( [
"../core", "../core",
"../event", "../event",
"./trigger" "../event/trigger"
], function( jQuery ) { ], function( jQuery ) {
"use strict"; "use strict";
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
} );
jQuery.fn.extend( { jQuery.fn.extend( {
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
},
hover: function( fnOver, fnOut ) { hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
} }
} ); } );
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
function( _i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
} );
} ); } );
...@@ -7,7 +7,6 @@ define( [ ...@@ -7,7 +7,6 @@ define( [
"./var/rnothtmlwhite", "./var/rnothtmlwhite",
"./css/var/cssExpand", "./css/var/cssExpand",
"./css/var/isHiddenWithinTree", "./css/var/isHiddenWithinTree",
"./css/var/swap",
"./css/adjustCSS", "./css/adjustCSS",
"./data/var/dataPriv", "./data/var/dataPriv",
"./css/showHide", "./css/showHide",
...@@ -20,7 +19,7 @@ define( [ ...@@ -20,7 +19,7 @@ define( [
"./css", "./css",
"./effects/Tween" "./effects/Tween"
], function( jQuery, camelCase, document, isFunction, rcssNum, rnothtmlwhite, cssExpand, ], function( jQuery, camelCase, document, isFunction, rcssNum, rnothtmlwhite, cssExpand,
isHiddenWithinTree, swap, adjustCSS, dataPriv, showHide ) { isHiddenWithinTree, adjustCSS, dataPriv, showHide ) {
"use strict"; "use strict";
...@@ -542,7 +541,7 @@ jQuery.fn.extend( { ...@@ -542,7 +541,7 @@ jQuery.fn.extend( {
clearQueue = type; clearQueue = type;
type = undefined; type = undefined;
} }
if ( clearQueue && type !== false ) { if ( clearQueue ) {
this.queue( type || "fx", [] ); this.queue( type || "fx", [] );
} }
...@@ -625,7 +624,7 @@ jQuery.fn.extend( { ...@@ -625,7 +624,7 @@ jQuery.fn.extend( {
} }
} ); } );
jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
var cssFn = jQuery.fn[ name ]; var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) { jQuery.fn[ name ] = function( speed, easing, callback ) {
return speed == null || typeof speed === "boolean" ? return speed == null || typeof speed === "boolean" ?
......
...@@ -6,13 +6,14 @@ define( [ ...@@ -6,13 +6,14 @@ define( [
"./var/rnothtmlwhite", "./var/rnothtmlwhite",
"./var/rcheckableType", "./var/rcheckableType",
"./var/slice", "./var/slice",
"./data/var/acceptData",
"./data/var/dataPriv", "./data/var/dataPriv",
"./core/nodeName", "./core/nodeName",
"./core/init", "./core/init",
"./selector" "./selector"
], function( jQuery, document, documentElement, isFunction, rnothtmlwhite, ], function( jQuery, document, documentElement, isFunction, rnothtmlwhite,
rcheckableType, slice, dataPriv, nodeName ) { rcheckableType, slice, acceptData, dataPriv, nodeName ) {
"use strict"; "use strict";
...@@ -124,8 +125,8 @@ jQuery.event = { ...@@ -124,8 +125,8 @@ jQuery.event = {
special, handlers, type, namespaces, origType, special, handlers, type, namespaces, origType,
elemData = dataPriv.get( elem ); elemData = dataPriv.get( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects) // Only attach events to objects that accept data
if ( !elemData ) { if ( !acceptData( elem ) ) {
return; return;
} }
...@@ -149,7 +150,7 @@ jQuery.event = { ...@@ -149,7 +150,7 @@ jQuery.event = {
// Init the element's event structure and main handler, if this is the first // Init the element's event structure and main handler, if this is the first
if ( !( events = elemData.events ) ) { if ( !( events = elemData.events ) ) {
events = elemData.events = {}; events = elemData.events = Object.create( null );
} }
if ( !( eventHandle = elemData.handle ) ) { if ( !( eventHandle = elemData.handle ) ) {
eventHandle = elemData.handle = function( e ) { eventHandle = elemData.handle = function( e ) {
...@@ -307,12 +308,15 @@ jQuery.event = { ...@@ -307,12 +308,15 @@ jQuery.event = {
dispatch: function( nativeEvent ) { dispatch: function( nativeEvent ) {
// Make a writable jQuery.Event from the native event object
var event = jQuery.event.fix( nativeEvent );
var i, j, ret, matched, handleObj, handlerQueue, var i, j, ret, matched, handleObj, handlerQueue,
args = new Array( arguments.length ), args = new Array( arguments.length ),
handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( nativeEvent ),
handlers = (
dataPriv.get( this, "events" ) || Object.create( null )
)[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {}; special = jQuery.event.special[ event.type ] || {};
// Use the fix-ed jQuery.Event rather than the (read-only) native event // Use the fix-ed jQuery.Event rather than the (read-only) native event
......
...@@ -27,7 +27,10 @@ if ( !support.focusin ) { ...@@ -27,7 +27,10 @@ if ( !support.focusin ) {
jQuery.event.special[ fix ] = { jQuery.event.special[ fix ] = {
setup: function() { setup: function() {
var doc = this.ownerDocument || this,
// Handle: regular nodes (via `this.ownerDocument`), window
// (via `this.document`) & document (via `this`).
var doc = this.ownerDocument || this.document || this,
attaches = dataPriv.access( doc, fix ); attaches = dataPriv.access( doc, fix );
if ( !attaches ) { if ( !attaches ) {
...@@ -36,7 +39,7 @@ if ( !support.focusin ) { ...@@ -36,7 +39,7 @@ if ( !support.focusin ) {
dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
}, },
teardown: function() { teardown: function() {
var doc = this.ownerDocument || this, var doc = this.ownerDocument || this.document || this,
attaches = dataPriv.access( doc, fix ) - 1; attaches = dataPriv.access( doc, fix ) - 1;
if ( !attaches ) { if ( !attaches ) {
......
...@@ -103,7 +103,9 @@ jQuery.extend( jQuery.event, { ...@@ -103,7 +103,9 @@ jQuery.extend( jQuery.event, {
special.bindType || type; special.bindType || type;
// jQuery handler // jQuery handler
handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && handle = (
dataPriv.get( cur, "events" ) || Object.create( null )
)[ event.type ] &&
dataPriv.get( cur, "handle" ); dataPriv.get( cur, "handle" );
if ( handle ) { if ( handle ) {
handle.apply( cur, data ); handle.apply( cur, data );
......
define( [ define( [
"../core" "../core"
], function( jQuery, noGlobal ) { ], function( jQuery ) {
"use strict"; "use strict";
...@@ -27,7 +27,7 @@ jQuery.noConflict = function( deep ) { ...@@ -27,7 +27,7 @@ jQuery.noConflict = function( deep ) {
// Expose jQuery and $ identifiers, even in AMD // Expose jQuery and $ identifiers, even in AMD
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566) // and CommonJS for browser emulators (#13566)
if ( !noGlobal ) { if ( typeof noGlobal === "undefined" ) {
window.jQuery = window.$ = jQuery; window.jQuery = window.$ = jQuery;
} }
......
...@@ -23,7 +23,8 @@ define( [ ...@@ -23,7 +23,8 @@ define( [
"./ajax/script", "./ajax/script",
"./ajax/jsonp", "./ajax/jsonp",
"./ajax/load", "./ajax/load",
"./event/ajax", "./core/parseXML",
"./core/parseHTML",
"./effects", "./effects",
"./effects/animatedSelector", "./effects/animatedSelector",
"./offset", "./offset",
......
define( [ define( [
"./core", "./core",
"./core/isAttached", "./core/isAttached",
"./var/concat", "./var/flat",
"./var/isFunction", "./var/isFunction",
"./var/push", "./var/push",
"./var/rcheckableType", "./var/rcheckableType",
...@@ -24,7 +24,7 @@ define( [ ...@@ -24,7 +24,7 @@ define( [
"./traversing", "./traversing",
"./selector", "./selector",
"./event" "./event"
], function( jQuery, isAttached, concat, isFunction, push, rcheckableType, ], function( jQuery, isAttached, flat, isFunction, push, rcheckableType,
access, rtagName, rscriptType, access, rtagName, rscriptType,
wrapMap, getAll, setGlobalEval, buildFragment, support, wrapMap, getAll, setGlobalEval, buildFragment, support,
dataPriv, dataUser, acceptData, DOMEval, nodeName ) { dataPriv, dataUser, acceptData, DOMEval, nodeName ) {
...@@ -33,13 +33,6 @@ define( [ ...@@ -33,13 +33,6 @@ define( [
var var
/* eslint-disable max-len */
// See https://github.com/eslint/eslint/issues/3229
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
/* eslint-enable */
// Support: IE <=10 - 11, Edge 12 - 13 only // Support: IE <=10 - 11, Edge 12 - 13 only
// In IE/Edge using regex groups here causes severe slowdowns. // In IE/Edge using regex groups here causes severe slowdowns.
// See https://connect.microsoft.com/IE/feedback/details/1736512/ // See https://connect.microsoft.com/IE/feedback/details/1736512/
...@@ -76,7 +69,7 @@ function restoreScript( elem ) { ...@@ -76,7 +69,7 @@ function restoreScript( elem ) {
} }
function cloneCopyEvent( src, dest ) { function cloneCopyEvent( src, dest ) {
var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; var i, l, type, pdataOld, udataOld, udataCur, events;
if ( dest.nodeType !== 1 ) { if ( dest.nodeType !== 1 ) {
return; return;
...@@ -84,13 +77,11 @@ function cloneCopyEvent( src, dest ) { ...@@ -84,13 +77,11 @@ function cloneCopyEvent( src, dest ) {
// 1. Copy private data: events, handlers, etc. // 1. Copy private data: events, handlers, etc.
if ( dataPriv.hasData( src ) ) { if ( dataPriv.hasData( src ) ) {
pdataOld = dataPriv.access( src ); pdataOld = dataPriv.get( src );
pdataCur = dataPriv.set( dest, pdataOld );
events = pdataOld.events; events = pdataOld.events;
if ( events ) { if ( events ) {
delete pdataCur.handle; dataPriv.remove( dest, "handle events" );
pdataCur.events = {};
for ( type in events ) { for ( type in events ) {
for ( i = 0, l = events[ type ].length; i < l; i++ ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) {
...@@ -126,7 +117,7 @@ function fixInput( src, dest ) { ...@@ -126,7 +117,7 @@ function fixInput( src, dest ) {
function domManip( collection, args, callback, ignored ) { function domManip( collection, args, callback, ignored ) {
// Flatten any nested arrays // Flatten any nested arrays
args = concat.apply( [], args ); args = flat( args );
var fragment, first, scripts, hasScripts, node, doc, var fragment, first, scripts, hasScripts, node, doc,
i = 0, i = 0,
...@@ -201,7 +192,7 @@ function domManip( collection, args, callback, ignored ) { ...@@ -201,7 +192,7 @@ function domManip( collection, args, callback, ignored ) {
if ( jQuery._evalUrl && !node.noModule ) { if ( jQuery._evalUrl && !node.noModule ) {
jQuery._evalUrl( node.src, { jQuery._evalUrl( node.src, {
nonce: node.nonce || node.getAttribute( "nonce" ) nonce: node.nonce || node.getAttribute( "nonce" )
} ); }, doc );
} }
} else { } else {
DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
...@@ -238,7 +229,7 @@ function remove( elem, selector, keepData ) { ...@@ -238,7 +229,7 @@ function remove( elem, selector, keepData ) {
jQuery.extend( { jQuery.extend( {
htmlPrefilter: function( html ) { htmlPrefilter: function( html ) {
return html.replace( rxhtmlTag, "<$1></$2>" ); return html;
}, },
clone: function( elem, dataAndEvents, deepDataAndEvents ) { clone: function( elem, dataAndEvents, deepDataAndEvents ) {
......
...@@ -4,7 +4,7 @@ define( [ ...@@ -4,7 +4,7 @@ define( [
"use strict"; "use strict";
jQuery._evalUrl = function( url, options ) { jQuery._evalUrl = function( url, options, doc ) {
return jQuery.ajax( { return jQuery.ajax( {
url: url, url: url,
...@@ -22,7 +22,7 @@ jQuery._evalUrl = function( url, options ) { ...@@ -22,7 +22,7 @@ jQuery._evalUrl = function( url, options ) {
"text script": function() {} "text script": function() {}
}, },
dataFilter: function( response ) { dataFilter: function( response ) {
jQuery.globalEval( response, options ); jQuery.globalEval( response, options, doc );
} }
} ); } );
}; };
......
...@@ -28,6 +28,12 @@ define( [ ...@@ -28,6 +28,12 @@ define( [
// Make sure textarea (and checkbox) defaultValue is properly cloned // Make sure textarea (and checkbox) defaultValue is properly cloned
div.innerHTML = "<textarea>x</textarea>"; div.innerHTML = "<textarea>x</textarea>";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
// Support: IE <=9 only
// IE <=9 replaces <option> tags with their contents when inserted outside of
// the select element.
div.innerHTML = "<option></option>";
support.option = !!div.lastChild;
} )(); } )();
return support; return support;
......
define( function() { define( [
"./support"
], function( support ) {
"use strict"; "use strict";
// We have to close these tags to support XHTML (#13200) // We have to close these tags to support XHTML (#13200)
var wrapMap = { var wrapMap = {
// Support: IE <=9 only
option: [ 1, "<select multiple='multiple'>", "</select>" ],
// XHTML parsers do not magically insert elements in the // XHTML parsers do not magically insert elements in the
// same way that tag soup parsers do. So we cannot shorten // same way that tag soup parsers do. So we cannot shorten
// this by omitting <tbody> or other required elements. // this by omitting <tbody> or other required elements.
...@@ -19,11 +18,13 @@ var wrapMap = { ...@@ -19,11 +18,13 @@ var wrapMap = {
_default: [ 0, "", "" ] _default: [ 0, "", "" ]
}; };
// Support: IE <=9 only
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td; wrapMap.th = wrapMap.td;
// Support: IE <=9 only
if ( !support.option ) {
wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
}
return wrapMap; return wrapMap;
} ); } );
define( [ define( [
"./core", "./core",
"./core/access", "./core/access",
"./var/document",
"./var/documentElement", "./var/documentElement",
"./var/isFunction", "./var/isFunction",
"./css/var/rnumnonpx", "./css/var/rnumnonpx",
...@@ -12,8 +11,8 @@ define( [ ...@@ -12,8 +11,8 @@ define( [
"./core/init", "./core/init",
"./css", "./css",
"./selector" // contains "./selector" // contains
], function( jQuery, access, document, documentElement, isFunction, rnumnonpx, ], function( jQuery, access, documentElement, isFunction, rnumnonpx,
curCSS, addGetHookIf, support, isWindow ) { curCSS, addGetHookIf, support, isWindow ) {
"use strict"; "use strict";
...@@ -64,6 +63,12 @@ jQuery.offset = { ...@@ -64,6 +63,12 @@ jQuery.offset = {
options.using.call( elem, props ); options.using.call( elem, props );
} else { } else {
if ( typeof props.top === "number" ) {
props.top += "px";
}
if ( typeof props.left === "number" ) {
props.left += "px";
}
curElem.css( props ); curElem.css( props );
} }
} }
...@@ -214,7 +219,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( ...@@ -214,7 +219,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
// getComputedStyle returns percent when specified for top/left/bottom/right; // getComputedStyle returns percent when specified for top/left/bottom/right;
// rather than make the css module depend on the offset module, just check for it here // rather than make the css module depend on the offset module, just check for it here
jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.each( [ "top", "left" ], function( _i, prop ) {
jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
function( elem, computed ) { function( elem, computed ) {
if ( computed ) { if ( computed ) {
......
...@@ -34,6 +34,7 @@ define( [ ...@@ -34,6 +34,7 @@ define( [
*/ */
var hasDuplicate, sortInput, var hasDuplicate, sortInput,
rhtmlSuffix = /HTML$/i,
sortStable = jQuery.expando.split( "" ).sort( sortOrder ).join( "" ) === jQuery.expando, sortStable = jQuery.expando.split( "" ).sort( sortOrder ).join( "" ) === jQuery.expando,
matches = documentElement.matches || matches = documentElement.matches ||
documentElement.webkitMatchesSelector || documentElement.webkitMatchesSelector ||
...@@ -200,11 +201,14 @@ jQuery.extend( { ...@@ -200,11 +201,14 @@ jQuery.extend( {
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains( bup ) ); return a === bup || !!( bup && bup.nodeType === 1 && adown.contains( bup ) );
}, },
isXMLDoc: function( elem ) { isXMLDoc: function( elem ) {
var namespace = elem.namespaceURI,
// documentElement is verified for cases where it doesn't yet exist documentElement = ( elem.ownerDocument || elem ).documentElement;
// (such as loading iframes in IE - #4833)
var documentElement = elem && ( elem.ownerDocument || elem ).documentElement; // Assume HTML when documentElement doesn't yet exist, such as inside
return documentElement ? documentElement.nodeName !== "HTML" : false; // document fragments.
return !rhtmlSuffix.test( namespace ||
documentElement && documentElement.nodeName ||
"HTML" );
}, },
expr: { expr: {
attrHandle: {}, attrHandle: {},
......
...@@ -114,7 +114,7 @@ jQuery.fn.extend( { ...@@ -114,7 +114,7 @@ jQuery.fn.extend( {
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !rcheckableType.test( type ) ); ( this.checked || !rcheckableType.test( type ) );
} ) } )
.map( function( i, elem ) { .map( function( _i, elem ) {
var val = jQuery( this ).val(); var val = jQuery( this ).val();
if ( val == null ) { if ( val == null ) {
......
define( [ define( [
"./core", "./core",
"./var/getProto",
"./var/indexOf", "./var/indexOf",
"./traversing/var/dir", "./traversing/var/dir",
"./traversing/var/siblings", "./traversing/var/siblings",
...@@ -9,7 +10,7 @@ define( [ ...@@ -9,7 +10,7 @@ define( [
"./core/init", "./core/init",
"./traversing/findFilter", "./traversing/findFilter",
"./selector" "./selector"
], function( jQuery, indexOf, dir, siblings, rneedsContext, nodeName ) { ], function( jQuery, getProto, indexOf, dir, siblings, rneedsContext, nodeName ) {
"use strict"; "use strict";
...@@ -117,7 +118,7 @@ jQuery.each( { ...@@ -117,7 +118,7 @@ jQuery.each( {
parents: function( elem ) { parents: function( elem ) {
return dir( elem, "parentNode" ); return dir( elem, "parentNode" );
}, },
parentsUntil: function( elem, i, until ) { parentsUntil: function( elem, _i, until ) {
return dir( elem, "parentNode", until ); return dir( elem, "parentNode", until );
}, },
next: function( elem ) { next: function( elem ) {
...@@ -132,10 +133,10 @@ jQuery.each( { ...@@ -132,10 +133,10 @@ jQuery.each( {
prevAll: function( elem ) { prevAll: function( elem ) {
return dir( elem, "previousSibling" ); return dir( elem, "previousSibling" );
}, },
nextUntil: function( elem, i, until ) { nextUntil: function( elem, _i, until ) {
return dir( elem, "nextSibling", until ); return dir( elem, "nextSibling", until );
}, },
prevUntil: function( elem, i, until ) { prevUntil: function( elem, _i, until ) {
return dir( elem, "previousSibling", until ); return dir( elem, "previousSibling", until );
}, },
siblings: function( elem ) { siblings: function( elem ) {
...@@ -145,7 +146,13 @@ jQuery.each( { ...@@ -145,7 +146,13 @@ jQuery.each( {
return siblings( elem.firstChild ); return siblings( elem.firstChild );
}, },
contents: function( elem ) { contents: function( elem ) {
if ( typeof elem.contentDocument !== "undefined" ) { if ( elem.contentDocument != null &&
// Support: IE 11+
// <object> elements with no `data` attribute has an object
// `contentDocument` with a `null` prototype.
getProto( elem.contentDocument ) ) {
return elem.contentDocument; return elem.contentDocument;
} }
......
define( [
"./arr"
], function( arr ) {
"use strict";
return arr.concat;
} );
define( [
"./arr"
], function( arr ) {
"use strict";
// Support: IE 9 - 11+, Edge 18+, Android Browser 4.0 - 4.3 only, iOS 7 - 11 only, Safari 11 only,
// Firefox <= 61 only
// Provide fallback for browsers without Array#flat.
return arr.flat ? function( array ) {
return arr.flat.call( array );
} : function( array ) {
return arr.concat.apply( [], array );
};
} );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment