jquery-rails 4.3.1 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +8 -3
- data/CHANGELOG.md +25 -0
- data/README.md +13 -1
- data/VERSIONS.md +5 -0
- data/lib/jquery/assert_select.rb +16 -5
- data/lib/jquery/rails/version.rb +2 -2
- data/test/assert_select_jquery_test.rb +26 -0
- data/vendor/assets/javascripts/jquery3.js +1554 -935
- data/vendor/assets/javascripts/jquery3.min.js +2 -4
- data/vendor/assets/javascripts/jquery3.min.map +1 -1
- metadata +3 -4
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* jQuery JavaScript Library v3.
|
2
|
+
* jQuery JavaScript Library v3.5.1
|
3
3
|
* https://jquery.com/
|
4
4
|
*
|
5
5
|
* Includes Sizzle.js
|
@@ -9,7 +9,7 @@
|
|
9
9
|
* Released under the MIT license
|
10
10
|
* https://jquery.org/license
|
11
11
|
*
|
12
|
-
* Date:
|
12
|
+
* Date: 2020-05-04T22:49Z
|
13
13
|
*/
|
14
14
|
( function( global, factory ) {
|
15
15
|
|
@@ -47,13 +47,16 @@
|
|
47
47
|
|
48
48
|
var arr = [];
|
49
49
|
|
50
|
-
var document = window.document;
|
51
|
-
|
52
50
|
var getProto = Object.getPrototypeOf;
|
53
51
|
|
54
52
|
var slice = arr.slice;
|
55
53
|
|
56
|
-
var
|
54
|
+
var flat = arr.flat ? function( array ) {
|
55
|
+
return arr.flat.call( array );
|
56
|
+
} : function( array ) {
|
57
|
+
return arr.concat.apply( [], array );
|
58
|
+
};
|
59
|
+
|
57
60
|
|
58
61
|
var push = arr.push;
|
59
62
|
|
@@ -71,16 +74,72 @@ var ObjectFunctionString = fnToString.call( Object );
|
|
71
74
|
|
72
75
|
var support = {};
|
73
76
|
|
77
|
+
var isFunction = function isFunction( obj ) {
|
78
|
+
|
79
|
+
// Support: Chrome <=57, Firefox <=52
|
80
|
+
// In some browsers, typeof returns "function" for HTML <object> elements
|
81
|
+
// (i.e., `typeof document.createElement( "object" ) === "function"`).
|
82
|
+
// We don't want to classify *any* DOM node as a function.
|
83
|
+
return typeof obj === "function" && typeof obj.nodeType !== "number";
|
84
|
+
};
|
85
|
+
|
86
|
+
|
87
|
+
var isWindow = function isWindow( obj ) {
|
88
|
+
return obj != null && obj === obj.window;
|
89
|
+
};
|
90
|
+
|
91
|
+
|
92
|
+
var document = window.document;
|
74
93
|
|
75
94
|
|
76
|
-
|
95
|
+
|
96
|
+
var preservedScriptAttributes = {
|
97
|
+
type: true,
|
98
|
+
src: true,
|
99
|
+
nonce: true,
|
100
|
+
noModule: true
|
101
|
+
};
|
102
|
+
|
103
|
+
function DOMEval( code, node, doc ) {
|
77
104
|
doc = doc || document;
|
78
105
|
|
79
|
-
var
|
106
|
+
var i, val,
|
107
|
+
script = doc.createElement( "script" );
|
80
108
|
|
81
109
|
script.text = code;
|
110
|
+
if ( node ) {
|
111
|
+
for ( i in preservedScriptAttributes ) {
|
112
|
+
|
113
|
+
// Support: Firefox 64+, Edge 18+
|
114
|
+
// Some browsers don't support the "nonce" property on scripts.
|
115
|
+
// On the other hand, just using `getAttribute` is not enough as
|
116
|
+
// the `nonce` attribute is reset to an empty string whenever it
|
117
|
+
// becomes browsing-context connected.
|
118
|
+
// See https://github.com/whatwg/html/issues/2369
|
119
|
+
// See https://html.spec.whatwg.org/#nonce-attributes
|
120
|
+
// The `node.getAttribute` check was added for the sake of
|
121
|
+
// `jQuery.globalEval` so that it can fake a nonce-containing node
|
122
|
+
// via an object.
|
123
|
+
val = node[ i ] || node.getAttribute && node.getAttribute( i );
|
124
|
+
if ( val ) {
|
125
|
+
script.setAttribute( i, val );
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
82
129
|
doc.head.appendChild( script ).parentNode.removeChild( script );
|
83
130
|
}
|
131
|
+
|
132
|
+
|
133
|
+
function toType( obj ) {
|
134
|
+
if ( obj == null ) {
|
135
|
+
return obj + "";
|
136
|
+
}
|
137
|
+
|
138
|
+
// Support: Android <=2.3 only (functionish RegExp)
|
139
|
+
return typeof obj === "object" || typeof obj === "function" ?
|
140
|
+
class2type[ toString.call( obj ) ] || "object" :
|
141
|
+
typeof obj;
|
142
|
+
}
|
84
143
|
/* global Symbol */
|
85
144
|
// Defining this global in .eslintrc.json would create a danger of using the global
|
86
145
|
// unguarded in another place, it seems safer to define global only for this module
|
@@ -88,7 +147,7 @@ var support = {};
|
|
88
147
|
|
89
148
|
|
90
149
|
var
|
91
|
-
version = "3.
|
150
|
+
version = "3.5.1",
|
92
151
|
|
93
152
|
// Define a local copy of jQuery
|
94
153
|
jQuery = function( selector, context ) {
|
@@ -96,19 +155,6 @@ var
|
|
96
155
|
// The jQuery object is actually just the init constructor 'enhanced'
|
97
156
|
// Need init if jQuery is called (just allow error to be thrown if not included)
|
98
157
|
return new jQuery.fn.init( selector, context );
|
99
|
-
},
|
100
|
-
|
101
|
-
// Support: Android <=4.0 only
|
102
|
-
// Make sure we trim BOM and NBSP
|
103
|
-
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
104
|
-
|
105
|
-
// Matches dashed string for camelizing
|
106
|
-
rmsPrefix = /^-ms-/,
|
107
|
-
rdashAlpha = /-([a-z])/g,
|
108
|
-
|
109
|
-
// Used by jQuery.camelCase as callback to replace()
|
110
|
-
fcamelCase = function( all, letter ) {
|
111
|
-
return letter.toUpperCase();
|
112
158
|
};
|
113
159
|
|
114
160
|
jQuery.fn = jQuery.prototype = {
|
@@ -175,6 +221,18 @@ jQuery.fn = jQuery.prototype = {
|
|
175
221
|
return this.eq( -1 );
|
176
222
|
},
|
177
223
|
|
224
|
+
even: function() {
|
225
|
+
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
|
226
|
+
return ( i + 1 ) % 2;
|
227
|
+
} ) );
|
228
|
+
},
|
229
|
+
|
230
|
+
odd: function() {
|
231
|
+
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
|
232
|
+
return i % 2;
|
233
|
+
} ) );
|
234
|
+
},
|
235
|
+
|
178
236
|
eq: function( i ) {
|
179
237
|
var len = this.length,
|
180
238
|
j = +i + ( i < 0 ? len : 0 );
|
@@ -209,7 +267,7 @@ jQuery.extend = jQuery.fn.extend = function() {
|
|
209
267
|
}
|
210
268
|
|
211
269
|
// Handle case when target is a string or something (possible in deep copy)
|
212
|
-
if ( typeof target !== "object" && !
|
270
|
+
if ( typeof target !== "object" && !isFunction( target ) ) {
|
213
271
|
target = {};
|
214
272
|
}
|
215
273
|
|
@@ -226,25 +284,28 @@ jQuery.extend = jQuery.fn.extend = function() {
|
|
226
284
|
|
227
285
|
// Extend the base object
|
228
286
|
for ( name in options ) {
|
229
|
-
src = target[ name ];
|
230
287
|
copy = options[ name ];
|
231
288
|
|
289
|
+
// Prevent Object.prototype pollution
|
232
290
|
// Prevent never-ending loop
|
233
|
-
if ( target === copy ) {
|
291
|
+
if ( name === "__proto__" || target === copy ) {
|
234
292
|
continue;
|
235
293
|
}
|
236
294
|
|
237
295
|
// Recurse if we're merging plain objects or arrays
|
238
296
|
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
|
239
297
|
( copyIsArray = Array.isArray( copy ) ) ) ) {
|
298
|
+
src = target[ name ];
|
240
299
|
|
241
|
-
|
242
|
-
|
243
|
-
clone =
|
244
|
-
|
300
|
+
// Ensure proper type for the source value
|
301
|
+
if ( copyIsArray && !Array.isArray( src ) ) {
|
302
|
+
clone = [];
|
303
|
+
} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
|
304
|
+
clone = {};
|
245
305
|
} else {
|
246
|
-
clone = src
|
306
|
+
clone = src;
|
247
307
|
}
|
308
|
+
copyIsArray = false;
|
248
309
|
|
249
310
|
// Never move original objects, clone them
|
250
311
|
target[ name ] = jQuery.extend( deep, clone, copy );
|
@@ -275,28 +336,6 @@ jQuery.extend( {
|
|
275
336
|
|
276
337
|
noop: function() {},
|
277
338
|
|
278
|
-
isFunction: function( obj ) {
|
279
|
-
return jQuery.type( obj ) === "function";
|
280
|
-
},
|
281
|
-
|
282
|
-
isWindow: function( obj ) {
|
283
|
-
return obj != null && obj === obj.window;
|
284
|
-
},
|
285
|
-
|
286
|
-
isNumeric: function( obj ) {
|
287
|
-
|
288
|
-
// As of jQuery 3.0, isNumeric is limited to
|
289
|
-
// strings and numbers (primitives or objects)
|
290
|
-
// that can be coerced to finite numbers (gh-2662)
|
291
|
-
var type = jQuery.type( obj );
|
292
|
-
return ( type === "number" || type === "string" ) &&
|
293
|
-
|
294
|
-
// parseFloat NaNs numeric-cast false positives ("")
|
295
|
-
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
296
|
-
// subtraction forces infinities to NaN
|
297
|
-
!isNaN( obj - parseFloat( obj ) );
|
298
|
-
},
|
299
|
-
|
300
339
|
isPlainObject: function( obj ) {
|
301
340
|
var proto, Ctor;
|
302
341
|
|
@@ -319,9 +358,6 @@ jQuery.extend( {
|
|
319
358
|
},
|
320
359
|
|
321
360
|
isEmptyObject: function( obj ) {
|
322
|
-
|
323
|
-
/* eslint-disable no-unused-vars */
|
324
|
-
// See https://github.com/eslint/eslint/issues/6125
|
325
361
|
var name;
|
326
362
|
|
327
363
|
for ( name in obj ) {
|
@@ -330,27 +366,10 @@ jQuery.extend( {
|
|
330
366
|
return true;
|
331
367
|
},
|
332
368
|
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
}
|
337
|
-
|
338
|
-
// Support: Android <=2.3 only (functionish RegExp)
|
339
|
-
return typeof obj === "object" || typeof obj === "function" ?
|
340
|
-
class2type[ toString.call( obj ) ] || "object" :
|
341
|
-
typeof obj;
|
342
|
-
},
|
343
|
-
|
344
|
-
// Evaluates a script in a global context
|
345
|
-
globalEval: function( code ) {
|
346
|
-
DOMEval( code );
|
347
|
-
},
|
348
|
-
|
349
|
-
// Convert dashed to camelCase; used by the css and data modules
|
350
|
-
// Support: IE <=9 - 11, Edge 12 - 13
|
351
|
-
// Microsoft forgot to hump their vendor prefix (#9572)
|
352
|
-
camelCase: function( string ) {
|
353
|
-
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
369
|
+
// Evaluates a script in a provided context; falls back to the global one
|
370
|
+
// if not specified.
|
371
|
+
globalEval: function( code, options, doc ) {
|
372
|
+
DOMEval( code, { nonce: options && options.nonce }, doc );
|
354
373
|
},
|
355
374
|
|
356
375
|
each: function( obj, callback ) {
|
@@ -374,13 +393,6 @@ jQuery.extend( {
|
|
374
393
|
return obj;
|
375
394
|
},
|
376
395
|
|
377
|
-
// Support: Android <=4.0 only
|
378
|
-
trim: function( text ) {
|
379
|
-
return text == null ?
|
380
|
-
"" :
|
381
|
-
( text + "" ).replace( rtrim, "" );
|
382
|
-
},
|
383
|
-
|
384
396
|
// results is for internal usage only
|
385
397
|
makeArray: function( arr, results ) {
|
386
398
|
var ret = results || [];
|
@@ -467,43 +479,12 @@ jQuery.extend( {
|
|
467
479
|
}
|
468
480
|
|
469
481
|
// Flatten any nested arrays
|
470
|
-
return
|
482
|
+
return flat( ret );
|
471
483
|
},
|
472
484
|
|
473
485
|
// A global GUID counter for objects
|
474
486
|
guid: 1,
|
475
487
|
|
476
|
-
// Bind a function to a context, optionally partially applying any
|
477
|
-
// arguments.
|
478
|
-
proxy: function( fn, context ) {
|
479
|
-
var tmp, args, proxy;
|
480
|
-
|
481
|
-
if ( typeof context === "string" ) {
|
482
|
-
tmp = fn[ context ];
|
483
|
-
context = fn;
|
484
|
-
fn = tmp;
|
485
|
-
}
|
486
|
-
|
487
|
-
// Quick check to determine if target is callable, in the spec
|
488
|
-
// this throws a TypeError, but we will just return undefined.
|
489
|
-
if ( !jQuery.isFunction( fn ) ) {
|
490
|
-
return undefined;
|
491
|
-
}
|
492
|
-
|
493
|
-
// Simulated bind
|
494
|
-
args = slice.call( arguments, 2 );
|
495
|
-
proxy = function() {
|
496
|
-
return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
|
497
|
-
};
|
498
|
-
|
499
|
-
// Set the guid of unique handler to the same of original handler, so it can be removed
|
500
|
-
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
501
|
-
|
502
|
-
return proxy;
|
503
|
-
},
|
504
|
-
|
505
|
-
now: Date.now,
|
506
|
-
|
507
488
|
// jQuery.support is not used in Core but other projects attach their
|
508
489
|
// properties to it so it needs to exist.
|
509
490
|
support: support
|
@@ -515,7 +496,7 @@ if ( typeof Symbol === "function" ) {
|
|
515
496
|
|
516
497
|
// Populate the class2type map
|
517
498
|
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
|
518
|
-
function(
|
499
|
+
function( _i, name ) {
|
519
500
|
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
520
501
|
} );
|
521
502
|
|
@@ -526,9 +507,9 @@ function isArrayLike( obj ) {
|
|
526
507
|
// hasOwn isn't used here due to false negatives
|
527
508
|
// regarding Nodelist length in IE
|
528
509
|
var length = !!obj && "length" in obj && obj.length,
|
529
|
-
type =
|
510
|
+
type = toType( obj );
|
530
511
|
|
531
|
-
if (
|
512
|
+
if ( isFunction( obj ) || isWindow( obj ) ) {
|
532
513
|
return false;
|
533
514
|
}
|
534
515
|
|
@@ -537,17 +518,16 @@ function isArrayLike( obj ) {
|
|
537
518
|
}
|
538
519
|
var Sizzle =
|
539
520
|
/*!
|
540
|
-
* Sizzle CSS Selector Engine v2.3.
|
521
|
+
* Sizzle CSS Selector Engine v2.3.5
|
541
522
|
* https://sizzlejs.com/
|
542
523
|
*
|
543
|
-
* Copyright
|
524
|
+
* Copyright JS Foundation and other contributors
|
544
525
|
* Released under the MIT license
|
545
|
-
*
|
526
|
+
* https://js.foundation/
|
546
527
|
*
|
547
|
-
* Date:
|
528
|
+
* Date: 2020-03-14
|
548
529
|
*/
|
549
|
-
(function( window ) {
|
550
|
-
|
530
|
+
( function( window ) {
|
551
531
|
var i,
|
552
532
|
support,
|
553
533
|
Expr,
|
@@ -578,6 +558,7 @@ var i,
|
|
578
558
|
classCache = createCache(),
|
579
559
|
tokenCache = createCache(),
|
580
560
|
compilerCache = createCache(),
|
561
|
+
nonnativeSelectorCache = createCache(),
|
581
562
|
sortOrder = function( a, b ) {
|
582
563
|
if ( a === b ) {
|
583
564
|
hasDuplicate = true;
|
@@ -586,61 +567,71 @@ var i,
|
|
586
567
|
},
|
587
568
|
|
588
569
|
// Instance methods
|
589
|
-
hasOwn = ({}).hasOwnProperty,
|
570
|
+
hasOwn = ( {} ).hasOwnProperty,
|
590
571
|
arr = [],
|
591
572
|
pop = arr.pop,
|
592
|
-
|
573
|
+
pushNative = arr.push,
|
593
574
|
push = arr.push,
|
594
575
|
slice = arr.slice,
|
576
|
+
|
595
577
|
// Use a stripped-down indexOf as it's faster than native
|
596
578
|
// https://jsperf.com/thor-indexof-vs-for/5
|
597
579
|
indexOf = function( list, elem ) {
|
598
580
|
var i = 0,
|
599
581
|
len = list.length;
|
600
582
|
for ( ; i < len; i++ ) {
|
601
|
-
if ( list[i] === elem ) {
|
583
|
+
if ( list[ i ] === elem ) {
|
602
584
|
return i;
|
603
585
|
}
|
604
586
|
}
|
605
587
|
return -1;
|
606
588
|
},
|
607
589
|
|
608
|
-
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|
|
590
|
+
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
|
591
|
+
"ismap|loop|multiple|open|readonly|required|scoped",
|
609
592
|
|
610
593
|
// Regular expressions
|
611
594
|
|
612
595
|
// http://www.w3.org/TR/css3-selectors/#whitespace
|
613
596
|
whitespace = "[\\x20\\t\\r\\n\\f]",
|
614
597
|
|
615
|
-
//
|
616
|
-
identifier = "(
|
598
|
+
// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
|
599
|
+
identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
|
600
|
+
"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
|
617
601
|
|
618
602
|
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
|
619
603
|
attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
|
604
|
+
|
620
605
|
// Operator (capture 2)
|
621
606
|
"*([*^$|!~]?=)" + whitespace +
|
622
|
-
|
623
|
-
"
|
624
|
-
|
607
|
+
|
608
|
+
// "Attribute values must be CSS identifiers [capture 5]
|
609
|
+
// or strings [capture 3 or capture 4]"
|
610
|
+
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
|
611
|
+
whitespace + "*\\]",
|
625
612
|
|
626
613
|
pseudos = ":(" + identifier + ")(?:\\((" +
|
614
|
+
|
627
615
|
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
|
628
616
|
// 1. quoted (capture 3; capture 4 or capture 5)
|
629
617
|
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
|
618
|
+
|
630
619
|
// 2. simple (capture 6)
|
631
620
|
"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
|
621
|
+
|
632
622
|
// 3. anything else (capture 2)
|
633
623
|
".*" +
|
634
624
|
")\\)|)",
|
635
625
|
|
636
626
|
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
|
637
627
|
rwhitespace = new RegExp( whitespace + "+", "g" ),
|
638
|
-
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
|
628
|
+
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
|
629
|
+
whitespace + "+$", "g" ),
|
639
630
|
|
640
631
|
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
|
641
|
-
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
|
642
|
-
|
643
|
-
|
632
|
+
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
|
633
|
+
"*" ),
|
634
|
+
rdescend = new RegExp( whitespace + "|>" ),
|
644
635
|
|
645
636
|
rpseudo = new RegExp( pseudos ),
|
646
637
|
ridentifier = new RegExp( "^" + identifier + "$" ),
|
@@ -651,16 +642,19 @@ var i,
|
|
651
642
|
"TAG": new RegExp( "^(" + identifier + "|[*])" ),
|
652
643
|
"ATTR": new RegExp( "^" + attributes ),
|
653
644
|
"PSEUDO": new RegExp( "^" + pseudos ),
|
654
|
-
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
|
655
|
-
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
|
656
|
-
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
|
645
|
+
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
|
646
|
+
whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
|
647
|
+
whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
|
657
648
|
"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
|
649
|
+
|
658
650
|
// For use in libraries implementing .is()
|
659
651
|
// We use this for POS matching in `select`
|
660
|
-
"needsContext": new RegExp( "^" + whitespace +
|
661
|
-
|
652
|
+
"needsContext": new RegExp( "^" + whitespace +
|
653
|
+
"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
|
654
|
+
"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
|
662
655
|
},
|
663
656
|
|
657
|
+
rhtml = /HTML$/i,
|
664
658
|
rinputs = /^(?:input|select|textarea|button)$/i,
|
665
659
|
rheader = /^h\d$/i,
|
666
660
|
|
@@ -673,18 +667,21 @@ var i,
|
|
673
667
|
|
674
668
|
// CSS escapes
|
675
669
|
// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
|
676
|
-
runescape = new RegExp( "\\\\
|
677
|
-
funescape = function(
|
678
|
-
var high = "0x" +
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
670
|
+
runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
|
671
|
+
funescape = function( escape, nonHex ) {
|
672
|
+
var high = "0x" + escape.slice( 1 ) - 0x10000;
|
673
|
+
|
674
|
+
return nonHex ?
|
675
|
+
|
676
|
+
// Strip the backslash prefix from a non-hex escape sequence
|
677
|
+
nonHex :
|
678
|
+
|
679
|
+
// Replace a hexadecimal escape sequence with the encoded Unicode code point
|
680
|
+
// Support: IE <=11+
|
681
|
+
// For values outside the Basic Multilingual Plane (BMP), manually construct a
|
682
|
+
// surrogate pair
|
684
683
|
high < 0 ?
|
685
|
-
// BMP codepoint
|
686
684
|
String.fromCharCode( high + 0x10000 ) :
|
687
|
-
// Supplemental Plane codepoint (surrogate pair)
|
688
685
|
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
689
686
|
},
|
690
687
|
|
@@ -700,7 +697,8 @@ var i,
|
|
700
697
|
}
|
701
698
|
|
702
699
|
// Control characters and (dependent upon position) numbers get escaped as code points
|
703
|
-
return ch.slice( 0, -1 ) + "\\" +
|
700
|
+
return ch.slice( 0, -1 ) + "\\" +
|
701
|
+
ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
|
704
702
|
}
|
705
703
|
|
706
704
|
// Other potentially-special ASCII characters get backslash-escaped
|
@@ -715,9 +713,9 @@ var i,
|
|
715
713
|
setDocument();
|
716
714
|
},
|
717
715
|
|
718
|
-
|
716
|
+
inDisabledFieldset = addCombinator(
|
719
717
|
function( elem ) {
|
720
|
-
return elem.disabled === true && (
|
718
|
+
return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
|
721
719
|
},
|
722
720
|
{ dir: "parentNode", next: "legend" }
|
723
721
|
);
|
@@ -725,18 +723,20 @@ var i,
|
|
725
723
|
// Optimize for push.apply( _, NodeList )
|
726
724
|
try {
|
727
725
|
push.apply(
|
728
|
-
(arr = slice.call( preferredDoc.childNodes )),
|
726
|
+
( arr = slice.call( preferredDoc.childNodes ) ),
|
729
727
|
preferredDoc.childNodes
|
730
728
|
);
|
729
|
+
|
731
730
|
// Support: Android<4.0
|
732
731
|
// Detect silently failing push.apply
|
732
|
+
// eslint-disable-next-line no-unused-expressions
|
733
733
|
arr[ preferredDoc.childNodes.length ].nodeType;
|
734
734
|
} catch ( e ) {
|
735
735
|
push = { apply: arr.length ?
|
736
736
|
|
737
737
|
// Leverage slice if possible
|
738
738
|
function( target, els ) {
|
739
|
-
|
739
|
+
pushNative.apply( target, slice.call( els ) );
|
740
740
|
} :
|
741
741
|
|
742
742
|
// Support: IE<9
|
@@ -744,8 +744,9 @@ try {
|
|
744
744
|
function( target, els ) {
|
745
745
|
var j = target.length,
|
746
746
|
i = 0;
|
747
|
+
|
747
748
|
// Can't trust NodeList.length
|
748
|
-
while ( (target[j++] = els[i++]) ) {}
|
749
|
+
while ( ( target[ j++ ] = els[ i++ ] ) ) {}
|
749
750
|
target.length = j - 1;
|
750
751
|
}
|
751
752
|
};
|
@@ -769,24 +770,21 @@ function Sizzle( selector, context, results, seed ) {
|
|
769
770
|
|
770
771
|
// Try to shortcut find operations (as opposed to filters) in HTML documents
|
771
772
|
if ( !seed ) {
|
772
|
-
|
773
|
-
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
|
774
|
-
setDocument( context );
|
775
|
-
}
|
773
|
+
setDocument( context );
|
776
774
|
context = context || document;
|
777
775
|
|
778
776
|
if ( documentIsHTML ) {
|
779
777
|
|
780
778
|
// If the selector is sufficiently simple, try using a "get*By*" DOM method
|
781
779
|
// (excepting DocumentFragment context, where the methods don't exist)
|
782
|
-
if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
|
780
|
+
if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
|
783
781
|
|
784
782
|
// ID selector
|
785
|
-
if ( (m = match[1]) ) {
|
783
|
+
if ( ( m = match[ 1 ] ) ) {
|
786
784
|
|
787
785
|
// Document context
|
788
786
|
if ( nodeType === 9 ) {
|
789
|
-
if ( (elem = context.getElementById( m )) ) {
|
787
|
+
if ( ( elem = context.getElementById( m ) ) ) {
|
790
788
|
|
791
789
|
// Support: IE, Opera, Webkit
|
792
790
|
// TODO: identify versions
|
@@ -805,7 +803,7 @@ function Sizzle( selector, context, results, seed ) {
|
|
805
803
|
// Support: IE, Opera, Webkit
|
806
804
|
// TODO: identify versions
|
807
805
|
// getElementById can match elements by name instead of ID
|
808
|
-
if ( newContext && (elem = newContext.getElementById( m )) &&
|
806
|
+
if ( newContext && ( elem = newContext.getElementById( m ) ) &&
|
809
807
|
contains( context, elem ) &&
|
810
808
|
elem.id === m ) {
|
811
809
|
|
@@ -815,12 +813,12 @@ function Sizzle( selector, context, results, seed ) {
|
|
815
813
|
}
|
816
814
|
|
817
815
|
// Type selector
|
818
|
-
} else if ( match[2] ) {
|
816
|
+
} else if ( match[ 2 ] ) {
|
819
817
|
push.apply( results, context.getElementsByTagName( selector ) );
|
820
818
|
return results;
|
821
819
|
|
822
820
|
// Class selector
|
823
|
-
} else if ( (m = match[3]) && support.getElementsByClassName &&
|
821
|
+
} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
|
824
822
|
context.getElementsByClassName ) {
|
825
823
|
|
826
824
|
push.apply( results, context.getElementsByClassName( m ) );
|
@@ -830,50 +828,62 @@ function Sizzle( selector, context, results, seed ) {
|
|
830
828
|
|
831
829
|
// Take advantage of querySelectorAll
|
832
830
|
if ( support.qsa &&
|
833
|
-
!
|
834
|
-
(!rbuggyQSA || !rbuggyQSA.test( selector )
|
835
|
-
|
836
|
-
if ( nodeType !== 1 ) {
|
837
|
-
newContext = context;
|
838
|
-
newSelector = selector;
|
831
|
+
!nonnativeSelectorCache[ selector + " " ] &&
|
832
|
+
( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
|
839
833
|
|
840
|
-
//
|
841
|
-
// Thanks to Andrew Dupont for this workaround technique
|
842
|
-
// Support: IE <=8
|
834
|
+
// Support: IE 8 only
|
843
835
|
// Exclude object elements
|
844
|
-
|
836
|
+
( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
|
845
837
|
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
838
|
+
newSelector = selector;
|
839
|
+
newContext = context;
|
840
|
+
|
841
|
+
// qSA considers elements outside a scoping root when evaluating child or
|
842
|
+
// descendant combinators, which is not what we want.
|
843
|
+
// In such cases, we work around the behavior by prefixing every selector in the
|
844
|
+
// list with an ID selector referencing the scope context.
|
845
|
+
// The technique has to be used as well when a leading combinator is used
|
846
|
+
// as such selectors are not recognized by querySelectorAll.
|
847
|
+
// Thanks to Andrew Dupont for this technique.
|
848
|
+
if ( nodeType === 1 &&
|
849
|
+
( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
|
850
|
+
|
851
|
+
// Expand context for sibling selectors
|
852
|
+
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
|
853
|
+
context;
|
854
|
+
|
855
|
+
// We can use :scope instead of the ID hack if the browser
|
856
|
+
// supports it & if we're not changing the context.
|
857
|
+
if ( newContext !== context || !support.scope ) {
|
858
|
+
|
859
|
+
// Capture the context ID, setting it first if necessary
|
860
|
+
if ( ( nid = context.getAttribute( "id" ) ) ) {
|
861
|
+
nid = nid.replace( rcssescape, fcssescape );
|
862
|
+
} else {
|
863
|
+
context.setAttribute( "id", ( nid = expando ) );
|
864
|
+
}
|
851
865
|
}
|
852
866
|
|
853
867
|
// Prefix every selector in the list
|
854
868
|
groups = tokenize( selector );
|
855
869
|
i = groups.length;
|
856
870
|
while ( i-- ) {
|
857
|
-
groups[i] = "#" + nid
|
871
|
+
groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
|
872
|
+
toSelector( groups[ i ] );
|
858
873
|
}
|
859
874
|
newSelector = groups.join( "," );
|
860
|
-
|
861
|
-
// Expand context for sibling selectors
|
862
|
-
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
|
863
|
-
context;
|
864
875
|
}
|
865
876
|
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
}
|
877
|
+
try {
|
878
|
+
push.apply( results,
|
879
|
+
newContext.querySelectorAll( newSelector )
|
880
|
+
);
|
881
|
+
return results;
|
882
|
+
} catch ( qsaError ) {
|
883
|
+
nonnativeSelectorCache( selector, true );
|
884
|
+
} finally {
|
885
|
+
if ( nid === expando ) {
|
886
|
+
context.removeAttribute( "id" );
|
877
887
|
}
|
878
888
|
}
|
879
889
|
}
|
@@ -894,12 +904,14 @@ function createCache() {
|
|
894
904
|
var keys = [];
|
895
905
|
|
896
906
|
function cache( key, value ) {
|
907
|
+
|
897
908
|
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
|
898
909
|
if ( keys.push( key + " " ) > Expr.cacheLength ) {
|
910
|
+
|
899
911
|
// Only keep the most recent entries
|
900
912
|
delete cache[ keys.shift() ];
|
901
913
|
}
|
902
|
-
return (cache[ key + " " ] = value);
|
914
|
+
return ( cache[ key + " " ] = value );
|
903
915
|
}
|
904
916
|
return cache;
|
905
917
|
}
|
@@ -918,17 +930,19 @@ function markFunction( fn ) {
|
|
918
930
|
* @param {Function} fn Passed the created element and returns a boolean result
|
919
931
|
*/
|
920
932
|
function assert( fn ) {
|
921
|
-
var el = document.createElement("fieldset");
|
933
|
+
var el = document.createElement( "fieldset" );
|
922
934
|
|
923
935
|
try {
|
924
936
|
return !!fn( el );
|
925
|
-
} catch (e) {
|
937
|
+
} catch ( e ) {
|
926
938
|
return false;
|
927
939
|
} finally {
|
940
|
+
|
928
941
|
// Remove from its parent by default
|
929
942
|
if ( el.parentNode ) {
|
930
943
|
el.parentNode.removeChild( el );
|
931
944
|
}
|
945
|
+
|
932
946
|
// release memory in IE
|
933
947
|
el = null;
|
934
948
|
}
|
@@ -940,11 +954,11 @@ function assert( fn ) {
|
|
940
954
|
* @param {Function} handler The method that will be applied
|
941
955
|
*/
|
942
956
|
function addHandle( attrs, handler ) {
|
943
|
-
var arr = attrs.split("|"),
|
957
|
+
var arr = attrs.split( "|" ),
|
944
958
|
i = arr.length;
|
945
959
|
|
946
960
|
while ( i-- ) {
|
947
|
-
Expr.attrHandle[ arr[i] ] = handler;
|
961
|
+
Expr.attrHandle[ arr[ i ] ] = handler;
|
948
962
|
}
|
949
963
|
}
|
950
964
|
|
@@ -966,7 +980,7 @@ function siblingCheck( a, b ) {
|
|
966
980
|
|
967
981
|
// Check if b follows a
|
968
982
|
if ( cur ) {
|
969
|
-
while ( (cur = cur.nextSibling) ) {
|
983
|
+
while ( ( cur = cur.nextSibling ) ) {
|
970
984
|
if ( cur === b ) {
|
971
985
|
return -1;
|
972
986
|
}
|
@@ -994,7 +1008,7 @@ function createInputPseudo( type ) {
|
|
994
1008
|
function createButtonPseudo( type ) {
|
995
1009
|
return function( elem ) {
|
996
1010
|
var name = elem.nodeName.toLowerCase();
|
997
|
-
return (name === "input" || name === "button") && elem.type === type;
|
1011
|
+
return ( name === "input" || name === "button" ) && elem.type === type;
|
998
1012
|
};
|
999
1013
|
}
|
1000
1014
|
|
@@ -1037,7 +1051,7 @@ function createDisabledPseudo( disabled ) {
|
|
1037
1051
|
// Where there is no isDisabled, check manually
|
1038
1052
|
/* jshint -W018 */
|
1039
1053
|
elem.isDisabled !== !disabled &&
|
1040
|
-
|
1054
|
+
inDisabledFieldset( elem ) === disabled;
|
1041
1055
|
}
|
1042
1056
|
|
1043
1057
|
return elem.disabled === disabled;
|
@@ -1059,21 +1073,21 @@ function createDisabledPseudo( disabled ) {
|
|
1059
1073
|
* @param {Function} fn
|
1060
1074
|
*/
|
1061
1075
|
function createPositionalPseudo( fn ) {
|
1062
|
-
return markFunction(function( argument ) {
|
1076
|
+
return markFunction( function( argument ) {
|
1063
1077
|
argument = +argument;
|
1064
|
-
return markFunction(function( seed, matches ) {
|
1078
|
+
return markFunction( function( seed, matches ) {
|
1065
1079
|
var j,
|
1066
1080
|
matchIndexes = fn( [], seed.length, argument ),
|
1067
1081
|
i = matchIndexes.length;
|
1068
1082
|
|
1069
1083
|
// Match elements found at the specified indexes
|
1070
1084
|
while ( i-- ) {
|
1071
|
-
if ( seed[ (j = matchIndexes[i]) ] ) {
|
1072
|
-
seed[j] = !(matches[j] = seed[j]);
|
1085
|
+
if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
|
1086
|
+
seed[ j ] = !( matches[ j ] = seed[ j ] );
|
1073
1087
|
}
|
1074
1088
|
}
|
1075
|
-
});
|
1076
|
-
});
|
1089
|
+
} );
|
1090
|
+
} );
|
1077
1091
|
}
|
1078
1092
|
|
1079
1093
|
/**
|
@@ -1094,10 +1108,13 @@ support = Sizzle.support = {};
|
|
1094
1108
|
* @returns {Boolean} True iff elem is a non-HTML XML node
|
1095
1109
|
*/
|
1096
1110
|
isXML = Sizzle.isXML = function( elem ) {
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1111
|
+
var namespace = elem.namespaceURI,
|
1112
|
+
docElem = ( elem.ownerDocument || elem ).documentElement;
|
1113
|
+
|
1114
|
+
// Support: IE <=8
|
1115
|
+
// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
|
1116
|
+
// https://bugs.jquery.com/ticket/4833
|
1117
|
+
return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
|
1101
1118
|
};
|
1102
1119
|
|
1103
1120
|
/**
|
@@ -1110,7 +1127,11 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1110
1127
|
doc = node ? node.ownerDocument || node : preferredDoc;
|
1111
1128
|
|
1112
1129
|
// Return early if doc is invalid or already selected
|
1113
|
-
|
1130
|
+
// Support: IE 11+, Edge 17 - 18+
|
1131
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1132
|
+
// two documents; shallow comparisons work.
|
1133
|
+
// eslint-disable-next-line eqeqeq
|
1134
|
+
if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
|
1114
1135
|
return document;
|
1115
1136
|
}
|
1116
1137
|
|
@@ -1119,10 +1140,14 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1119
1140
|
docElem = document.documentElement;
|
1120
1141
|
documentIsHTML = !isXML( document );
|
1121
1142
|
|
1122
|
-
// Support: IE 9-11
|
1143
|
+
// Support: IE 9 - 11+, Edge 12 - 18+
|
1123
1144
|
// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
|
1124
|
-
|
1125
|
-
|
1145
|
+
// Support: IE 11+, Edge 17 - 18+
|
1146
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1147
|
+
// two documents; shallow comparisons work.
|
1148
|
+
// eslint-disable-next-line eqeqeq
|
1149
|
+
if ( preferredDoc != document &&
|
1150
|
+
( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
|
1126
1151
|
|
1127
1152
|
// Support: IE 11, Edge
|
1128
1153
|
if ( subWindow.addEventListener ) {
|
@@ -1134,25 +1159,36 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1134
1159
|
}
|
1135
1160
|
}
|
1136
1161
|
|
1162
|
+
// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
|
1163
|
+
// Safari 4 - 5 only, Opera <=11.6 - 12.x only
|
1164
|
+
// IE/Edge & older browsers don't support the :scope pseudo-class.
|
1165
|
+
// Support: Safari 6.0 only
|
1166
|
+
// Safari 6.0 supports :scope but it's an alias of :root there.
|
1167
|
+
support.scope = assert( function( el ) {
|
1168
|
+
docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
|
1169
|
+
return typeof el.querySelectorAll !== "undefined" &&
|
1170
|
+
!el.querySelectorAll( ":scope fieldset div" ).length;
|
1171
|
+
} );
|
1172
|
+
|
1137
1173
|
/* Attributes
|
1138
1174
|
---------------------------------------------------------------------- */
|
1139
1175
|
|
1140
1176
|
// Support: IE<8
|
1141
1177
|
// Verify that getAttribute really returns attributes and not properties
|
1142
1178
|
// (excepting IE8 booleans)
|
1143
|
-
support.attributes = assert(function( el ) {
|
1179
|
+
support.attributes = assert( function( el ) {
|
1144
1180
|
el.className = "i";
|
1145
|
-
return !el.getAttribute("className");
|
1146
|
-
});
|
1181
|
+
return !el.getAttribute( "className" );
|
1182
|
+
} );
|
1147
1183
|
|
1148
1184
|
/* getElement(s)By*
|
1149
1185
|
---------------------------------------------------------------------- */
|
1150
1186
|
|
1151
1187
|
// Check if getElementsByTagName("*") returns only elements
|
1152
|
-
support.getElementsByTagName = assert(function( el ) {
|
1153
|
-
el.appendChild( document.createComment("") );
|
1154
|
-
return !el.getElementsByTagName("*").length;
|
1155
|
-
});
|
1188
|
+
support.getElementsByTagName = assert( function( el ) {
|
1189
|
+
el.appendChild( document.createComment( "" ) );
|
1190
|
+
return !el.getElementsByTagName( "*" ).length;
|
1191
|
+
} );
|
1156
1192
|
|
1157
1193
|
// Support: IE<9
|
1158
1194
|
support.getElementsByClassName = rnative.test( document.getElementsByClassName );
|
@@ -1161,38 +1197,38 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1161
1197
|
// Check if getElementById returns elements by name
|
1162
1198
|
// The broken getElementById methods don't pick up programmatically-set names,
|
1163
1199
|
// so use a roundabout getElementsByName test
|
1164
|
-
support.getById = assert(function( el ) {
|
1200
|
+
support.getById = assert( function( el ) {
|
1165
1201
|
docElem.appendChild( el ).id = expando;
|
1166
1202
|
return !document.getElementsByName || !document.getElementsByName( expando ).length;
|
1167
|
-
});
|
1203
|
+
} );
|
1168
1204
|
|
1169
1205
|
// ID filter and find
|
1170
1206
|
if ( support.getById ) {
|
1171
|
-
Expr.filter["ID"] = function( id ) {
|
1207
|
+
Expr.filter[ "ID" ] = function( id ) {
|
1172
1208
|
var attrId = id.replace( runescape, funescape );
|
1173
1209
|
return function( elem ) {
|
1174
|
-
return elem.getAttribute("id") === attrId;
|
1210
|
+
return elem.getAttribute( "id" ) === attrId;
|
1175
1211
|
};
|
1176
1212
|
};
|
1177
|
-
Expr.find["ID"] = function( id, context ) {
|
1213
|
+
Expr.find[ "ID" ] = function( id, context ) {
|
1178
1214
|
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
|
1179
1215
|
var elem = context.getElementById( id );
|
1180
1216
|
return elem ? [ elem ] : [];
|
1181
1217
|
}
|
1182
1218
|
};
|
1183
1219
|
} else {
|
1184
|
-
Expr.filter["ID"] = function( id ) {
|
1220
|
+
Expr.filter[ "ID" ] = function( id ) {
|
1185
1221
|
var attrId = id.replace( runescape, funescape );
|
1186
1222
|
return function( elem ) {
|
1187
1223
|
var node = typeof elem.getAttributeNode !== "undefined" &&
|
1188
|
-
elem.getAttributeNode("id");
|
1224
|
+
elem.getAttributeNode( "id" );
|
1189
1225
|
return node && node.value === attrId;
|
1190
1226
|
};
|
1191
1227
|
};
|
1192
1228
|
|
1193
1229
|
// Support: IE 6 - 7 only
|
1194
1230
|
// getElementById is not reliable as a find shortcut
|
1195
|
-
Expr.find["ID"] = function( id, context ) {
|
1231
|
+
Expr.find[ "ID" ] = function( id, context ) {
|
1196
1232
|
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
|
1197
1233
|
var node, i, elems,
|
1198
1234
|
elem = context.getElementById( id );
|
@@ -1200,7 +1236,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1200
1236
|
if ( elem ) {
|
1201
1237
|
|
1202
1238
|
// Verify the id attribute
|
1203
|
-
node = elem.getAttributeNode("id");
|
1239
|
+
node = elem.getAttributeNode( "id" );
|
1204
1240
|
if ( node && node.value === id ) {
|
1205
1241
|
return [ elem ];
|
1206
1242
|
}
|
@@ -1208,8 +1244,8 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1208
1244
|
// Fall back on getElementsByName
|
1209
1245
|
elems = context.getElementsByName( id );
|
1210
1246
|
i = 0;
|
1211
|
-
while ( (elem = elems[i++]) ) {
|
1212
|
-
node = elem.getAttributeNode("id");
|
1247
|
+
while ( ( elem = elems[ i++ ] ) ) {
|
1248
|
+
node = elem.getAttributeNode( "id" );
|
1213
1249
|
if ( node && node.value === id ) {
|
1214
1250
|
return [ elem ];
|
1215
1251
|
}
|
@@ -1222,7 +1258,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1222
1258
|
}
|
1223
1259
|
|
1224
1260
|
// Tag
|
1225
|
-
Expr.find["TAG"] = support.getElementsByTagName ?
|
1261
|
+
Expr.find[ "TAG" ] = support.getElementsByTagName ?
|
1226
1262
|
function( tag, context ) {
|
1227
1263
|
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
1228
1264
|
return context.getElementsByTagName( tag );
|
@@ -1237,12 +1273,13 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1237
1273
|
var elem,
|
1238
1274
|
tmp = [],
|
1239
1275
|
i = 0,
|
1276
|
+
|
1240
1277
|
// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
|
1241
1278
|
results = context.getElementsByTagName( tag );
|
1242
1279
|
|
1243
1280
|
// Filter out possible comments
|
1244
1281
|
if ( tag === "*" ) {
|
1245
|
-
while ( (elem = results[i++]) ) {
|
1282
|
+
while ( ( elem = results[ i++ ] ) ) {
|
1246
1283
|
if ( elem.nodeType === 1 ) {
|
1247
1284
|
tmp.push( elem );
|
1248
1285
|
}
|
@@ -1254,7 +1291,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1254
1291
|
};
|
1255
1292
|
|
1256
1293
|
// Class
|
1257
|
-
Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
|
1294
|
+
Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
|
1258
1295
|
if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
|
1259
1296
|
return context.getElementsByClassName( className );
|
1260
1297
|
}
|
@@ -1275,10 +1312,14 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1275
1312
|
// See https://bugs.jquery.com/ticket/13378
|
1276
1313
|
rbuggyQSA = [];
|
1277
1314
|
|
1278
|
-
if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
|
1315
|
+
if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
|
1316
|
+
|
1279
1317
|
// Build QSA regex
|
1280
1318
|
// Regex strategy adopted from Diego Perini
|
1281
|
-
assert(function( el ) {
|
1319
|
+
assert( function( el ) {
|
1320
|
+
|
1321
|
+
var input;
|
1322
|
+
|
1282
1323
|
// Select is set to empty string on purpose
|
1283
1324
|
// This is to test IE's treatment of not explicitly
|
1284
1325
|
// setting a boolean content attribute,
|
@@ -1292,78 +1333,98 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1292
1333
|
// Nothing should be selected when empty strings follow ^= or $= or *=
|
1293
1334
|
// The test attribute must be unknown in Opera but "safe" for WinRT
|
1294
1335
|
// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
|
1295
|
-
if ( el.querySelectorAll("[msallowcapture^='']").length ) {
|
1336
|
+
if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
|
1296
1337
|
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
|
1297
1338
|
}
|
1298
1339
|
|
1299
1340
|
// Support: IE8
|
1300
1341
|
// Boolean attributes and "value" are not treated correctly
|
1301
|
-
if ( !el.querySelectorAll("[selected]").length ) {
|
1342
|
+
if ( !el.querySelectorAll( "[selected]" ).length ) {
|
1302
1343
|
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
|
1303
1344
|
}
|
1304
1345
|
|
1305
1346
|
// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
|
1306
1347
|
if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
|
1307
|
-
rbuggyQSA.push("~=");
|
1348
|
+
rbuggyQSA.push( "~=" );
|
1349
|
+
}
|
1350
|
+
|
1351
|
+
// Support: IE 11+, Edge 15 - 18+
|
1352
|
+
// IE 11/Edge don't find elements on a `[name='']` query in some cases.
|
1353
|
+
// Adding a temporary attribute to the document before the selection works
|
1354
|
+
// around the issue.
|
1355
|
+
// Interestingly, IE 10 & older don't seem to have the issue.
|
1356
|
+
input = document.createElement( "input" );
|
1357
|
+
input.setAttribute( "name", "" );
|
1358
|
+
el.appendChild( input );
|
1359
|
+
if ( !el.querySelectorAll( "[name='']" ).length ) {
|
1360
|
+
rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
|
1361
|
+
whitespace + "*(?:''|\"\")" );
|
1308
1362
|
}
|
1309
1363
|
|
1310
1364
|
// Webkit/Opera - :checked should return selected option elements
|
1311
1365
|
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
|
1312
1366
|
// IE8 throws error here and will not see later tests
|
1313
|
-
if ( !el.querySelectorAll(":checked").length ) {
|
1314
|
-
rbuggyQSA.push(":checked");
|
1367
|
+
if ( !el.querySelectorAll( ":checked" ).length ) {
|
1368
|
+
rbuggyQSA.push( ":checked" );
|
1315
1369
|
}
|
1316
1370
|
|
1317
1371
|
// Support: Safari 8+, iOS 8+
|
1318
1372
|
// https://bugs.webkit.org/show_bug.cgi?id=136851
|
1319
1373
|
// In-page `selector#id sibling-combinator selector` fails
|
1320
1374
|
if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
|
1321
|
-
rbuggyQSA.push(".#.+[+~]");
|
1375
|
+
rbuggyQSA.push( ".#.+[+~]" );
|
1322
1376
|
}
|
1323
|
-
});
|
1324
1377
|
|
1325
|
-
|
1378
|
+
// Support: Firefox <=3.6 - 5 only
|
1379
|
+
// Old Firefox doesn't throw on a badly-escaped identifier.
|
1380
|
+
el.querySelectorAll( "\\\f" );
|
1381
|
+
rbuggyQSA.push( "[\\r\\n\\f]" );
|
1382
|
+
} );
|
1383
|
+
|
1384
|
+
assert( function( el ) {
|
1326
1385
|
el.innerHTML = "<a href='' disabled='disabled'></a>" +
|
1327
1386
|
"<select disabled='disabled'><option/></select>";
|
1328
1387
|
|
1329
1388
|
// Support: Windows 8 Native Apps
|
1330
1389
|
// The type and name attributes are restricted during .innerHTML assignment
|
1331
|
-
var input = document.createElement("input");
|
1390
|
+
var input = document.createElement( "input" );
|
1332
1391
|
input.setAttribute( "type", "hidden" );
|
1333
1392
|
el.appendChild( input ).setAttribute( "name", "D" );
|
1334
1393
|
|
1335
1394
|
// Support: IE8
|
1336
1395
|
// Enforce case-sensitivity of name attribute
|
1337
|
-
if ( el.querySelectorAll("[name=d]").length ) {
|
1396
|
+
if ( el.querySelectorAll( "[name=d]" ).length ) {
|
1338
1397
|
rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
|
1339
1398
|
}
|
1340
1399
|
|
1341
1400
|
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
|
1342
1401
|
// IE8 throws error here and will not see later tests
|
1343
|
-
if ( el.querySelectorAll(":enabled").length !== 2 ) {
|
1402
|
+
if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
|
1344
1403
|
rbuggyQSA.push( ":enabled", ":disabled" );
|
1345
1404
|
}
|
1346
1405
|
|
1347
1406
|
// Support: IE9-11+
|
1348
1407
|
// IE's :disabled selector does not pick up the children of disabled fieldsets
|
1349
1408
|
docElem.appendChild( el ).disabled = true;
|
1350
|
-
if ( el.querySelectorAll(":disabled").length !== 2 ) {
|
1409
|
+
if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
|
1351
1410
|
rbuggyQSA.push( ":enabled", ":disabled" );
|
1352
1411
|
}
|
1353
1412
|
|
1413
|
+
// Support: Opera 10 - 11 only
|
1354
1414
|
// Opera 10-11 does not throw on post-comma invalid pseudos
|
1355
|
-
el.querySelectorAll("*,:x");
|
1356
|
-
rbuggyQSA.push(",.*:");
|
1357
|
-
});
|
1415
|
+
el.querySelectorAll( "*,:x" );
|
1416
|
+
rbuggyQSA.push( ",.*:" );
|
1417
|
+
} );
|
1358
1418
|
}
|
1359
1419
|
|
1360
|
-
if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
|
1420
|
+
if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
|
1361
1421
|
docElem.webkitMatchesSelector ||
|
1362
1422
|
docElem.mozMatchesSelector ||
|
1363
1423
|
docElem.oMatchesSelector ||
|
1364
|
-
docElem.msMatchesSelector) )) ) {
|
1424
|
+
docElem.msMatchesSelector ) ) ) ) {
|
1425
|
+
|
1426
|
+
assert( function( el ) {
|
1365
1427
|
|
1366
|
-
assert(function( el ) {
|
1367
1428
|
// Check to see if it's possible to do matchesSelector
|
1368
1429
|
// on a disconnected node (IE 9)
|
1369
1430
|
support.disconnectedMatch = matches.call( el, "*" );
|
@@ -1372,11 +1433,11 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1372
1433
|
// Gecko does not error, returns false instead
|
1373
1434
|
matches.call( el, "[s!='']:x" );
|
1374
1435
|
rbuggyMatches.push( "!=", pseudos );
|
1375
|
-
});
|
1436
|
+
} );
|
1376
1437
|
}
|
1377
1438
|
|
1378
|
-
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
|
1379
|
-
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
|
1439
|
+
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
|
1440
|
+
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
|
1380
1441
|
|
1381
1442
|
/* Contains
|
1382
1443
|
---------------------------------------------------------------------- */
|
@@ -1393,11 +1454,11 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1393
1454
|
adown.contains ?
|
1394
1455
|
adown.contains( bup ) :
|
1395
1456
|
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
|
1396
|
-
));
|
1457
|
+
) );
|
1397
1458
|
} :
|
1398
1459
|
function( a, b ) {
|
1399
1460
|
if ( b ) {
|
1400
|
-
while ( (b = b.parentNode) ) {
|
1461
|
+
while ( ( b = b.parentNode ) ) {
|
1401
1462
|
if ( b === a ) {
|
1402
1463
|
return true;
|
1403
1464
|
}
|
@@ -1426,7 +1487,11 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1426
1487
|
}
|
1427
1488
|
|
1428
1489
|
// Calculate position if both inputs belong to the same document
|
1429
|
-
|
1490
|
+
// Support: IE 11+, Edge 17 - 18+
|
1491
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1492
|
+
// two documents; shallow comparisons work.
|
1493
|
+
// eslint-disable-next-line eqeqeq
|
1494
|
+
compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
|
1430
1495
|
a.compareDocumentPosition( b ) :
|
1431
1496
|
|
1432
1497
|
// Otherwise we know they are disconnected
|
@@ -1434,13 +1499,24 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1434
1499
|
|
1435
1500
|
// Disconnected nodes
|
1436
1501
|
if ( compare & 1 ||
|
1437
|
-
(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
|
1502
|
+
( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
|
1438
1503
|
|
1439
1504
|
// Choose the first element that is related to our preferred document
|
1440
|
-
|
1505
|
+
// Support: IE 11+, Edge 17 - 18+
|
1506
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1507
|
+
// two documents; shallow comparisons work.
|
1508
|
+
// eslint-disable-next-line eqeqeq
|
1509
|
+
if ( a == document || a.ownerDocument == preferredDoc &&
|
1510
|
+
contains( preferredDoc, a ) ) {
|
1441
1511
|
return -1;
|
1442
1512
|
}
|
1443
|
-
|
1513
|
+
|
1514
|
+
// Support: IE 11+, Edge 17 - 18+
|
1515
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1516
|
+
// two documents; shallow comparisons work.
|
1517
|
+
// eslint-disable-next-line eqeqeq
|
1518
|
+
if ( b == document || b.ownerDocument == preferredDoc &&
|
1519
|
+
contains( preferredDoc, b ) ) {
|
1444
1520
|
return 1;
|
1445
1521
|
}
|
1446
1522
|
|
@@ -1453,6 +1529,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1453
1529
|
return compare & 4 ? -1 : 1;
|
1454
1530
|
} :
|
1455
1531
|
function( a, b ) {
|
1532
|
+
|
1456
1533
|
// Exit early if the nodes are identical
|
1457
1534
|
if ( a === b ) {
|
1458
1535
|
hasDuplicate = true;
|
@@ -1468,8 +1545,14 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1468
1545
|
|
1469
1546
|
// Parentless nodes are either documents or disconnected
|
1470
1547
|
if ( !aup || !bup ) {
|
1471
|
-
|
1472
|
-
|
1548
|
+
|
1549
|
+
// Support: IE 11+, Edge 17 - 18+
|
1550
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1551
|
+
// two documents; shallow comparisons work.
|
1552
|
+
/* eslint-disable eqeqeq */
|
1553
|
+
return a == document ? -1 :
|
1554
|
+
b == document ? 1 :
|
1555
|
+
/* eslint-enable eqeqeq */
|
1473
1556
|
aup ? -1 :
|
1474
1557
|
bup ? 1 :
|
1475
1558
|
sortInput ?
|
@@ -1483,26 +1566,32 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1483
1566
|
|
1484
1567
|
// Otherwise we need full lists of their ancestors for comparison
|
1485
1568
|
cur = a;
|
1486
|
-
while ( (cur = cur.parentNode) ) {
|
1569
|
+
while ( ( cur = cur.parentNode ) ) {
|
1487
1570
|
ap.unshift( cur );
|
1488
1571
|
}
|
1489
1572
|
cur = b;
|
1490
|
-
while ( (cur = cur.parentNode) ) {
|
1573
|
+
while ( ( cur = cur.parentNode ) ) {
|
1491
1574
|
bp.unshift( cur );
|
1492
1575
|
}
|
1493
1576
|
|
1494
1577
|
// Walk down the tree looking for a discrepancy
|
1495
|
-
while ( ap[i] === bp[i] ) {
|
1578
|
+
while ( ap[ i ] === bp[ i ] ) {
|
1496
1579
|
i++;
|
1497
1580
|
}
|
1498
1581
|
|
1499
1582
|
return i ?
|
1583
|
+
|
1500
1584
|
// Do a sibling check if the nodes have a common ancestor
|
1501
|
-
siblingCheck( ap[i], bp[i] ) :
|
1585
|
+
siblingCheck( ap[ i ], bp[ i ] ) :
|
1502
1586
|
|
1503
1587
|
// Otherwise nodes in our document sort first
|
1504
|
-
|
1505
|
-
|
1588
|
+
// Support: IE 11+, Edge 17 - 18+
|
1589
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1590
|
+
// two documents; shallow comparisons work.
|
1591
|
+
/* eslint-disable eqeqeq */
|
1592
|
+
ap[ i ] == preferredDoc ? -1 :
|
1593
|
+
bp[ i ] == preferredDoc ? 1 :
|
1594
|
+
/* eslint-enable eqeqeq */
|
1506
1595
|
0;
|
1507
1596
|
};
|
1508
1597
|
|
@@ -1514,16 +1603,10 @@ Sizzle.matches = function( expr, elements ) {
|
|
1514
1603
|
};
|
1515
1604
|
|
1516
1605
|
Sizzle.matchesSelector = function( elem, expr ) {
|
1517
|
-
|
1518
|
-
if ( ( elem.ownerDocument || elem ) !== document ) {
|
1519
|
-
setDocument( elem );
|
1520
|
-
}
|
1521
|
-
|
1522
|
-
// Make sure that attribute selectors are quoted
|
1523
|
-
expr = expr.replace( rattributeQuotes, "='$1']" );
|
1606
|
+
setDocument( elem );
|
1524
1607
|
|
1525
1608
|
if ( support.matchesSelector && documentIsHTML &&
|
1526
|
-
!
|
1609
|
+
!nonnativeSelectorCache[ expr + " " ] &&
|
1527
1610
|
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
|
1528
1611
|
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
|
1529
1612
|
|
@@ -1532,32 +1615,46 @@ Sizzle.matchesSelector = function( elem, expr ) {
|
|
1532
1615
|
|
1533
1616
|
// IE 9's matchesSelector returns false on disconnected nodes
|
1534
1617
|
if ( ret || support.disconnectedMatch ||
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1618
|
+
|
1619
|
+
// As well, disconnected nodes are said to be in a document
|
1620
|
+
// fragment in IE 9
|
1621
|
+
elem.document && elem.document.nodeType !== 11 ) {
|
1538
1622
|
return ret;
|
1539
1623
|
}
|
1540
|
-
} catch (e) {
|
1624
|
+
} catch ( e ) {
|
1625
|
+
nonnativeSelectorCache( expr, true );
|
1626
|
+
}
|
1541
1627
|
}
|
1542
1628
|
|
1543
1629
|
return Sizzle( expr, document, null, [ elem ] ).length > 0;
|
1544
1630
|
};
|
1545
1631
|
|
1546
1632
|
Sizzle.contains = function( context, elem ) {
|
1633
|
+
|
1547
1634
|
// Set document vars if needed
|
1548
|
-
|
1635
|
+
// Support: IE 11+, Edge 17 - 18+
|
1636
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1637
|
+
// two documents; shallow comparisons work.
|
1638
|
+
// eslint-disable-next-line eqeqeq
|
1639
|
+
if ( ( context.ownerDocument || context ) != document ) {
|
1549
1640
|
setDocument( context );
|
1550
1641
|
}
|
1551
1642
|
return contains( context, elem );
|
1552
1643
|
};
|
1553
1644
|
|
1554
1645
|
Sizzle.attr = function( elem, name ) {
|
1646
|
+
|
1555
1647
|
// Set document vars if needed
|
1556
|
-
|
1648
|
+
// Support: IE 11+, Edge 17 - 18+
|
1649
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1650
|
+
// two documents; shallow comparisons work.
|
1651
|
+
// eslint-disable-next-line eqeqeq
|
1652
|
+
if ( ( elem.ownerDocument || elem ) != document ) {
|
1557
1653
|
setDocument( elem );
|
1558
1654
|
}
|
1559
1655
|
|
1560
1656
|
var fn = Expr.attrHandle[ name.toLowerCase() ],
|
1657
|
+
|
1561
1658
|
// Don't get fooled by Object.prototype properties (jQuery #13807)
|
1562
1659
|
val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
|
1563
1660
|
fn( elem, name, !documentIsHTML ) :
|
@@ -1567,13 +1664,13 @@ Sizzle.attr = function( elem, name ) {
|
|
1567
1664
|
val :
|
1568
1665
|
support.attributes || !documentIsHTML ?
|
1569
1666
|
elem.getAttribute( name ) :
|
1570
|
-
(val = elem.getAttributeNode(name)) && val.specified ?
|
1667
|
+
( val = elem.getAttributeNode( name ) ) && val.specified ?
|
1571
1668
|
val.value :
|
1572
1669
|
null;
|
1573
1670
|
};
|
1574
1671
|
|
1575
1672
|
Sizzle.escape = function( sel ) {
|
1576
|
-
return (sel + "").replace( rcssescape, fcssescape );
|
1673
|
+
return ( sel + "" ).replace( rcssescape, fcssescape );
|
1577
1674
|
};
|
1578
1675
|
|
1579
1676
|
Sizzle.error = function( msg ) {
|
@@ -1596,7 +1693,7 @@ Sizzle.uniqueSort = function( results ) {
|
|
1596
1693
|
results.sort( sortOrder );
|
1597
1694
|
|
1598
1695
|
if ( hasDuplicate ) {
|
1599
|
-
while ( (elem = results[i++]) ) {
|
1696
|
+
while ( ( elem = results[ i++ ] ) ) {
|
1600
1697
|
if ( elem === results[ i ] ) {
|
1601
1698
|
j = duplicates.push( i );
|
1602
1699
|
}
|
@@ -1624,17 +1721,21 @@ getText = Sizzle.getText = function( elem ) {
|
|
1624
1721
|
nodeType = elem.nodeType;
|
1625
1722
|
|
1626
1723
|
if ( !nodeType ) {
|
1724
|
+
|
1627
1725
|
// If no nodeType, this is expected to be an array
|
1628
|
-
while ( (node = elem[i++]) ) {
|
1726
|
+
while ( ( node = elem[ i++ ] ) ) {
|
1727
|
+
|
1629
1728
|
// Do not traverse comment nodes
|
1630
1729
|
ret += getText( node );
|
1631
1730
|
}
|
1632
1731
|
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
|
1732
|
+
|
1633
1733
|
// Use textContent for elements
|
1634
1734
|
// innerText usage removed for consistency of new lines (jQuery #11153)
|
1635
1735
|
if ( typeof elem.textContent === "string" ) {
|
1636
1736
|
return elem.textContent;
|
1637
1737
|
} else {
|
1738
|
+
|
1638
1739
|
// Traverse its children
|
1639
1740
|
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
1640
1741
|
ret += getText( elem );
|
@@ -1643,6 +1744,7 @@ getText = Sizzle.getText = function( elem ) {
|
|
1643
1744
|
} else if ( nodeType === 3 || nodeType === 4 ) {
|
1644
1745
|
return elem.nodeValue;
|
1645
1746
|
}
|
1747
|
+
|
1646
1748
|
// Do not include comment or processing instruction nodes
|
1647
1749
|
|
1648
1750
|
return ret;
|
@@ -1670,19 +1772,21 @@ Expr = Sizzle.selectors = {
|
|
1670
1772
|
|
1671
1773
|
preFilter: {
|
1672
1774
|
"ATTR": function( match ) {
|
1673
|
-
match[1] = match[1].replace( runescape, funescape );
|
1775
|
+
match[ 1 ] = match[ 1 ].replace( runescape, funescape );
|
1674
1776
|
|
1675
1777
|
// Move the given value to match[3] whether quoted or unquoted
|
1676
|
-
match[3] = ( match[3] || match[4
|
1778
|
+
match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
|
1779
|
+
match[ 5 ] || "" ).replace( runescape, funescape );
|
1677
1780
|
|
1678
|
-
if ( match[2] === "~=" ) {
|
1679
|
-
match[3] = " " + match[3] + " ";
|
1781
|
+
if ( match[ 2 ] === "~=" ) {
|
1782
|
+
match[ 3 ] = " " + match[ 3 ] + " ";
|
1680
1783
|
}
|
1681
1784
|
|
1682
1785
|
return match.slice( 0, 4 );
|
1683
1786
|
},
|
1684
1787
|
|
1685
1788
|
"CHILD": function( match ) {
|
1789
|
+
|
1686
1790
|
/* matches from matchExpr["CHILD"]
|
1687
1791
|
1 type (only|nth|...)
|
1688
1792
|
2 what (child|of-type)
|
@@ -1693,22 +1797,25 @@ Expr = Sizzle.selectors = {
|
|
1693
1797
|
7 sign of y-component
|
1694
1798
|
8 y of y-component
|
1695
1799
|
*/
|
1696
|
-
match[1] = match[1].toLowerCase();
|
1800
|
+
match[ 1 ] = match[ 1 ].toLowerCase();
|
1801
|
+
|
1802
|
+
if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
|
1697
1803
|
|
1698
|
-
if ( match[1].slice( 0, 3 ) === "nth" ) {
|
1699
1804
|
// nth-* requires argument
|
1700
|
-
if ( !match[3] ) {
|
1701
|
-
Sizzle.error( match[0] );
|
1805
|
+
if ( !match[ 3 ] ) {
|
1806
|
+
Sizzle.error( match[ 0 ] );
|
1702
1807
|
}
|
1703
1808
|
|
1704
1809
|
// numeric x and y parameters for Expr.filter.CHILD
|
1705
1810
|
// remember that false/true cast respectively to 0/1
|
1706
|
-
match[4] = +( match[4] ?
|
1707
|
-
|
1811
|
+
match[ 4 ] = +( match[ 4 ] ?
|
1812
|
+
match[ 5 ] + ( match[ 6 ] || 1 ) :
|
1813
|
+
2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
|
1814
|
+
match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
|
1708
1815
|
|
1709
|
-
|
1710
|
-
} else if ( match[3] ) {
|
1711
|
-
Sizzle.error( match[0] );
|
1816
|
+
// other types prohibit arguments
|
1817
|
+
} else if ( match[ 3 ] ) {
|
1818
|
+
Sizzle.error( match[ 0 ] );
|
1712
1819
|
}
|
1713
1820
|
|
1714
1821
|
return match;
|
@@ -1716,26 +1823,28 @@ Expr = Sizzle.selectors = {
|
|
1716
1823
|
|
1717
1824
|
"PSEUDO": function( match ) {
|
1718
1825
|
var excess,
|
1719
|
-
unquoted = !match[6] && match[2];
|
1826
|
+
unquoted = !match[ 6 ] && match[ 2 ];
|
1720
1827
|
|
1721
|
-
if ( matchExpr["CHILD"].test( match[0] ) ) {
|
1828
|
+
if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
|
1722
1829
|
return null;
|
1723
1830
|
}
|
1724
1831
|
|
1725
1832
|
// Accept quoted arguments as-is
|
1726
|
-
if ( match[3] ) {
|
1727
|
-
match[2] = match[4] || match[5] || "";
|
1833
|
+
if ( match[ 3 ] ) {
|
1834
|
+
match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
|
1728
1835
|
|
1729
1836
|
// Strip excess characters from unquoted arguments
|
1730
1837
|
} else if ( unquoted && rpseudo.test( unquoted ) &&
|
1838
|
+
|
1731
1839
|
// Get excess from tokenize (recursively)
|
1732
|
-
(excess = tokenize( unquoted, true )) &&
|
1840
|
+
( excess = tokenize( unquoted, true ) ) &&
|
1841
|
+
|
1733
1842
|
// advance to the next closing parenthesis
|
1734
|
-
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
|
1843
|
+
( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
|
1735
1844
|
|
1736
1845
|
// excess is a negative index
|
1737
|
-
match[0] = match[0].slice( 0, excess );
|
1738
|
-
match[2] = unquoted.slice( 0, excess );
|
1846
|
+
match[ 0 ] = match[ 0 ].slice( 0, excess );
|
1847
|
+
match[ 2 ] = unquoted.slice( 0, excess );
|
1739
1848
|
}
|
1740
1849
|
|
1741
1850
|
// Return only captures needed by the pseudo filter method (type and argument)
|
@@ -1748,7 +1857,9 @@ Expr = Sizzle.selectors = {
|
|
1748
1857
|
"TAG": function( nodeNameSelector ) {
|
1749
1858
|
var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
|
1750
1859
|
return nodeNameSelector === "*" ?
|
1751
|
-
function() {
|
1860
|
+
function() {
|
1861
|
+
return true;
|
1862
|
+
} :
|
1752
1863
|
function( elem ) {
|
1753
1864
|
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
|
1754
1865
|
};
|
@@ -1758,10 +1869,16 @@ Expr = Sizzle.selectors = {
|
|
1758
1869
|
var pattern = classCache[ className + " " ];
|
1759
1870
|
|
1760
1871
|
return pattern ||
|
1761
|
-
(pattern = new RegExp( "(^|" + whitespace +
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1872
|
+
( pattern = new RegExp( "(^|" + whitespace +
|
1873
|
+
")" + className + "(" + whitespace + "|$)" ) ) && classCache(
|
1874
|
+
className, function( elem ) {
|
1875
|
+
return pattern.test(
|
1876
|
+
typeof elem.className === "string" && elem.className ||
|
1877
|
+
typeof elem.getAttribute !== "undefined" &&
|
1878
|
+
elem.getAttribute( "class" ) ||
|
1879
|
+
""
|
1880
|
+
);
|
1881
|
+
} );
|
1765
1882
|
},
|
1766
1883
|
|
1767
1884
|
"ATTR": function( name, operator, check ) {
|
@@ -1777,6 +1894,8 @@ Expr = Sizzle.selectors = {
|
|
1777
1894
|
|
1778
1895
|
result += "";
|
1779
1896
|
|
1897
|
+
/* eslint-disable max-len */
|
1898
|
+
|
1780
1899
|
return operator === "=" ? result === check :
|
1781
1900
|
operator === "!=" ? result !== check :
|
1782
1901
|
operator === "^=" ? check && result.indexOf( check ) === 0 :
|
@@ -1785,10 +1904,12 @@ Expr = Sizzle.selectors = {
|
|
1785
1904
|
operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
|
1786
1905
|
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
|
1787
1906
|
false;
|
1907
|
+
/* eslint-enable max-len */
|
1908
|
+
|
1788
1909
|
};
|
1789
1910
|
},
|
1790
1911
|
|
1791
|
-
"CHILD": function( type, what,
|
1912
|
+
"CHILD": function( type, what, _argument, first, last ) {
|
1792
1913
|
var simple = type.slice( 0, 3 ) !== "nth",
|
1793
1914
|
forward = type.slice( -4 ) !== "last",
|
1794
1915
|
ofType = what === "of-type";
|
@@ -1800,7 +1921,7 @@ Expr = Sizzle.selectors = {
|
|
1800
1921
|
return !!elem.parentNode;
|
1801
1922
|
} :
|
1802
1923
|
|
1803
|
-
function( elem,
|
1924
|
+
function( elem, _context, xml ) {
|
1804
1925
|
var cache, uniqueCache, outerCache, node, nodeIndex, start,
|
1805
1926
|
dir = simple !== forward ? "nextSibling" : "previousSibling",
|
1806
1927
|
parent = elem.parentNode,
|
@@ -1814,7 +1935,7 @@ Expr = Sizzle.selectors = {
|
|
1814
1935
|
if ( simple ) {
|
1815
1936
|
while ( dir ) {
|
1816
1937
|
node = elem;
|
1817
|
-
while ( (node = node[ dir ]) ) {
|
1938
|
+
while ( ( node = node[ dir ] ) ) {
|
1818
1939
|
if ( ofType ?
|
1819
1940
|
node.nodeName.toLowerCase() === name :
|
1820
1941
|
node.nodeType === 1 ) {
|
@@ -1822,6 +1943,7 @@ Expr = Sizzle.selectors = {
|
|
1822
1943
|
return false;
|
1823
1944
|
}
|
1824
1945
|
}
|
1946
|
+
|
1825
1947
|
// Reverse direction for :only-* (if we haven't yet done so)
|
1826
1948
|
start = dir = type === "only" && !start && "nextSibling";
|
1827
1949
|
}
|
@@ -1837,22 +1959,22 @@ Expr = Sizzle.selectors = {
|
|
1837
1959
|
|
1838
1960
|
// ...in a gzip-friendly way
|
1839
1961
|
node = parent;
|
1840
|
-
outerCache = node[ expando ] || (node[ expando ] = {});
|
1962
|
+
outerCache = node[ expando ] || ( node[ expando ] = {} );
|
1841
1963
|
|
1842
1964
|
// Support: IE <9 only
|
1843
1965
|
// Defend against cloned attroperties (jQuery gh-1709)
|
1844
1966
|
uniqueCache = outerCache[ node.uniqueID ] ||
|
1845
|
-
(outerCache[ node.uniqueID ] = {});
|
1967
|
+
( outerCache[ node.uniqueID ] = {} );
|
1846
1968
|
|
1847
1969
|
cache = uniqueCache[ type ] || [];
|
1848
1970
|
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
|
1849
1971
|
diff = nodeIndex && cache[ 2 ];
|
1850
1972
|
node = nodeIndex && parent.childNodes[ nodeIndex ];
|
1851
1973
|
|
1852
|
-
while ( (node = ++nodeIndex && node && node[ dir ] ||
|
1974
|
+
while ( ( node = ++nodeIndex && node && node[ dir ] ||
|
1853
1975
|
|
1854
1976
|
// Fallback to seeking `elem` from the start
|
1855
|
-
(diff = nodeIndex = 0) || start.pop()) ) {
|
1977
|
+
( diff = nodeIndex = 0 ) || start.pop() ) ) {
|
1856
1978
|
|
1857
1979
|
// When found, cache indexes on `parent` and break
|
1858
1980
|
if ( node.nodeType === 1 && ++diff && node === elem ) {
|
@@ -1862,16 +1984,18 @@ Expr = Sizzle.selectors = {
|
|
1862
1984
|
}
|
1863
1985
|
|
1864
1986
|
} else {
|
1987
|
+
|
1865
1988
|
// Use previously-cached element index if available
|
1866
1989
|
if ( useCache ) {
|
1990
|
+
|
1867
1991
|
// ...in a gzip-friendly way
|
1868
1992
|
node = elem;
|
1869
|
-
outerCache = node[ expando ] || (node[ expando ] = {});
|
1993
|
+
outerCache = node[ expando ] || ( node[ expando ] = {} );
|
1870
1994
|
|
1871
1995
|
// Support: IE <9 only
|
1872
1996
|
// Defend against cloned attroperties (jQuery gh-1709)
|
1873
1997
|
uniqueCache = outerCache[ node.uniqueID ] ||
|
1874
|
-
(outerCache[ node.uniqueID ] = {});
|
1998
|
+
( outerCache[ node.uniqueID ] = {} );
|
1875
1999
|
|
1876
2000
|
cache = uniqueCache[ type ] || [];
|
1877
2001
|
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
|
@@ -1881,9 +2005,10 @@ Expr = Sizzle.selectors = {
|
|
1881
2005
|
// xml :nth-child(...)
|
1882
2006
|
// or :nth-last-child(...) or :nth(-last)?-of-type(...)
|
1883
2007
|
if ( diff === false ) {
|
2008
|
+
|
1884
2009
|
// Use the same loop as above to seek `elem` from the start
|
1885
|
-
while ( (node = ++nodeIndex && node && node[ dir ] ||
|
1886
|
-
(diff = nodeIndex = 0) || start.pop()) ) {
|
2010
|
+
while ( ( node = ++nodeIndex && node && node[ dir ] ||
|
2011
|
+
( diff = nodeIndex = 0 ) || start.pop() ) ) {
|
1887
2012
|
|
1888
2013
|
if ( ( ofType ?
|
1889
2014
|
node.nodeName.toLowerCase() === name :
|
@@ -1892,12 +2017,13 @@ Expr = Sizzle.selectors = {
|
|
1892
2017
|
|
1893
2018
|
// Cache the index of each encountered element
|
1894
2019
|
if ( useCache ) {
|
1895
|
-
outerCache = node[ expando ] ||
|
2020
|
+
outerCache = node[ expando ] ||
|
2021
|
+
( node[ expando ] = {} );
|
1896
2022
|
|
1897
2023
|
// Support: IE <9 only
|
1898
2024
|
// Defend against cloned attroperties (jQuery gh-1709)
|
1899
2025
|
uniqueCache = outerCache[ node.uniqueID ] ||
|
1900
|
-
(outerCache[ node.uniqueID ] = {});
|
2026
|
+
( outerCache[ node.uniqueID ] = {} );
|
1901
2027
|
|
1902
2028
|
uniqueCache[ type ] = [ dirruns, diff ];
|
1903
2029
|
}
|
@@ -1918,6 +2044,7 @@ Expr = Sizzle.selectors = {
|
|
1918
2044
|
},
|
1919
2045
|
|
1920
2046
|
"PSEUDO": function( pseudo, argument ) {
|
2047
|
+
|
1921
2048
|
// pseudo-class names are case-insensitive
|
1922
2049
|
// http://www.w3.org/TR/selectors/#pseudo-classes
|
1923
2050
|
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
|
@@ -1937,15 +2064,15 @@ Expr = Sizzle.selectors = {
|
|
1937
2064
|
if ( fn.length > 1 ) {
|
1938
2065
|
args = [ pseudo, pseudo, "", argument ];
|
1939
2066
|
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
|
1940
|
-
markFunction(function( seed, matches ) {
|
2067
|
+
markFunction( function( seed, matches ) {
|
1941
2068
|
var idx,
|
1942
2069
|
matched = fn( seed, argument ),
|
1943
2070
|
i = matched.length;
|
1944
2071
|
while ( i-- ) {
|
1945
|
-
idx = indexOf( seed, matched[i] );
|
1946
|
-
seed[ idx ] = !( matches[ idx ] = matched[i] );
|
2072
|
+
idx = indexOf( seed, matched[ i ] );
|
2073
|
+
seed[ idx ] = !( matches[ idx ] = matched[ i ] );
|
1947
2074
|
}
|
1948
|
-
}) :
|
2075
|
+
} ) :
|
1949
2076
|
function( elem ) {
|
1950
2077
|
return fn( elem, 0, args );
|
1951
2078
|
};
|
@@ -1956,8 +2083,10 @@ Expr = Sizzle.selectors = {
|
|
1956
2083
|
},
|
1957
2084
|
|
1958
2085
|
pseudos: {
|
2086
|
+
|
1959
2087
|
// Potentially complex pseudos
|
1960
|
-
"not": markFunction(function( selector ) {
|
2088
|
+
"not": markFunction( function( selector ) {
|
2089
|
+
|
1961
2090
|
// Trim the selector passed to compile
|
1962
2091
|
// to avoid treating leading and trailing
|
1963
2092
|
// spaces as combinators
|
@@ -1966,39 +2095,40 @@ Expr = Sizzle.selectors = {
|
|
1966
2095
|
matcher = compile( selector.replace( rtrim, "$1" ) );
|
1967
2096
|
|
1968
2097
|
return matcher[ expando ] ?
|
1969
|
-
markFunction(function( seed, matches,
|
2098
|
+
markFunction( function( seed, matches, _context, xml ) {
|
1970
2099
|
var elem,
|
1971
2100
|
unmatched = matcher( seed, null, xml, [] ),
|
1972
2101
|
i = seed.length;
|
1973
2102
|
|
1974
2103
|
// Match elements unmatched by `matcher`
|
1975
2104
|
while ( i-- ) {
|
1976
|
-
if ( (elem = unmatched[i]) ) {
|
1977
|
-
seed[i] = !(matches[i] = elem);
|
2105
|
+
if ( ( elem = unmatched[ i ] ) ) {
|
2106
|
+
seed[ i ] = !( matches[ i ] = elem );
|
1978
2107
|
}
|
1979
2108
|
}
|
1980
|
-
}) :
|
1981
|
-
function( elem,
|
1982
|
-
input[0] = elem;
|
2109
|
+
} ) :
|
2110
|
+
function( elem, _context, xml ) {
|
2111
|
+
input[ 0 ] = elem;
|
1983
2112
|
matcher( input, null, xml, results );
|
2113
|
+
|
1984
2114
|
// Don't keep the element (issue #299)
|
1985
|
-
input[0] = null;
|
2115
|
+
input[ 0 ] = null;
|
1986
2116
|
return !results.pop();
|
1987
2117
|
};
|
1988
|
-
}),
|
2118
|
+
} ),
|
1989
2119
|
|
1990
|
-
"has": markFunction(function( selector ) {
|
2120
|
+
"has": markFunction( function( selector ) {
|
1991
2121
|
return function( elem ) {
|
1992
2122
|
return Sizzle( selector, elem ).length > 0;
|
1993
2123
|
};
|
1994
|
-
}),
|
2124
|
+
} ),
|
1995
2125
|
|
1996
|
-
"contains": markFunction(function( text ) {
|
2126
|
+
"contains": markFunction( function( text ) {
|
1997
2127
|
text = text.replace( runescape, funescape );
|
1998
2128
|
return function( elem ) {
|
1999
|
-
return ( elem.textContent ||
|
2129
|
+
return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
|
2000
2130
|
};
|
2001
|
-
}),
|
2131
|
+
} ),
|
2002
2132
|
|
2003
2133
|
// "Whether an element is represented by a :lang() selector
|
2004
2134
|
// is based solely on the element's language value
|
@@ -2008,25 +2138,26 @@ Expr = Sizzle.selectors = {
|
|
2008
2138
|
// The identifier C does not have to be a valid language name."
|
2009
2139
|
// http://www.w3.org/TR/selectors/#lang-pseudo
|
2010
2140
|
"lang": markFunction( function( lang ) {
|
2141
|
+
|
2011
2142
|
// lang value must be a valid identifier
|
2012
|
-
if ( !ridentifier.test(lang || "") ) {
|
2143
|
+
if ( !ridentifier.test( lang || "" ) ) {
|
2013
2144
|
Sizzle.error( "unsupported lang: " + lang );
|
2014
2145
|
}
|
2015
2146
|
lang = lang.replace( runescape, funescape ).toLowerCase();
|
2016
2147
|
return function( elem ) {
|
2017
2148
|
var elemLang;
|
2018
2149
|
do {
|
2019
|
-
if ( (elemLang = documentIsHTML ?
|
2150
|
+
if ( ( elemLang = documentIsHTML ?
|
2020
2151
|
elem.lang :
|
2021
|
-
elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
|
2152
|
+
elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
|
2022
2153
|
|
2023
2154
|
elemLang = elemLang.toLowerCase();
|
2024
2155
|
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
|
2025
2156
|
}
|
2026
|
-
} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
|
2157
|
+
} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
|
2027
2158
|
return false;
|
2028
2159
|
};
|
2029
|
-
}),
|
2160
|
+
} ),
|
2030
2161
|
|
2031
2162
|
// Miscellaneous
|
2032
2163
|
"target": function( elem ) {
|
@@ -2039,7 +2170,9 @@ Expr = Sizzle.selectors = {
|
|
2039
2170
|
},
|
2040
2171
|
|
2041
2172
|
"focus": function( elem ) {
|
2042
|
-
return elem === document.activeElement &&
|
2173
|
+
return elem === document.activeElement &&
|
2174
|
+
( !document.hasFocus || document.hasFocus() ) &&
|
2175
|
+
!!( elem.type || elem.href || ~elem.tabIndex );
|
2043
2176
|
},
|
2044
2177
|
|
2045
2178
|
// Boolean properties
|
@@ -2047,16 +2180,20 @@ Expr = Sizzle.selectors = {
|
|
2047
2180
|
"disabled": createDisabledPseudo( true ),
|
2048
2181
|
|
2049
2182
|
"checked": function( elem ) {
|
2183
|
+
|
2050
2184
|
// In CSS3, :checked should return both checked and selected elements
|
2051
2185
|
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
|
2052
2186
|
var nodeName = elem.nodeName.toLowerCase();
|
2053
|
-
return (nodeName === "input" && !!elem.checked) ||
|
2187
|
+
return ( nodeName === "input" && !!elem.checked ) ||
|
2188
|
+
( nodeName === "option" && !!elem.selected );
|
2054
2189
|
},
|
2055
2190
|
|
2056
2191
|
"selected": function( elem ) {
|
2192
|
+
|
2057
2193
|
// Accessing this property makes selected-by-default
|
2058
2194
|
// options in Safari work properly
|
2059
2195
|
if ( elem.parentNode ) {
|
2196
|
+
// eslint-disable-next-line no-unused-expressions
|
2060
2197
|
elem.parentNode.selectedIndex;
|
2061
2198
|
}
|
2062
2199
|
|
@@ -2065,6 +2202,7 @@ Expr = Sizzle.selectors = {
|
|
2065
2202
|
|
2066
2203
|
// Contents
|
2067
2204
|
"empty": function( elem ) {
|
2205
|
+
|
2068
2206
|
// http://www.w3.org/TR/selectors/#empty-pseudo
|
2069
2207
|
// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
|
2070
2208
|
// but not by others (comment: 8; processing instruction: 7; etc.)
|
@@ -2078,7 +2216,7 @@ Expr = Sizzle.selectors = {
|
|
2078
2216
|
},
|
2079
2217
|
|
2080
2218
|
"parent": function( elem ) {
|
2081
|
-
return !Expr.pseudos["empty"]( elem );
|
2219
|
+
return !Expr.pseudos[ "empty" ]( elem );
|
2082
2220
|
},
|
2083
2221
|
|
2084
2222
|
// Element/input types
|
@@ -2102,57 +2240,62 @@ Expr = Sizzle.selectors = {
|
|
2102
2240
|
|
2103
2241
|
// Support: IE<8
|
2104
2242
|
// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
|
2105
|
-
( (attr = elem.getAttribute("type")) == null ||
|
2243
|
+
( ( attr = elem.getAttribute( "type" ) ) == null ||
|
2244
|
+
attr.toLowerCase() === "text" );
|
2106
2245
|
},
|
2107
2246
|
|
2108
2247
|
// Position-in-collection
|
2109
|
-
"first": createPositionalPseudo(function() {
|
2248
|
+
"first": createPositionalPseudo( function() {
|
2110
2249
|
return [ 0 ];
|
2111
|
-
}),
|
2250
|
+
} ),
|
2112
2251
|
|
2113
|
-
"last": createPositionalPseudo(function(
|
2252
|
+
"last": createPositionalPseudo( function( _matchIndexes, length ) {
|
2114
2253
|
return [ length - 1 ];
|
2115
|
-
}),
|
2254
|
+
} ),
|
2116
2255
|
|
2117
|
-
"eq": createPositionalPseudo(function(
|
2256
|
+
"eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
|
2118
2257
|
return [ argument < 0 ? argument + length : argument ];
|
2119
|
-
}),
|
2258
|
+
} ),
|
2120
2259
|
|
2121
|
-
"even": createPositionalPseudo(function( matchIndexes, length ) {
|
2260
|
+
"even": createPositionalPseudo( function( matchIndexes, length ) {
|
2122
2261
|
var i = 0;
|
2123
2262
|
for ( ; i < length; i += 2 ) {
|
2124
2263
|
matchIndexes.push( i );
|
2125
2264
|
}
|
2126
2265
|
return matchIndexes;
|
2127
|
-
}),
|
2266
|
+
} ),
|
2128
2267
|
|
2129
|
-
"odd": createPositionalPseudo(function( matchIndexes, length ) {
|
2268
|
+
"odd": createPositionalPseudo( function( matchIndexes, length ) {
|
2130
2269
|
var i = 1;
|
2131
2270
|
for ( ; i < length; i += 2 ) {
|
2132
2271
|
matchIndexes.push( i );
|
2133
2272
|
}
|
2134
2273
|
return matchIndexes;
|
2135
|
-
}),
|
2274
|
+
} ),
|
2136
2275
|
|
2137
|
-
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
2138
|
-
var i = argument < 0 ?
|
2276
|
+
"lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
|
2277
|
+
var i = argument < 0 ?
|
2278
|
+
argument + length :
|
2279
|
+
argument > length ?
|
2280
|
+
length :
|
2281
|
+
argument;
|
2139
2282
|
for ( ; --i >= 0; ) {
|
2140
2283
|
matchIndexes.push( i );
|
2141
2284
|
}
|
2142
2285
|
return matchIndexes;
|
2143
|
-
}),
|
2286
|
+
} ),
|
2144
2287
|
|
2145
|
-
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
2288
|
+
"gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
|
2146
2289
|
var i = argument < 0 ? argument + length : argument;
|
2147
2290
|
for ( ; ++i < length; ) {
|
2148
2291
|
matchIndexes.push( i );
|
2149
2292
|
}
|
2150
2293
|
return matchIndexes;
|
2151
|
-
})
|
2294
|
+
} )
|
2152
2295
|
}
|
2153
2296
|
};
|
2154
2297
|
|
2155
|
-
Expr.pseudos["nth"] = Expr.pseudos["eq"];
|
2298
|
+
Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
|
2156
2299
|
|
2157
2300
|
// Add button/input type pseudos
|
2158
2301
|
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
|
@@ -2183,37 +2326,39 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
|
|
2183
2326
|
while ( soFar ) {
|
2184
2327
|
|
2185
2328
|
// Comma and first run
|
2186
|
-
if ( !matched || (match = rcomma.exec( soFar )) ) {
|
2329
|
+
if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
|
2187
2330
|
if ( match ) {
|
2331
|
+
|
2188
2332
|
// Don't consume trailing commas as valid
|
2189
|
-
soFar = soFar.slice( match[0].length ) || soFar;
|
2333
|
+
soFar = soFar.slice( match[ 0 ].length ) || soFar;
|
2190
2334
|
}
|
2191
|
-
groups.push( (tokens = []) );
|
2335
|
+
groups.push( ( tokens = [] ) );
|
2192
2336
|
}
|
2193
2337
|
|
2194
2338
|
matched = false;
|
2195
2339
|
|
2196
2340
|
// Combinators
|
2197
|
-
if ( (match = rcombinators.exec( soFar )) ) {
|
2341
|
+
if ( ( match = rcombinators.exec( soFar ) ) ) {
|
2198
2342
|
matched = match.shift();
|
2199
|
-
tokens.push({
|
2343
|
+
tokens.push( {
|
2200
2344
|
value: matched,
|
2345
|
+
|
2201
2346
|
// Cast descendant combinators to space
|
2202
|
-
type: match[0].replace( rtrim, " " )
|
2203
|
-
});
|
2347
|
+
type: match[ 0 ].replace( rtrim, " " )
|
2348
|
+
} );
|
2204
2349
|
soFar = soFar.slice( matched.length );
|
2205
2350
|
}
|
2206
2351
|
|
2207
2352
|
// Filters
|
2208
2353
|
for ( type in Expr.filter ) {
|
2209
|
-
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
|
2210
|
-
(match = preFilters[ type ]( match ))) ) {
|
2354
|
+
if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
|
2355
|
+
( match = preFilters[ type ]( match ) ) ) ) {
|
2211
2356
|
matched = match.shift();
|
2212
|
-
tokens.push({
|
2357
|
+
tokens.push( {
|
2213
2358
|
value: matched,
|
2214
2359
|
type: type,
|
2215
2360
|
matches: match
|
2216
|
-
});
|
2361
|
+
} );
|
2217
2362
|
soFar = soFar.slice( matched.length );
|
2218
2363
|
}
|
2219
2364
|
}
|
@@ -2230,6 +2375,7 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
|
|
2230
2375
|
soFar.length :
|
2231
2376
|
soFar ?
|
2232
2377
|
Sizzle.error( selector ) :
|
2378
|
+
|
2233
2379
|
// Cache the tokens
|
2234
2380
|
tokenCache( selector, groups ).slice( 0 );
|
2235
2381
|
};
|
@@ -2239,7 +2385,7 @@ function toSelector( tokens ) {
|
|
2239
2385
|
len = tokens.length,
|
2240
2386
|
selector = "";
|
2241
2387
|
for ( ; i < len; i++ ) {
|
2242
|
-
selector += tokens[i].value;
|
2388
|
+
selector += tokens[ i ].value;
|
2243
2389
|
}
|
2244
2390
|
return selector;
|
2245
2391
|
}
|
@@ -2252,9 +2398,10 @@ function addCombinator( matcher, combinator, base ) {
|
|
2252
2398
|
doneName = done++;
|
2253
2399
|
|
2254
2400
|
return combinator.first ?
|
2401
|
+
|
2255
2402
|
// Check against closest ancestor/preceding element
|
2256
2403
|
function( elem, context, xml ) {
|
2257
|
-
while ( (elem = elem[ dir ]) ) {
|
2404
|
+
while ( ( elem = elem[ dir ] ) ) {
|
2258
2405
|
if ( elem.nodeType === 1 || checkNonElements ) {
|
2259
2406
|
return matcher( elem, context, xml );
|
2260
2407
|
}
|
@@ -2269,7 +2416,7 @@ function addCombinator( matcher, combinator, base ) {
|
|
2269
2416
|
|
2270
2417
|
// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
|
2271
2418
|
if ( xml ) {
|
2272
|
-
while ( (elem = elem[ dir ]) ) {
|
2419
|
+
while ( ( elem = elem[ dir ] ) ) {
|
2273
2420
|
if ( elem.nodeType === 1 || checkNonElements ) {
|
2274
2421
|
if ( matcher( elem, context, xml ) ) {
|
2275
2422
|
return true;
|
@@ -2277,27 +2424,29 @@ function addCombinator( matcher, combinator, base ) {
|
|
2277
2424
|
}
|
2278
2425
|
}
|
2279
2426
|
} else {
|
2280
|
-
while ( (elem = elem[ dir ]) ) {
|
2427
|
+
while ( ( elem = elem[ dir ] ) ) {
|
2281
2428
|
if ( elem.nodeType === 1 || checkNonElements ) {
|
2282
|
-
outerCache = elem[ expando ] || (elem[ expando ] = {});
|
2429
|
+
outerCache = elem[ expando ] || ( elem[ expando ] = {} );
|
2283
2430
|
|
2284
2431
|
// Support: IE <9 only
|
2285
2432
|
// Defend against cloned attroperties (jQuery gh-1709)
|
2286
|
-
uniqueCache = outerCache[ elem.uniqueID ] ||
|
2433
|
+
uniqueCache = outerCache[ elem.uniqueID ] ||
|
2434
|
+
( outerCache[ elem.uniqueID ] = {} );
|
2287
2435
|
|
2288
2436
|
if ( skip && skip === elem.nodeName.toLowerCase() ) {
|
2289
2437
|
elem = elem[ dir ] || elem;
|
2290
|
-
} else if ( (oldCache = uniqueCache[ key ]) &&
|
2438
|
+
} else if ( ( oldCache = uniqueCache[ key ] ) &&
|
2291
2439
|
oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
|
2292
2440
|
|
2293
2441
|
// Assign to newCache so results back-propagate to previous elements
|
2294
|
-
return (newCache[ 2 ] = oldCache[ 2 ]);
|
2442
|
+
return ( newCache[ 2 ] = oldCache[ 2 ] );
|
2295
2443
|
} else {
|
2444
|
+
|
2296
2445
|
// Reuse newcache so results back-propagate to previous elements
|
2297
2446
|
uniqueCache[ key ] = newCache;
|
2298
2447
|
|
2299
2448
|
// A match means we're done; a fail means we have to keep checking
|
2300
|
-
if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
|
2449
|
+
if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
|
2301
2450
|
return true;
|
2302
2451
|
}
|
2303
2452
|
}
|
@@ -2313,20 +2462,20 @@ function elementMatcher( matchers ) {
|
|
2313
2462
|
function( elem, context, xml ) {
|
2314
2463
|
var i = matchers.length;
|
2315
2464
|
while ( i-- ) {
|
2316
|
-
if ( !matchers[i]( elem, context, xml ) ) {
|
2465
|
+
if ( !matchers[ i ]( elem, context, xml ) ) {
|
2317
2466
|
return false;
|
2318
2467
|
}
|
2319
2468
|
}
|
2320
2469
|
return true;
|
2321
2470
|
} :
|
2322
|
-
matchers[0];
|
2471
|
+
matchers[ 0 ];
|
2323
2472
|
}
|
2324
2473
|
|
2325
2474
|
function multipleContexts( selector, contexts, results ) {
|
2326
2475
|
var i = 0,
|
2327
2476
|
len = contexts.length;
|
2328
2477
|
for ( ; i < len; i++ ) {
|
2329
|
-
Sizzle( selector, contexts[i], results );
|
2478
|
+
Sizzle( selector, contexts[ i ], results );
|
2330
2479
|
}
|
2331
2480
|
return results;
|
2332
2481
|
}
|
@@ -2339,7 +2488,7 @@ function condense( unmatched, map, filter, context, xml ) {
|
|
2339
2488
|
mapped = map != null;
|
2340
2489
|
|
2341
2490
|
for ( ; i < len; i++ ) {
|
2342
|
-
if ( (elem = unmatched[i]) ) {
|
2491
|
+
if ( ( elem = unmatched[ i ] ) ) {
|
2343
2492
|
if ( !filter || filter( elem, context, xml ) ) {
|
2344
2493
|
newUnmatched.push( elem );
|
2345
2494
|
if ( mapped ) {
|
@@ -2359,14 +2508,18 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2359
2508
|
if ( postFinder && !postFinder[ expando ] ) {
|
2360
2509
|
postFinder = setMatcher( postFinder, postSelector );
|
2361
2510
|
}
|
2362
|
-
return markFunction(function( seed, results, context, xml ) {
|
2511
|
+
return markFunction( function( seed, results, context, xml ) {
|
2363
2512
|
var temp, i, elem,
|
2364
2513
|
preMap = [],
|
2365
2514
|
postMap = [],
|
2366
2515
|
preexisting = results.length,
|
2367
2516
|
|
2368
2517
|
// Get initial elements from seed or context
|
2369
|
-
elems = seed || multipleContexts(
|
2518
|
+
elems = seed || multipleContexts(
|
2519
|
+
selector || "*",
|
2520
|
+
context.nodeType ? [ context ] : context,
|
2521
|
+
[]
|
2522
|
+
),
|
2370
2523
|
|
2371
2524
|
// Prefilter to get matcher input, preserving a map for seed-results synchronization
|
2372
2525
|
matcherIn = preFilter && ( seed || !selector ) ?
|
@@ -2374,6 +2527,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2374
2527
|
elems,
|
2375
2528
|
|
2376
2529
|
matcherOut = matcher ?
|
2530
|
+
|
2377
2531
|
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
|
2378
2532
|
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
|
2379
2533
|
|
@@ -2397,8 +2551,8 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2397
2551
|
// Un-match failing elements by moving them back to matcherIn
|
2398
2552
|
i = temp.length;
|
2399
2553
|
while ( i-- ) {
|
2400
|
-
if ( (elem = temp[i]) ) {
|
2401
|
-
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
|
2554
|
+
if ( ( elem = temp[ i ] ) ) {
|
2555
|
+
matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
|
2402
2556
|
}
|
2403
2557
|
}
|
2404
2558
|
}
|
@@ -2406,25 +2560,27 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2406
2560
|
if ( seed ) {
|
2407
2561
|
if ( postFinder || preFilter ) {
|
2408
2562
|
if ( postFinder ) {
|
2563
|
+
|
2409
2564
|
// Get the final matcherOut by condensing this intermediate into postFinder contexts
|
2410
2565
|
temp = [];
|
2411
2566
|
i = matcherOut.length;
|
2412
2567
|
while ( i-- ) {
|
2413
|
-
if ( (elem = matcherOut[i]) ) {
|
2568
|
+
if ( ( elem = matcherOut[ i ] ) ) {
|
2569
|
+
|
2414
2570
|
// Restore matcherIn since elem is not yet a final match
|
2415
|
-
temp.push( (matcherIn[i] = elem) );
|
2571
|
+
temp.push( ( matcherIn[ i ] = elem ) );
|
2416
2572
|
}
|
2417
2573
|
}
|
2418
|
-
postFinder( null, (matcherOut = []), temp, xml );
|
2574
|
+
postFinder( null, ( matcherOut = [] ), temp, xml );
|
2419
2575
|
}
|
2420
2576
|
|
2421
2577
|
// Move matched elements from seed to results to keep them synchronized
|
2422
2578
|
i = matcherOut.length;
|
2423
2579
|
while ( i-- ) {
|
2424
|
-
if ( (elem = matcherOut[i]) &&
|
2425
|
-
(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
|
2580
|
+
if ( ( elem = matcherOut[ i ] ) &&
|
2581
|
+
( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
|
2426
2582
|
|
2427
|
-
seed[temp] = !(results[temp] = elem);
|
2583
|
+
seed[ temp ] = !( results[ temp ] = elem );
|
2428
2584
|
}
|
2429
2585
|
}
|
2430
2586
|
}
|
@@ -2442,14 +2598,14 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2442
2598
|
push.apply( results, matcherOut );
|
2443
2599
|
}
|
2444
2600
|
}
|
2445
|
-
});
|
2601
|
+
} );
|
2446
2602
|
}
|
2447
2603
|
|
2448
2604
|
function matcherFromTokens( tokens ) {
|
2449
2605
|
var checkContext, matcher, j,
|
2450
2606
|
len = tokens.length,
|
2451
|
-
leadingRelative = Expr.relative[ tokens[0].type ],
|
2452
|
-
implicitRelative = leadingRelative || Expr.relative[" "],
|
2607
|
+
leadingRelative = Expr.relative[ tokens[ 0 ].type ],
|
2608
|
+
implicitRelative = leadingRelative || Expr.relative[ " " ],
|
2453
2609
|
i = leadingRelative ? 1 : 0,
|
2454
2610
|
|
2455
2611
|
// The foundational matcher ensures that elements are reachable from top-level context(s)
|
@@ -2461,38 +2617,43 @@ function matcherFromTokens( tokens ) {
|
|
2461
2617
|
}, implicitRelative, true ),
|
2462
2618
|
matchers = [ function( elem, context, xml ) {
|
2463
2619
|
var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
|
2464
|
-
(checkContext = context).nodeType ?
|
2620
|
+
( checkContext = context ).nodeType ?
|
2465
2621
|
matchContext( elem, context, xml ) :
|
2466
2622
|
matchAnyContext( elem, context, xml ) );
|
2623
|
+
|
2467
2624
|
// Avoid hanging onto element (issue #299)
|
2468
2625
|
checkContext = null;
|
2469
2626
|
return ret;
|
2470
2627
|
} ];
|
2471
2628
|
|
2472
2629
|
for ( ; i < len; i++ ) {
|
2473
|
-
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
|
2474
|
-
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
|
2630
|
+
if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
|
2631
|
+
matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
|
2475
2632
|
} else {
|
2476
|
-
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
|
2633
|
+
matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
|
2477
2634
|
|
2478
2635
|
// Return special upon seeing a positional matcher
|
2479
2636
|
if ( matcher[ expando ] ) {
|
2637
|
+
|
2480
2638
|
// Find the next relative operator (if any) for proper handling
|
2481
2639
|
j = ++i;
|
2482
2640
|
for ( ; j < len; j++ ) {
|
2483
|
-
if ( Expr.relative[ tokens[j].type ] ) {
|
2641
|
+
if ( Expr.relative[ tokens[ j ].type ] ) {
|
2484
2642
|
break;
|
2485
2643
|
}
|
2486
2644
|
}
|
2487
2645
|
return setMatcher(
|
2488
2646
|
i > 1 && elementMatcher( matchers ),
|
2489
2647
|
i > 1 && toSelector(
|
2490
|
-
|
2491
|
-
|
2648
|
+
|
2649
|
+
// If the preceding token was a descendant combinator, insert an implicit any-element `*`
|
2650
|
+
tokens
|
2651
|
+
.slice( 0, i - 1 )
|
2652
|
+
.concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
|
2492
2653
|
).replace( rtrim, "$1" ),
|
2493
2654
|
matcher,
|
2494
2655
|
i < j && matcherFromTokens( tokens.slice( i, j ) ),
|
2495
|
-
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
|
2656
|
+
j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
|
2496
2657
|
j < len && toSelector( tokens )
|
2497
2658
|
);
|
2498
2659
|
}
|
@@ -2513,28 +2674,40 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2513
2674
|
unmatched = seed && [],
|
2514
2675
|
setMatched = [],
|
2515
2676
|
contextBackup = outermostContext,
|
2677
|
+
|
2516
2678
|
// We must always have either seed elements or outermost context
|
2517
|
-
elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
|
2679
|
+
elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
|
2680
|
+
|
2518
2681
|
// Use integer dirruns iff this is the outermost matcher
|
2519
|
-
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
|
2682
|
+
dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
|
2520
2683
|
len = elems.length;
|
2521
2684
|
|
2522
2685
|
if ( outermost ) {
|
2523
|
-
|
2686
|
+
|
2687
|
+
// Support: IE 11+, Edge 17 - 18+
|
2688
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
2689
|
+
// two documents; shallow comparisons work.
|
2690
|
+
// eslint-disable-next-line eqeqeq
|
2691
|
+
outermostContext = context == document || context || outermost;
|
2524
2692
|
}
|
2525
2693
|
|
2526
2694
|
// Add elements passing elementMatchers directly to results
|
2527
2695
|
// Support: IE<9, Safari
|
2528
2696
|
// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
|
2529
|
-
for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
|
2697
|
+
for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
|
2530
2698
|
if ( byElement && elem ) {
|
2531
2699
|
j = 0;
|
2532
|
-
|
2700
|
+
|
2701
|
+
// Support: IE 11+, Edge 17 - 18+
|
2702
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
2703
|
+
// two documents; shallow comparisons work.
|
2704
|
+
// eslint-disable-next-line eqeqeq
|
2705
|
+
if ( !context && elem.ownerDocument != document ) {
|
2533
2706
|
setDocument( elem );
|
2534
2707
|
xml = !documentIsHTML;
|
2535
2708
|
}
|
2536
|
-
while ( (matcher = elementMatchers[j++]) ) {
|
2537
|
-
if ( matcher( elem, context || document, xml) ) {
|
2709
|
+
while ( ( matcher = elementMatchers[ j++ ] ) ) {
|
2710
|
+
if ( matcher( elem, context || document, xml ) ) {
|
2538
2711
|
results.push( elem );
|
2539
2712
|
break;
|
2540
2713
|
}
|
@@ -2546,8 +2719,9 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2546
2719
|
|
2547
2720
|
// Track unmatched elements for set filters
|
2548
2721
|
if ( bySet ) {
|
2722
|
+
|
2549
2723
|
// They will have gone through all possible matchers
|
2550
|
-
if ( (elem = !matcher && elem) ) {
|
2724
|
+
if ( ( elem = !matcher && elem ) ) {
|
2551
2725
|
matchedCount--;
|
2552
2726
|
}
|
2553
2727
|
|
@@ -2571,16 +2745,17 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2571
2745
|
// numerically zero.
|
2572
2746
|
if ( bySet && i !== matchedCount ) {
|
2573
2747
|
j = 0;
|
2574
|
-
while ( (matcher = setMatchers[j++]) ) {
|
2748
|
+
while ( ( matcher = setMatchers[ j++ ] ) ) {
|
2575
2749
|
matcher( unmatched, setMatched, context, xml );
|
2576
2750
|
}
|
2577
2751
|
|
2578
2752
|
if ( seed ) {
|
2753
|
+
|
2579
2754
|
// Reintegrate element matches to eliminate the need for sorting
|
2580
2755
|
if ( matchedCount > 0 ) {
|
2581
2756
|
while ( i-- ) {
|
2582
|
-
if ( !(unmatched[i] || setMatched[i]) ) {
|
2583
|
-
setMatched[i] = pop.call( results );
|
2757
|
+
if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
|
2758
|
+
setMatched[ i ] = pop.call( results );
|
2584
2759
|
}
|
2585
2760
|
}
|
2586
2761
|
}
|
@@ -2621,13 +2796,14 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
|
|
2621
2796
|
cached = compilerCache[ selector + " " ];
|
2622
2797
|
|
2623
2798
|
if ( !cached ) {
|
2799
|
+
|
2624
2800
|
// Generate a function of recursive functions that can be used to check each element
|
2625
2801
|
if ( !match ) {
|
2626
2802
|
match = tokenize( selector );
|
2627
2803
|
}
|
2628
2804
|
i = match.length;
|
2629
2805
|
while ( i-- ) {
|
2630
|
-
cached = matcherFromTokens( match[i] );
|
2806
|
+
cached = matcherFromTokens( match[ i ] );
|
2631
2807
|
if ( cached[ expando ] ) {
|
2632
2808
|
setMatchers.push( cached );
|
2633
2809
|
} else {
|
@@ -2636,7 +2812,10 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
|
|
2636
2812
|
}
|
2637
2813
|
|
2638
2814
|
// Cache the compiled function
|
2639
|
-
cached = compilerCache(
|
2815
|
+
cached = compilerCache(
|
2816
|
+
selector,
|
2817
|
+
matcherFromGroupMatchers( elementMatchers, setMatchers )
|
2818
|
+
);
|
2640
2819
|
|
2641
2820
|
// Save selector and tokenization
|
2642
2821
|
cached.selector = selector;
|
@@ -2656,7 +2835,7 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
|
|
2656
2835
|
select = Sizzle.select = function( selector, context, results, seed ) {
|
2657
2836
|
var i, tokens, token, type, find,
|
2658
2837
|
compiled = typeof selector === "function" && selector,
|
2659
|
-
match = !seed && tokenize( (selector = compiled.selector || selector) );
|
2838
|
+
match = !seed && tokenize( ( selector = compiled.selector || selector ) );
|
2660
2839
|
|
2661
2840
|
results = results || [];
|
2662
2841
|
|
@@ -2665,11 +2844,12 @@ select = Sizzle.select = function( selector, context, results, seed ) {
|
|
2665
2844
|
if ( match.length === 1 ) {
|
2666
2845
|
|
2667
2846
|
// Reduce context if the leading compound selector is an ID
|
2668
|
-
tokens = match[0] = match[0].slice( 0 );
|
2669
|
-
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
|
2670
|
-
|
2847
|
+
tokens = match[ 0 ] = match[ 0 ].slice( 0 );
|
2848
|
+
if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
|
2849
|
+
context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
|
2671
2850
|
|
2672
|
-
context = ( Expr.find["ID"]( token.matches[0
|
2851
|
+
context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
|
2852
|
+
.replace( runescape, funescape ), context ) || [] )[ 0 ];
|
2673
2853
|
if ( !context ) {
|
2674
2854
|
return results;
|
2675
2855
|
|
@@ -2682,20 +2862,22 @@ select = Sizzle.select = function( selector, context, results, seed ) {
|
|
2682
2862
|
}
|
2683
2863
|
|
2684
2864
|
// Fetch a seed set for right-to-left matching
|
2685
|
-
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
|
2865
|
+
i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
|
2686
2866
|
while ( i-- ) {
|
2687
|
-
token = tokens[i];
|
2867
|
+
token = tokens[ i ];
|
2688
2868
|
|
2689
2869
|
// Abort if we hit a combinator
|
2690
|
-
if ( Expr.relative[ (type = token.type) ] ) {
|
2870
|
+
if ( Expr.relative[ ( type = token.type ) ] ) {
|
2691
2871
|
break;
|
2692
2872
|
}
|
2693
|
-
if ( (find = Expr.find[ type ]) ) {
|
2873
|
+
if ( ( find = Expr.find[ type ] ) ) {
|
2874
|
+
|
2694
2875
|
// Search, expanding context for leading sibling combinators
|
2695
|
-
if ( (seed = find(
|
2696
|
-
token.matches[0].replace( runescape, funescape ),
|
2697
|
-
rsibling.test( tokens[0].type ) && testContext( context.parentNode ) ||
|
2698
|
-
|
2876
|
+
if ( ( seed = find(
|
2877
|
+
token.matches[ 0 ].replace( runescape, funescape ),
|
2878
|
+
rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
|
2879
|
+
context
|
2880
|
+
) ) ) {
|
2699
2881
|
|
2700
2882
|
// If seed is empty or no tokens remain, we can return early
|
2701
2883
|
tokens.splice( i, 1 );
|
@@ -2726,7 +2908,7 @@ select = Sizzle.select = function( selector, context, results, seed ) {
|
|
2726
2908
|
// One-time assignments
|
2727
2909
|
|
2728
2910
|
// Sort stability
|
2729
|
-
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
|
2911
|
+
support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
|
2730
2912
|
|
2731
2913
|
// Support: Chrome 14-35+
|
2732
2914
|
// Always assume duplicates if they aren't passed to the comparison function
|
@@ -2737,58 +2919,59 @@ setDocument();
|
|
2737
2919
|
|
2738
2920
|
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
|
2739
2921
|
// Detached nodes confoundingly follow *each other*
|
2740
|
-
support.sortDetached = assert(function( el ) {
|
2922
|
+
support.sortDetached = assert( function( el ) {
|
2923
|
+
|
2741
2924
|
// Should return 1, but returns 4 (following)
|
2742
|
-
return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
|
2743
|
-
});
|
2925
|
+
return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
|
2926
|
+
} );
|
2744
2927
|
|
2745
2928
|
// Support: IE<8
|
2746
2929
|
// Prevent attribute/property "interpolation"
|
2747
2930
|
// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
2748
|
-
if ( !assert(function( el ) {
|
2931
|
+
if ( !assert( function( el ) {
|
2749
2932
|
el.innerHTML = "<a href='#'></a>";
|
2750
|
-
return el.firstChild.getAttribute("href") === "#"
|
2751
|
-
}) ) {
|
2933
|
+
return el.firstChild.getAttribute( "href" ) === "#";
|
2934
|
+
} ) ) {
|
2752
2935
|
addHandle( "type|href|height|width", function( elem, name, isXML ) {
|
2753
2936
|
if ( !isXML ) {
|
2754
2937
|
return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
|
2755
2938
|
}
|
2756
|
-
});
|
2939
|
+
} );
|
2757
2940
|
}
|
2758
2941
|
|
2759
2942
|
// Support: IE<9
|
2760
2943
|
// Use defaultValue in place of getAttribute("value")
|
2761
|
-
if ( !support.attributes || !assert(function( el ) {
|
2944
|
+
if ( !support.attributes || !assert( function( el ) {
|
2762
2945
|
el.innerHTML = "<input/>";
|
2763
2946
|
el.firstChild.setAttribute( "value", "" );
|
2764
2947
|
return el.firstChild.getAttribute( "value" ) === "";
|
2765
|
-
}) ) {
|
2766
|
-
addHandle( "value", function( elem,
|
2948
|
+
} ) ) {
|
2949
|
+
addHandle( "value", function( elem, _name, isXML ) {
|
2767
2950
|
if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
|
2768
2951
|
return elem.defaultValue;
|
2769
2952
|
}
|
2770
|
-
});
|
2953
|
+
} );
|
2771
2954
|
}
|
2772
2955
|
|
2773
2956
|
// Support: IE<9
|
2774
2957
|
// Use getAttributeNode to fetch booleans when getAttribute lies
|
2775
|
-
if ( !assert(function( el ) {
|
2776
|
-
return el.getAttribute("disabled") == null;
|
2777
|
-
}) ) {
|
2958
|
+
if ( !assert( function( el ) {
|
2959
|
+
return el.getAttribute( "disabled" ) == null;
|
2960
|
+
} ) ) {
|
2778
2961
|
addHandle( booleans, function( elem, name, isXML ) {
|
2779
2962
|
var val;
|
2780
2963
|
if ( !isXML ) {
|
2781
2964
|
return elem[ name ] === true ? name.toLowerCase() :
|
2782
|
-
|
2965
|
+
( val = elem.getAttributeNode( name ) ) && val.specified ?
|
2783
2966
|
val.value :
|
2784
|
-
|
2967
|
+
null;
|
2785
2968
|
}
|
2786
|
-
});
|
2969
|
+
} );
|
2787
2970
|
}
|
2788
2971
|
|
2789
2972
|
return Sizzle;
|
2790
2973
|
|
2791
|
-
})( window );
|
2974
|
+
} )( window );
|
2792
2975
|
|
2793
2976
|
|
2794
2977
|
|
@@ -2848,11 +3031,9 @@ var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|
|
|
2848
3031
|
|
2849
3032
|
|
2850
3033
|
|
2851
|
-
var risSimple = /^.[^:#\[\.,]*$/;
|
2852
|
-
|
2853
3034
|
// Implement the identical functionality for filter and not
|
2854
3035
|
function winnow( elements, qualifier, not ) {
|
2855
|
-
if (
|
3036
|
+
if ( isFunction( qualifier ) ) {
|
2856
3037
|
return jQuery.grep( elements, function( elem, i ) {
|
2857
3038
|
return !!qualifier.call( elem, i, elem ) !== not;
|
2858
3039
|
} );
|
@@ -2872,16 +3053,8 @@ function winnow( elements, qualifier, not ) {
|
|
2872
3053
|
} );
|
2873
3054
|
}
|
2874
3055
|
|
2875
|
-
//
|
2876
|
-
|
2877
|
-
return jQuery.filter( qualifier, elements, not );
|
2878
|
-
}
|
2879
|
-
|
2880
|
-
// Complex selector, compare the two sets, removing non-Elements
|
2881
|
-
qualifier = jQuery.filter( qualifier, elements );
|
2882
|
-
return jQuery.grep( elements, function( elem ) {
|
2883
|
-
return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
|
2884
|
-
} );
|
3056
|
+
// Filtered directly for both simple and complex selectors
|
3057
|
+
return jQuery.filter( qualifier, elements, not );
|
2885
3058
|
}
|
2886
3059
|
|
2887
3060
|
jQuery.filter = function( expr, elems, not ) {
|
@@ -3002,7 +3175,7 @@ var rootjQuery,
|
|
3002
3175
|
for ( match in context ) {
|
3003
3176
|
|
3004
3177
|
// Properties of context are called as methods if possible
|
3005
|
-
if (
|
3178
|
+
if ( isFunction( this[ match ] ) ) {
|
3006
3179
|
this[ match ]( context[ match ] );
|
3007
3180
|
|
3008
3181
|
// ...and otherwise set as attributes
|
@@ -3045,7 +3218,7 @@ var rootjQuery,
|
|
3045
3218
|
|
3046
3219
|
// HANDLE: $(function)
|
3047
3220
|
// Shortcut for document ready
|
3048
|
-
} else if (
|
3221
|
+
} else if ( isFunction( selector ) ) {
|
3049
3222
|
return root.ready !== undefined ?
|
3050
3223
|
root.ready( selector ) :
|
3051
3224
|
|
@@ -3167,7 +3340,7 @@ jQuery.each( {
|
|
3167
3340
|
parents: function( elem ) {
|
3168
3341
|
return dir( elem, "parentNode" );
|
3169
3342
|
},
|
3170
|
-
parentsUntil: function( elem,
|
3343
|
+
parentsUntil: function( elem, _i, until ) {
|
3171
3344
|
return dir( elem, "parentNode", until );
|
3172
3345
|
},
|
3173
3346
|
next: function( elem ) {
|
@@ -3182,10 +3355,10 @@ jQuery.each( {
|
|
3182
3355
|
prevAll: function( elem ) {
|
3183
3356
|
return dir( elem, "previousSibling" );
|
3184
3357
|
},
|
3185
|
-
nextUntil: function( elem,
|
3358
|
+
nextUntil: function( elem, _i, until ) {
|
3186
3359
|
return dir( elem, "nextSibling", until );
|
3187
3360
|
},
|
3188
|
-
prevUntil: function( elem,
|
3361
|
+
prevUntil: function( elem, _i, until ) {
|
3189
3362
|
return dir( elem, "previousSibling", until );
|
3190
3363
|
},
|
3191
3364
|
siblings: function( elem ) {
|
@@ -3195,18 +3368,24 @@ jQuery.each( {
|
|
3195
3368
|
return siblings( elem.firstChild );
|
3196
3369
|
},
|
3197
3370
|
contents: function( elem ) {
|
3198
|
-
|
3199
|
-
return elem.contentDocument;
|
3200
|
-
}
|
3371
|
+
if ( elem.contentDocument != null &&
|
3201
3372
|
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
3205
|
-
|
3206
|
-
elem = elem.content || elem;
|
3207
|
-
}
|
3373
|
+
// Support: IE 11+
|
3374
|
+
// <object> elements with no `data` attribute has an object
|
3375
|
+
// `contentDocument` with a `null` prototype.
|
3376
|
+
getProto( elem.contentDocument ) ) {
|
3208
3377
|
|
3209
|
-
|
3378
|
+
return elem.contentDocument;
|
3379
|
+
}
|
3380
|
+
|
3381
|
+
// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
|
3382
|
+
// Treat the template element as a regular one in browsers that
|
3383
|
+
// don't support it.
|
3384
|
+
if ( nodeName( elem, "template" ) ) {
|
3385
|
+
elem = elem.content || elem;
|
3386
|
+
}
|
3387
|
+
|
3388
|
+
return jQuery.merge( [], elem.childNodes );
|
3210
3389
|
}
|
3211
3390
|
}, function( name, fn ) {
|
3212
3391
|
jQuery.fn[ name ] = function( until, selector ) {
|
@@ -3360,11 +3539,11 @@ jQuery.Callbacks = function( options ) {
|
|
3360
3539
|
|
3361
3540
|
( function add( args ) {
|
3362
3541
|
jQuery.each( args, function( _, arg ) {
|
3363
|
-
if (
|
3542
|
+
if ( isFunction( arg ) ) {
|
3364
3543
|
if ( !options.unique || !self.has( arg ) ) {
|
3365
3544
|
list.push( arg );
|
3366
3545
|
}
|
3367
|
-
} else if ( arg && arg.length &&
|
3546
|
+
} else if ( arg && arg.length && toType( arg ) !== "string" ) {
|
3368
3547
|
|
3369
3548
|
// Inspect recursively
|
3370
3549
|
add( arg );
|
@@ -3479,11 +3658,11 @@ function adoptValue( value, resolve, reject, noValue ) {
|
|
3479
3658
|
try {
|
3480
3659
|
|
3481
3660
|
// Check for promise aspect first to privilege synchronous behavior
|
3482
|
-
if ( value &&
|
3661
|
+
if ( value && isFunction( ( method = value.promise ) ) ) {
|
3483
3662
|
method.call( value ).done( resolve ).fail( reject );
|
3484
3663
|
|
3485
3664
|
// Other thenables
|
3486
|
-
} else if ( value &&
|
3665
|
+
} else if ( value && isFunction( ( method = value.then ) ) ) {
|
3487
3666
|
method.call( value, resolve, reject );
|
3488
3667
|
|
3489
3668
|
// Other non-thenables
|
@@ -3538,17 +3717,17 @@ jQuery.extend( {
|
|
3538
3717
|
var fns = arguments;
|
3539
3718
|
|
3540
3719
|
return jQuery.Deferred( function( newDefer ) {
|
3541
|
-
jQuery.each( tuples, function(
|
3720
|
+
jQuery.each( tuples, function( _i, tuple ) {
|
3542
3721
|
|
3543
3722
|
// Map tuples (progress, done, fail) to arguments (done, fail, progress)
|
3544
|
-
var fn =
|
3723
|
+
var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
|
3545
3724
|
|
3546
3725
|
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
3547
3726
|
// deferred.done(function() { bind to newDefer or newDefer.resolve })
|
3548
3727
|
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
3549
3728
|
deferred[ tuple[ 1 ] ]( function() {
|
3550
3729
|
var returned = fn && fn.apply( this, arguments );
|
3551
|
-
if ( returned &&
|
3730
|
+
if ( returned && isFunction( returned.promise ) ) {
|
3552
3731
|
returned.promise()
|
3553
3732
|
.progress( newDefer.notify )
|
3554
3733
|
.done( newDefer.resolve )
|
@@ -3602,7 +3781,7 @@ jQuery.extend( {
|
|
3602
3781
|
returned.then;
|
3603
3782
|
|
3604
3783
|
// Handle a returned thenable
|
3605
|
-
if (
|
3784
|
+
if ( isFunction( then ) ) {
|
3606
3785
|
|
3607
3786
|
// Special processors (notify) just wait for resolution
|
3608
3787
|
if ( special ) {
|
@@ -3698,7 +3877,7 @@ jQuery.extend( {
|
|
3698
3877
|
resolve(
|
3699
3878
|
0,
|
3700
3879
|
newDefer,
|
3701
|
-
|
3880
|
+
isFunction( onProgress ) ?
|
3702
3881
|
onProgress :
|
3703
3882
|
Identity,
|
3704
3883
|
newDefer.notifyWith
|
@@ -3710,7 +3889,7 @@ jQuery.extend( {
|
|
3710
3889
|
resolve(
|
3711
3890
|
0,
|
3712
3891
|
newDefer,
|
3713
|
-
|
3892
|
+
isFunction( onFulfilled ) ?
|
3714
3893
|
onFulfilled :
|
3715
3894
|
Identity
|
3716
3895
|
)
|
@@ -3721,7 +3900,7 @@ jQuery.extend( {
|
|
3721
3900
|
resolve(
|
3722
3901
|
0,
|
3723
3902
|
newDefer,
|
3724
|
-
|
3903
|
+
isFunction( onRejected ) ?
|
3725
3904
|
onRejected :
|
3726
3905
|
Thrower
|
3727
3906
|
)
|
@@ -3761,8 +3940,15 @@ jQuery.extend( {
|
|
3761
3940
|
// fulfilled_callbacks.disable
|
3762
3941
|
tuples[ 3 - i ][ 2 ].disable,
|
3763
3942
|
|
3943
|
+
// rejected_handlers.disable
|
3944
|
+
// fulfilled_handlers.disable
|
3945
|
+
tuples[ 3 - i ][ 3 ].disable,
|
3946
|
+
|
3764
3947
|
// progress_callbacks.lock
|
3765
|
-
tuples[ 0 ][ 2 ].lock
|
3948
|
+
tuples[ 0 ][ 2 ].lock,
|
3949
|
+
|
3950
|
+
// progress_handlers.lock
|
3951
|
+
tuples[ 0 ][ 3 ].lock
|
3766
3952
|
);
|
3767
3953
|
}
|
3768
3954
|
|
@@ -3832,7 +4018,7 @@ jQuery.extend( {
|
|
3832
4018
|
|
3833
4019
|
// Use .then() to unwrap secondary thenables (cf. gh-3000)
|
3834
4020
|
if ( master.state() === "pending" ||
|
3835
|
-
|
4021
|
+
isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
|
3836
4022
|
|
3837
4023
|
return master.then();
|
3838
4024
|
}
|
@@ -3960,7 +4146,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|
3960
4146
|
bulk = key == null;
|
3961
4147
|
|
3962
4148
|
// Sets many values
|
3963
|
-
if (
|
4149
|
+
if ( toType( key ) === "object" ) {
|
3964
4150
|
chainable = true;
|
3965
4151
|
for ( i in key ) {
|
3966
4152
|
access( elems, fn, i, key[ i ], true, emptyGet, raw );
|
@@ -3970,7 +4156,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|
3970
4156
|
} else if ( value !== undefined ) {
|
3971
4157
|
chainable = true;
|
3972
4158
|
|
3973
|
-
if ( !
|
4159
|
+
if ( !isFunction( value ) ) {
|
3974
4160
|
raw = true;
|
3975
4161
|
}
|
3976
4162
|
|
@@ -3984,7 +4170,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|
3984
4170
|
// ...except when executing function values
|
3985
4171
|
} else {
|
3986
4172
|
bulk = fn;
|
3987
|
-
fn = function( elem,
|
4173
|
+
fn = function( elem, _key, value ) {
|
3988
4174
|
return bulk.call( jQuery( elem ), value );
|
3989
4175
|
};
|
3990
4176
|
}
|
@@ -4012,6 +4198,23 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|
4012
4198
|
|
4013
4199
|
return len ? fn( elems[ 0 ], key ) : emptyGet;
|
4014
4200
|
};
|
4201
|
+
|
4202
|
+
|
4203
|
+
// Matches dashed string for camelizing
|
4204
|
+
var rmsPrefix = /^-ms-/,
|
4205
|
+
rdashAlpha = /-([a-z])/g;
|
4206
|
+
|
4207
|
+
// Used by camelCase as callback to replace()
|
4208
|
+
function fcamelCase( _all, letter ) {
|
4209
|
+
return letter.toUpperCase();
|
4210
|
+
}
|
4211
|
+
|
4212
|
+
// Convert dashed to camelCase; used by the css and data modules
|
4213
|
+
// Support: IE <=9 - 11, Edge 12 - 15
|
4214
|
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
4215
|
+
function camelCase( string ) {
|
4216
|
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
4217
|
+
}
|
4015
4218
|
var acceptData = function( owner ) {
|
4016
4219
|
|
4017
4220
|
// Accepts only:
|
@@ -4074,14 +4277,14 @@ Data.prototype = {
|
|
4074
4277
|
// Handle: [ owner, key, value ] args
|
4075
4278
|
// Always use camelCase key (gh-2257)
|
4076
4279
|
if ( typeof data === "string" ) {
|
4077
|
-
cache[
|
4280
|
+
cache[ camelCase( data ) ] = value;
|
4078
4281
|
|
4079
4282
|
// Handle: [ owner, { properties } ] args
|
4080
4283
|
} else {
|
4081
4284
|
|
4082
4285
|
// Copy the properties one-by-one to the cache object
|
4083
4286
|
for ( prop in data ) {
|
4084
|
-
cache[
|
4287
|
+
cache[ camelCase( prop ) ] = data[ prop ];
|
4085
4288
|
}
|
4086
4289
|
}
|
4087
4290
|
return cache;
|
@@ -4091,7 +4294,7 @@ Data.prototype = {
|
|
4091
4294
|
this.cache( owner ) :
|
4092
4295
|
|
4093
4296
|
// Always use camelCase key (gh-2257)
|
4094
|
-
owner[ this.expando ] && owner[ this.expando ][
|
4297
|
+
owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
|
4095
4298
|
},
|
4096
4299
|
access: function( owner, key, value ) {
|
4097
4300
|
|
@@ -4139,9 +4342,9 @@ Data.prototype = {
|
|
4139
4342
|
|
4140
4343
|
// If key is an array of keys...
|
4141
4344
|
// We always set camelCase keys, so remove that.
|
4142
|
-
key = key.map(
|
4345
|
+
key = key.map( camelCase );
|
4143
4346
|
} else {
|
4144
|
-
key =
|
4347
|
+
key = camelCase( key );
|
4145
4348
|
|
4146
4349
|
// If a key with the spaces exists, use it.
|
4147
4350
|
// Otherwise, create an array by matching non-whitespace
|
@@ -4287,7 +4490,7 @@ jQuery.fn.extend( {
|
|
4287
4490
|
if ( attrs[ i ] ) {
|
4288
4491
|
name = attrs[ i ].name;
|
4289
4492
|
if ( name.indexOf( "data-" ) === 0 ) {
|
4290
|
-
name =
|
4493
|
+
name = camelCase( name.slice( 5 ) );
|
4291
4494
|
dataAttr( elem, name, data[ name ] );
|
4292
4495
|
}
|
4293
4496
|
}
|
@@ -4491,6 +4694,26 @@ var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
|
|
4491
4694
|
|
4492
4695
|
var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
|
4493
4696
|
|
4697
|
+
var documentElement = document.documentElement;
|
4698
|
+
|
4699
|
+
|
4700
|
+
|
4701
|
+
var isAttached = function( elem ) {
|
4702
|
+
return jQuery.contains( elem.ownerDocument, elem );
|
4703
|
+
},
|
4704
|
+
composed = { composed: true };
|
4705
|
+
|
4706
|
+
// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
|
4707
|
+
// Check attachment across shadow DOM boundaries when possible (gh-3504)
|
4708
|
+
// Support: iOS 10.0-10.2 only
|
4709
|
+
// Early iOS 10 versions support `attachShadow` but not `getRootNode`,
|
4710
|
+
// leading to errors. We need to check for `getRootNode`.
|
4711
|
+
if ( documentElement.getRootNode ) {
|
4712
|
+
isAttached = function( elem ) {
|
4713
|
+
return jQuery.contains( elem.ownerDocument, elem ) ||
|
4714
|
+
elem.getRootNode( composed ) === elem.ownerDocument;
|
4715
|
+
};
|
4716
|
+
}
|
4494
4717
|
var isHiddenWithinTree = function( elem, el ) {
|
4495
4718
|
|
4496
4719
|
// isHiddenWithinTree might be called from jQuery#filter function;
|
@@ -4505,37 +4728,15 @@ var isHiddenWithinTree = function( elem, el ) {
|
|
4505
4728
|
// Support: Firefox <=43 - 45
|
4506
4729
|
// Disconnected elements can have computed display: none, so first confirm that elem is
|
4507
4730
|
// in the document.
|
4508
|
-
|
4731
|
+
isAttached( elem ) &&
|
4509
4732
|
|
4510
4733
|
jQuery.css( elem, "display" ) === "none";
|
4511
4734
|
};
|
4512
4735
|
|
4513
|
-
var swap = function( elem, options, callback, args ) {
|
4514
|
-
var ret, name,
|
4515
|
-
old = {};
|
4516
|
-
|
4517
|
-
// Remember the old values, and insert the new ones
|
4518
|
-
for ( name in options ) {
|
4519
|
-
old[ name ] = elem.style[ name ];
|
4520
|
-
elem.style[ name ] = options[ name ];
|
4521
|
-
}
|
4522
|
-
|
4523
|
-
ret = callback.apply( elem, args || [] );
|
4524
|
-
|
4525
|
-
// Revert the old values
|
4526
|
-
for ( name in options ) {
|
4527
|
-
elem.style[ name ] = old[ name ];
|
4528
|
-
}
|
4529
|
-
|
4530
|
-
return ret;
|
4531
|
-
};
|
4532
|
-
|
4533
|
-
|
4534
4736
|
|
4535
4737
|
|
4536
4738
|
function adjustCSS( elem, prop, valueParts, tween ) {
|
4537
|
-
var adjusted,
|
4538
|
-
scale = 1,
|
4739
|
+
var adjusted, scale,
|
4539
4740
|
maxIterations = 20,
|
4540
4741
|
currentValue = tween ?
|
4541
4742
|
function() {
|
@@ -4548,35 +4749,39 @@ function adjustCSS( elem, prop, valueParts, tween ) {
|
|
4548
4749
|
unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
|
4549
4750
|
|
4550
4751
|
// Starting value computation is required for potential unit mismatches
|
4551
|
-
initialInUnit =
|
4752
|
+
initialInUnit = elem.nodeType &&
|
4753
|
+
( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
|
4552
4754
|
rcssNum.exec( jQuery.css( elem, prop ) );
|
4553
4755
|
|
4554
4756
|
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
|
4555
4757
|
|
4758
|
+
// Support: Firefox <=54
|
4759
|
+
// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
|
4760
|
+
initial = initial / 2;
|
4761
|
+
|
4556
4762
|
// Trust units reported by jQuery.css
|
4557
4763
|
unit = unit || initialInUnit[ 3 ];
|
4558
4764
|
|
4559
|
-
// Make sure we update the tween properties later on
|
4560
|
-
valueParts = valueParts || [];
|
4561
|
-
|
4562
4765
|
// Iteratively approximate from a nonzero starting point
|
4563
4766
|
initialInUnit = +initial || 1;
|
4564
4767
|
|
4565
|
-
|
4566
|
-
|
4567
|
-
// If previous iteration zeroed out, double until we get *something*.
|
4568
|
-
// Use string for doubling so we don't accidentally see scale as unchanged below
|
4569
|
-
scale = scale || ".5";
|
4768
|
+
while ( maxIterations-- ) {
|
4570
4769
|
|
4571
|
-
//
|
4572
|
-
|
4770
|
+
// Evaluate and update our best guess (doubling guesses that zero out).
|
4771
|
+
// Finish if the scale equals or crosses 1 (making the old*new product non-positive).
|
4573
4772
|
jQuery.style( elem, prop, initialInUnit + unit );
|
4773
|
+
if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
|
4774
|
+
maxIterations = 0;
|
4775
|
+
}
|
4776
|
+
initialInUnit = initialInUnit / scale;
|
4574
4777
|
|
4575
|
-
|
4576
|
-
|
4577
|
-
|
4578
|
-
|
4579
|
-
|
4778
|
+
}
|
4779
|
+
|
4780
|
+
initialInUnit = initialInUnit * 2;
|
4781
|
+
jQuery.style( elem, prop, initialInUnit + unit );
|
4782
|
+
|
4783
|
+
// Make sure we update the tween properties later on
|
4784
|
+
valueParts = valueParts || [];
|
4580
4785
|
}
|
4581
4786
|
|
4582
4787
|
if ( valueParts ) {
|
@@ -4692,17 +4897,46 @@ jQuery.fn.extend( {
|
|
4692
4897
|
} );
|
4693
4898
|
var rcheckableType = ( /^(?:checkbox|radio)$/i );
|
4694
4899
|
|
4695
|
-
var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]
|
4900
|
+
var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
|
4696
4901
|
|
4697
|
-
var rscriptType = (
|
4902
|
+
var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
|
4698
4903
|
|
4699
4904
|
|
4700
4905
|
|
4701
|
-
|
4702
|
-
var
|
4906
|
+
( function() {
|
4907
|
+
var fragment = document.createDocumentFragment(),
|
4908
|
+
div = fragment.appendChild( document.createElement( "div" ) ),
|
4909
|
+
input = document.createElement( "input" );
|
4910
|
+
|
4911
|
+
// Support: Android 4.0 - 4.3 only
|
4912
|
+
// Check state lost if the name is set (#11217)
|
4913
|
+
// Support: Windows Web Apps (WWA)
|
4914
|
+
// `name` and `type` must use .setAttribute for WWA (#14901)
|
4915
|
+
input.setAttribute( "type", "radio" );
|
4916
|
+
input.setAttribute( "checked", "checked" );
|
4917
|
+
input.setAttribute( "name", "t" );
|
4918
|
+
|
4919
|
+
div.appendChild( input );
|
4920
|
+
|
4921
|
+
// Support: Android <=4.1 only
|
4922
|
+
// Older WebKit doesn't clone checked state correctly in fragments
|
4923
|
+
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
4924
|
+
|
4925
|
+
// Support: IE <=11 only
|
4926
|
+
// Make sure textarea (and checkbox) defaultValue is properly cloned
|
4927
|
+
div.innerHTML = "<textarea>x</textarea>";
|
4928
|
+
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
|
4703
4929
|
|
4704
4930
|
// Support: IE <=9 only
|
4705
|
-
|
4931
|
+
// IE <=9 replaces <option> tags with their contents when inserted outside of
|
4932
|
+
// the select element.
|
4933
|
+
div.innerHTML = "<option></option>";
|
4934
|
+
support.option = !!div.lastChild;
|
4935
|
+
} )();
|
4936
|
+
|
4937
|
+
|
4938
|
+
// We have to close these tags to support XHTML (#13200)
|
4939
|
+
var wrapMap = {
|
4706
4940
|
|
4707
4941
|
// XHTML parsers do not magically insert elements in the
|
4708
4942
|
// same way that tag soup parsers do. So we cannot shorten
|
@@ -4715,12 +4949,14 @@ var wrapMap = {
|
|
4715
4949
|
_default: [ 0, "", "" ]
|
4716
4950
|
};
|
4717
4951
|
|
4718
|
-
// Support: IE <=9 only
|
4719
|
-
wrapMap.optgroup = wrapMap.option;
|
4720
|
-
|
4721
4952
|
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
4722
4953
|
wrapMap.th = wrapMap.td;
|
4723
4954
|
|
4955
|
+
// Support: IE <=9 only
|
4956
|
+
if ( !support.option ) {
|
4957
|
+
wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
|
4958
|
+
}
|
4959
|
+
|
4724
4960
|
|
4725
4961
|
function getAll( context, tag ) {
|
4726
4962
|
|
@@ -4764,7 +5000,7 @@ function setGlobalEval( elems, refElements ) {
|
|
4764
5000
|
var rhtml = /<|&#?\w+;/;
|
4765
5001
|
|
4766
5002
|
function buildFragment( elems, context, scripts, selection, ignored ) {
|
4767
|
-
var elem, tmp, tag, wrap,
|
5003
|
+
var elem, tmp, tag, wrap, attached, j,
|
4768
5004
|
fragment = context.createDocumentFragment(),
|
4769
5005
|
nodes = [],
|
4770
5006
|
i = 0,
|
@@ -4776,7 +5012,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
|
4776
5012
|
if ( elem || elem === 0 ) {
|
4777
5013
|
|
4778
5014
|
// Add nodes directly
|
4779
|
-
if (
|
5015
|
+
if ( toType( elem ) === "object" ) {
|
4780
5016
|
|
4781
5017
|
// Support: Android <=4.0 only, PhantomJS 1 only
|
4782
5018
|
// push.apply(_, arraylike) throws on ancient WebKit
|
@@ -4828,13 +5064,13 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
|
4828
5064
|
continue;
|
4829
5065
|
}
|
4830
5066
|
|
4831
|
-
|
5067
|
+
attached = isAttached( elem );
|
4832
5068
|
|
4833
5069
|
// Append to fragment
|
4834
5070
|
tmp = getAll( fragment.appendChild( elem ), "script" );
|
4835
5071
|
|
4836
5072
|
// Preserve script evaluation history
|
4837
|
-
if (
|
5073
|
+
if ( attached ) {
|
4838
5074
|
setGlobalEval( tmp );
|
4839
5075
|
}
|
4840
5076
|
|
@@ -4853,34 +5089,6 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
|
4853
5089
|
}
|
4854
5090
|
|
4855
5091
|
|
4856
|
-
( function() {
|
4857
|
-
var fragment = document.createDocumentFragment(),
|
4858
|
-
div = fragment.appendChild( document.createElement( "div" ) ),
|
4859
|
-
input = document.createElement( "input" );
|
4860
|
-
|
4861
|
-
// Support: Android 4.0 - 4.3 only
|
4862
|
-
// Check state lost if the name is set (#11217)
|
4863
|
-
// Support: Windows Web Apps (WWA)
|
4864
|
-
// `name` and `type` must use .setAttribute for WWA (#14901)
|
4865
|
-
input.setAttribute( "type", "radio" );
|
4866
|
-
input.setAttribute( "checked", "checked" );
|
4867
|
-
input.setAttribute( "name", "t" );
|
4868
|
-
|
4869
|
-
div.appendChild( input );
|
4870
|
-
|
4871
|
-
// Support: Android <=4.1 only
|
4872
|
-
// Older WebKit doesn't clone checked state correctly in fragments
|
4873
|
-
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
4874
|
-
|
4875
|
-
// Support: IE <=11 only
|
4876
|
-
// Make sure textarea (and checkbox) defaultValue is properly cloned
|
4877
|
-
div.innerHTML = "<textarea>x</textarea>";
|
4878
|
-
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
|
4879
|
-
} )();
|
4880
|
-
var documentElement = document.documentElement;
|
4881
|
-
|
4882
|
-
|
4883
|
-
|
4884
5092
|
var
|
4885
5093
|
rkeyEvent = /^key/,
|
4886
5094
|
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
|
@@ -4894,8 +5102,19 @@ function returnFalse() {
|
|
4894
5102
|
return false;
|
4895
5103
|
}
|
4896
5104
|
|
5105
|
+
// Support: IE <=9 - 11+
|
5106
|
+
// focus() and blur() are asynchronous, except when they are no-op.
|
5107
|
+
// So expect focus to be synchronous when the element is already active,
|
5108
|
+
// and blur to be synchronous when the element is not already active.
|
5109
|
+
// (focus and blur are always synchronous in other supported browsers,
|
5110
|
+
// this just defines when we can count on it).
|
5111
|
+
function expectSync( elem, type ) {
|
5112
|
+
return ( elem === safeActiveElement() ) === ( type === "focus" );
|
5113
|
+
}
|
5114
|
+
|
4897
5115
|
// Support: IE <=9 only
|
4898
|
-
//
|
5116
|
+
// Accessing document.activeElement can throw unexpectedly
|
5117
|
+
// https://bugs.jquery.com/ticket/13393
|
4899
5118
|
function safeActiveElement() {
|
4900
5119
|
try {
|
4901
5120
|
return document.activeElement;
|
@@ -4978,8 +5197,8 @@ jQuery.event = {
|
|
4978
5197
|
special, handlers, type, namespaces, origType,
|
4979
5198
|
elemData = dataPriv.get( elem );
|
4980
5199
|
|
4981
|
-
//
|
4982
|
-
if ( !
|
5200
|
+
// Only attach events to objects that accept data
|
5201
|
+
if ( !acceptData( elem ) ) {
|
4983
5202
|
return;
|
4984
5203
|
}
|
4985
5204
|
|
@@ -5003,7 +5222,7 @@ jQuery.event = {
|
|
5003
5222
|
|
5004
5223
|
// Init the element's event structure and main handler, if this is the first
|
5005
5224
|
if ( !( events = elemData.events ) ) {
|
5006
|
-
events = elemData.events =
|
5225
|
+
events = elemData.events = Object.create( null );
|
5007
5226
|
}
|
5008
5227
|
if ( !( eventHandle = elemData.handle ) ) {
|
5009
5228
|
eventHandle = elemData.handle = function( e ) {
|
@@ -5161,12 +5380,15 @@ jQuery.event = {
|
|
5161
5380
|
|
5162
5381
|
dispatch: function( nativeEvent ) {
|
5163
5382
|
|
5164
|
-
// Make a writable jQuery.Event from the native event object
|
5165
|
-
var event = jQuery.event.fix( nativeEvent );
|
5166
|
-
|
5167
5383
|
var i, j, ret, matched, handleObj, handlerQueue,
|
5168
5384
|
args = new Array( arguments.length ),
|
5169
|
-
|
5385
|
+
|
5386
|
+
// Make a writable jQuery.Event from the native event object
|
5387
|
+
event = jQuery.event.fix( nativeEvent ),
|
5388
|
+
|
5389
|
+
handlers = (
|
5390
|
+
dataPriv.get( this, "events" ) || Object.create( null )
|
5391
|
+
)[ event.type ] || [],
|
5170
5392
|
special = jQuery.event.special[ event.type ] || {};
|
5171
5393
|
|
5172
5394
|
// Use the fix-ed jQuery.Event rather than the (read-only) native event
|
@@ -5195,9 +5417,10 @@ jQuery.event = {
|
|
5195
5417
|
while ( ( handleObj = matched.handlers[ j++ ] ) &&
|
5196
5418
|
!event.isImmediatePropagationStopped() ) {
|
5197
5419
|
|
5198
|
-
//
|
5199
|
-
//
|
5200
|
-
if ( !event.rnamespace ||
|
5420
|
+
// If the event is namespaced, then each handler is only invoked if it is
|
5421
|
+
// specially universal or its namespaces are a superset of the event's.
|
5422
|
+
if ( !event.rnamespace || handleObj.namespace === false ||
|
5423
|
+
event.rnamespace.test( handleObj.namespace ) ) {
|
5201
5424
|
|
5202
5425
|
event.handleObj = handleObj;
|
5203
5426
|
event.data = handleObj.data;
|
@@ -5286,7 +5509,7 @@ jQuery.event = {
|
|
5286
5509
|
enumerable: true,
|
5287
5510
|
configurable: true,
|
5288
5511
|
|
5289
|
-
get:
|
5512
|
+
get: isFunction( hook ) ?
|
5290
5513
|
function() {
|
5291
5514
|
if ( this.originalEvent ) {
|
5292
5515
|
return hook( this.originalEvent );
|
@@ -5321,39 +5544,51 @@ jQuery.event = {
|
|
5321
5544
|
// Prevent triggered image.load events from bubbling to window.load
|
5322
5545
|
noBubble: true
|
5323
5546
|
},
|
5324
|
-
|
5547
|
+
click: {
|
5325
5548
|
|
5326
|
-
//
|
5327
|
-
|
5328
|
-
|
5329
|
-
|
5330
|
-
|
5331
|
-
|
5332
|
-
|
5333
|
-
|
5334
|
-
|
5335
|
-
|
5336
|
-
|
5337
|
-
|
5338
|
-
|
5339
|
-
return false;
|
5549
|
+
// Utilize native event to ensure correct state for checkable inputs
|
5550
|
+
setup: function( data ) {
|
5551
|
+
|
5552
|
+
// For mutual compressibility with _default, replace `this` access with a local var.
|
5553
|
+
// `|| data` is dead code meant only to preserve the variable through minification.
|
5554
|
+
var el = this || data;
|
5555
|
+
|
5556
|
+
// Claim the first handler
|
5557
|
+
if ( rcheckableType.test( el.type ) &&
|
5558
|
+
el.click && nodeName( el, "input" ) ) {
|
5559
|
+
|
5560
|
+
// dataPriv.set( el, "click", ... )
|
5561
|
+
leverageNative( el, "click", returnTrue );
|
5340
5562
|
}
|
5563
|
+
|
5564
|
+
// Return false to allow normal processing in the caller
|
5565
|
+
return false;
|
5341
5566
|
},
|
5342
|
-
|
5343
|
-
},
|
5344
|
-
click: {
|
5567
|
+
trigger: function( data ) {
|
5345
5568
|
|
5346
|
-
|
5347
|
-
|
5348
|
-
|
5349
|
-
|
5350
|
-
|
5569
|
+
// For mutual compressibility with _default, replace `this` access with a local var.
|
5570
|
+
// `|| data` is dead code meant only to preserve the variable through minification.
|
5571
|
+
var el = this || data;
|
5572
|
+
|
5573
|
+
// Force setup before triggering a click
|
5574
|
+
if ( rcheckableType.test( el.type ) &&
|
5575
|
+
el.click && nodeName( el, "input" ) ) {
|
5576
|
+
|
5577
|
+
leverageNative( el, "click" );
|
5351
5578
|
}
|
5579
|
+
|
5580
|
+
// Return non-false to allow normal event-path propagation
|
5581
|
+
return true;
|
5352
5582
|
},
|
5353
5583
|
|
5354
|
-
// For cross-browser consistency,
|
5584
|
+
// For cross-browser consistency, suppress native .click() on links
|
5585
|
+
// Also prevent it if we're currently inside a leveraged native-event stack
|
5355
5586
|
_default: function( event ) {
|
5356
|
-
|
5587
|
+
var target = event.target;
|
5588
|
+
return rcheckableType.test( target.type ) &&
|
5589
|
+
target.click && nodeName( target, "input" ) &&
|
5590
|
+
dataPriv.get( target, "click" ) ||
|
5591
|
+
nodeName( target, "a" );
|
5357
5592
|
}
|
5358
5593
|
},
|
5359
5594
|
|
@@ -5367,8 +5602,95 @@ jQuery.event = {
|
|
5367
5602
|
}
|
5368
5603
|
}
|
5369
5604
|
}
|
5370
|
-
}
|
5371
|
-
};
|
5605
|
+
}
|
5606
|
+
};
|
5607
|
+
|
5608
|
+
// Ensure the presence of an event listener that handles manually-triggered
|
5609
|
+
// synthetic events by interrupting progress until reinvoked in response to
|
5610
|
+
// *native* events that it fires directly, ensuring that state changes have
|
5611
|
+
// already occurred before other listeners are invoked.
|
5612
|
+
function leverageNative( el, type, expectSync ) {
|
5613
|
+
|
5614
|
+
// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
|
5615
|
+
if ( !expectSync ) {
|
5616
|
+
if ( dataPriv.get( el, type ) === undefined ) {
|
5617
|
+
jQuery.event.add( el, type, returnTrue );
|
5618
|
+
}
|
5619
|
+
return;
|
5620
|
+
}
|
5621
|
+
|
5622
|
+
// Register the controller as a special universal handler for all event namespaces
|
5623
|
+
dataPriv.set( el, type, false );
|
5624
|
+
jQuery.event.add( el, type, {
|
5625
|
+
namespace: false,
|
5626
|
+
handler: function( event ) {
|
5627
|
+
var notAsync, result,
|
5628
|
+
saved = dataPriv.get( this, type );
|
5629
|
+
|
5630
|
+
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
|
5631
|
+
|
5632
|
+
// Interrupt processing of the outer synthetic .trigger()ed event
|
5633
|
+
// Saved data should be false in such cases, but might be a leftover capture object
|
5634
|
+
// from an async native handler (gh-4350)
|
5635
|
+
if ( !saved.length ) {
|
5636
|
+
|
5637
|
+
// Store arguments for use when handling the inner native event
|
5638
|
+
// There will always be at least one argument (an event object), so this array
|
5639
|
+
// will not be confused with a leftover capture object.
|
5640
|
+
saved = slice.call( arguments );
|
5641
|
+
dataPriv.set( this, type, saved );
|
5642
|
+
|
5643
|
+
// Trigger the native event and capture its result
|
5644
|
+
// Support: IE <=9 - 11+
|
5645
|
+
// focus() and blur() are asynchronous
|
5646
|
+
notAsync = expectSync( this, type );
|
5647
|
+
this[ type ]();
|
5648
|
+
result = dataPriv.get( this, type );
|
5649
|
+
if ( saved !== result || notAsync ) {
|
5650
|
+
dataPriv.set( this, type, false );
|
5651
|
+
} else {
|
5652
|
+
result = {};
|
5653
|
+
}
|
5654
|
+
if ( saved !== result ) {
|
5655
|
+
|
5656
|
+
// Cancel the outer synthetic event
|
5657
|
+
event.stopImmediatePropagation();
|
5658
|
+
event.preventDefault();
|
5659
|
+
return result.value;
|
5660
|
+
}
|
5661
|
+
|
5662
|
+
// If this is an inner synthetic event for an event with a bubbling surrogate
|
5663
|
+
// (focus or blur), assume that the surrogate already propagated from triggering the
|
5664
|
+
// native event and prevent that from happening again here.
|
5665
|
+
// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
|
5666
|
+
// bubbling surrogate propagates *after* the non-bubbling base), but that seems
|
5667
|
+
// less bad than duplication.
|
5668
|
+
} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
|
5669
|
+
event.stopPropagation();
|
5670
|
+
}
|
5671
|
+
|
5672
|
+
// If this is a native event triggered above, everything is now in order
|
5673
|
+
// Fire an inner synthetic event with the original arguments
|
5674
|
+
} else if ( saved.length ) {
|
5675
|
+
|
5676
|
+
// ...and capture the result
|
5677
|
+
dataPriv.set( this, type, {
|
5678
|
+
value: jQuery.event.trigger(
|
5679
|
+
|
5680
|
+
// Support: IE <=9 - 11+
|
5681
|
+
// Extend with the prototype to reset the above stopImmediatePropagation()
|
5682
|
+
jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
|
5683
|
+
saved.slice( 1 ),
|
5684
|
+
this
|
5685
|
+
)
|
5686
|
+
} );
|
5687
|
+
|
5688
|
+
// Abort handling of the native event
|
5689
|
+
event.stopImmediatePropagation();
|
5690
|
+
}
|
5691
|
+
}
|
5692
|
+
} );
|
5693
|
+
}
|
5372
5694
|
|
5373
5695
|
jQuery.removeEvent = function( elem, type, handle ) {
|
5374
5696
|
|
@@ -5421,7 +5743,7 @@ jQuery.Event = function( src, props ) {
|
|
5421
5743
|
}
|
5422
5744
|
|
5423
5745
|
// Create a timestamp if incoming event doesn't have one
|
5424
|
-
this.timeStamp = src && src.timeStamp ||
|
5746
|
+
this.timeStamp = src && src.timeStamp || Date.now();
|
5425
5747
|
|
5426
5748
|
// Mark it as fixed
|
5427
5749
|
this[ jQuery.expando ] = true;
|
@@ -5482,6 +5804,7 @@ jQuery.each( {
|
|
5482
5804
|
shiftKey: true,
|
5483
5805
|
view: true,
|
5484
5806
|
"char": true,
|
5807
|
+
code: true,
|
5485
5808
|
charCode: true,
|
5486
5809
|
key: true,
|
5487
5810
|
keyCode: true,
|
@@ -5528,6 +5851,33 @@ jQuery.each( {
|
|
5528
5851
|
}
|
5529
5852
|
}, jQuery.event.addProp );
|
5530
5853
|
|
5854
|
+
jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
|
5855
|
+
jQuery.event.special[ type ] = {
|
5856
|
+
|
5857
|
+
// Utilize native event if possible so blur/focus sequence is correct
|
5858
|
+
setup: function() {
|
5859
|
+
|
5860
|
+
// Claim the first handler
|
5861
|
+
// dataPriv.set( this, "focus", ... )
|
5862
|
+
// dataPriv.set( this, "blur", ... )
|
5863
|
+
leverageNative( this, type, expectSync );
|
5864
|
+
|
5865
|
+
// Return false to allow normal processing in the caller
|
5866
|
+
return false;
|
5867
|
+
},
|
5868
|
+
trigger: function() {
|
5869
|
+
|
5870
|
+
// Force setup before trigger
|
5871
|
+
leverageNative( this, type );
|
5872
|
+
|
5873
|
+
// Return non-false to allow normal event-path propagation
|
5874
|
+
return true;
|
5875
|
+
},
|
5876
|
+
|
5877
|
+
delegateType: delegateType
|
5878
|
+
};
|
5879
|
+
} );
|
5880
|
+
|
5531
5881
|
// Create mouseenter/leave events using mouseover/out and event-time checks
|
5532
5882
|
// so that event delegation works in jQuery.
|
5533
5883
|
// Do the same for pointerenter/pointerleave and pointerover/pointerout
|
@@ -5613,21 +5963,13 @@ jQuery.fn.extend( {
|
|
5613
5963
|
|
5614
5964
|
var
|
5615
5965
|
|
5616
|
-
|
5617
|
-
|
5618
|
-
// See https://github.com/eslint/eslint/issues/3229
|
5619
|
-
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
|
5620
|
-
|
5621
|
-
/* eslint-enable */
|
5622
|
-
|
5623
|
-
// Support: IE <=10 - 11, Edge 12 - 13
|
5966
|
+
// Support: IE <=10 - 11, Edge 12 - 13 only
|
5624
5967
|
// In IE/Edge using regex groups here causes severe slowdowns.
|
5625
5968
|
// See https://connect.microsoft.com/IE/feedback/details/1736512/
|
5626
5969
|
rnoInnerhtml = /<script|<style|<link/i,
|
5627
5970
|
|
5628
5971
|
// checked="checked" or checked
|
5629
5972
|
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
5630
|
-
rscriptTypeMasked = /^true\/(.*)/,
|
5631
5973
|
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
|
5632
5974
|
|
5633
5975
|
// Prefer a tbody over its parent table for containing new rows
|
@@ -5635,7 +5977,7 @@ function manipulationTarget( elem, content ) {
|
|
5635
5977
|
if ( nodeName( elem, "table" ) &&
|
5636
5978
|
nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
|
5637
5979
|
|
5638
|
-
return jQuery( "
|
5980
|
+
return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
|
5639
5981
|
}
|
5640
5982
|
|
5641
5983
|
return elem;
|
@@ -5647,10 +5989,8 @@ function disableScript( elem ) {
|
|
5647
5989
|
return elem;
|
5648
5990
|
}
|
5649
5991
|
function restoreScript( elem ) {
|
5650
|
-
|
5651
|
-
|
5652
|
-
if ( match ) {
|
5653
|
-
elem.type = match[ 1 ];
|
5992
|
+
if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
|
5993
|
+
elem.type = elem.type.slice( 5 );
|
5654
5994
|
} else {
|
5655
5995
|
elem.removeAttribute( "type" );
|
5656
5996
|
}
|
@@ -5659,7 +5999,7 @@ function restoreScript( elem ) {
|
|
5659
5999
|
}
|
5660
6000
|
|
5661
6001
|
function cloneCopyEvent( src, dest ) {
|
5662
|
-
var i, l, type, pdataOld,
|
6002
|
+
var i, l, type, pdataOld, udataOld, udataCur, events;
|
5663
6003
|
|
5664
6004
|
if ( dest.nodeType !== 1 ) {
|
5665
6005
|
return;
|
@@ -5667,13 +6007,11 @@ function cloneCopyEvent( src, dest ) {
|
|
5667
6007
|
|
5668
6008
|
// 1. Copy private data: events, handlers, etc.
|
5669
6009
|
if ( dataPriv.hasData( src ) ) {
|
5670
|
-
pdataOld = dataPriv.
|
5671
|
-
pdataCur = dataPriv.set( dest, pdataOld );
|
6010
|
+
pdataOld = dataPriv.get( src );
|
5672
6011
|
events = pdataOld.events;
|
5673
6012
|
|
5674
6013
|
if ( events ) {
|
5675
|
-
|
5676
|
-
pdataCur.events = {};
|
6014
|
+
dataPriv.remove( dest, "handle events" );
|
5677
6015
|
|
5678
6016
|
for ( type in events ) {
|
5679
6017
|
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
@@ -5709,22 +6047,22 @@ function fixInput( src, dest ) {
|
|
5709
6047
|
function domManip( collection, args, callback, ignored ) {
|
5710
6048
|
|
5711
6049
|
// Flatten any nested arrays
|
5712
|
-
args =
|
6050
|
+
args = flat( args );
|
5713
6051
|
|
5714
6052
|
var fragment, first, scripts, hasScripts, node, doc,
|
5715
6053
|
i = 0,
|
5716
6054
|
l = collection.length,
|
5717
6055
|
iNoClone = l - 1,
|
5718
6056
|
value = args[ 0 ],
|
5719
|
-
|
6057
|
+
valueIsFunction = isFunction( value );
|
5720
6058
|
|
5721
6059
|
// We can't cloneNode fragments that contain checked, in WebKit
|
5722
|
-
if (
|
6060
|
+
if ( valueIsFunction ||
|
5723
6061
|
( l > 1 && typeof value === "string" &&
|
5724
6062
|
!support.checkClone && rchecked.test( value ) ) ) {
|
5725
6063
|
return collection.each( function( index ) {
|
5726
6064
|
var self = collection.eq( index );
|
5727
|
-
if (
|
6065
|
+
if ( valueIsFunction ) {
|
5728
6066
|
args[ 0 ] = value.call( this, index, self.html() );
|
5729
6067
|
}
|
5730
6068
|
domManip( self, args, callback, ignored );
|
@@ -5778,14 +6116,16 @@ function domManip( collection, args, callback, ignored ) {
|
|
5778
6116
|
!dataPriv.access( node, "globalEval" ) &&
|
5779
6117
|
jQuery.contains( doc, node ) ) {
|
5780
6118
|
|
5781
|
-
if ( node.src ) {
|
6119
|
+
if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
|
5782
6120
|
|
5783
6121
|
// Optional AJAX dependency, but won't run scripts if not present
|
5784
|
-
if ( jQuery._evalUrl ) {
|
5785
|
-
jQuery._evalUrl( node.src
|
6122
|
+
if ( jQuery._evalUrl && !node.noModule ) {
|
6123
|
+
jQuery._evalUrl( node.src, {
|
6124
|
+
nonce: node.nonce || node.getAttribute( "nonce" )
|
6125
|
+
}, doc );
|
5786
6126
|
}
|
5787
6127
|
} else {
|
5788
|
-
DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
|
6128
|
+
DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
|
5789
6129
|
}
|
5790
6130
|
}
|
5791
6131
|
}
|
@@ -5807,7 +6147,7 @@ function remove( elem, selector, keepData ) {
|
|
5807
6147
|
}
|
5808
6148
|
|
5809
6149
|
if ( node.parentNode ) {
|
5810
|
-
if ( keepData &&
|
6150
|
+
if ( keepData && isAttached( node ) ) {
|
5811
6151
|
setGlobalEval( getAll( node, "script" ) );
|
5812
6152
|
}
|
5813
6153
|
node.parentNode.removeChild( node );
|
@@ -5819,13 +6159,13 @@ function remove( elem, selector, keepData ) {
|
|
5819
6159
|
|
5820
6160
|
jQuery.extend( {
|
5821
6161
|
htmlPrefilter: function( html ) {
|
5822
|
-
return html
|
6162
|
+
return html;
|
5823
6163
|
},
|
5824
6164
|
|
5825
6165
|
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
5826
6166
|
var i, l, srcElements, destElements,
|
5827
6167
|
clone = elem.cloneNode( true ),
|
5828
|
-
inPage =
|
6168
|
+
inPage = isAttached( elem );
|
5829
6169
|
|
5830
6170
|
// Fix IE cloning issues
|
5831
6171
|
if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
|
@@ -6065,8 +6405,6 @@ jQuery.each( {
|
|
6065
6405
|
return this.pushStack( ret );
|
6066
6406
|
};
|
6067
6407
|
} );
|
6068
|
-
var rmargin = ( /^margin/ );
|
6069
|
-
|
6070
6408
|
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
|
6071
6409
|
|
6072
6410
|
var getStyles = function( elem ) {
|
@@ -6083,6 +6421,29 @@ var getStyles = function( elem ) {
|
|
6083
6421
|
return view.getComputedStyle( elem );
|
6084
6422
|
};
|
6085
6423
|
|
6424
|
+
var swap = function( elem, options, callback ) {
|
6425
|
+
var ret, name,
|
6426
|
+
old = {};
|
6427
|
+
|
6428
|
+
// Remember the old values, and insert the new ones
|
6429
|
+
for ( name in options ) {
|
6430
|
+
old[ name ] = elem.style[ name ];
|
6431
|
+
elem.style[ name ] = options[ name ];
|
6432
|
+
}
|
6433
|
+
|
6434
|
+
ret = callback.call( elem );
|
6435
|
+
|
6436
|
+
// Revert the old values
|
6437
|
+
for ( name in options ) {
|
6438
|
+
elem.style[ name ] = old[ name ];
|
6439
|
+
}
|
6440
|
+
|
6441
|
+
return ret;
|
6442
|
+
};
|
6443
|
+
|
6444
|
+
|
6445
|
+
var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
6446
|
+
|
6086
6447
|
|
6087
6448
|
|
6088
6449
|
( function() {
|
@@ -6096,25 +6457,35 @@ var getStyles = function( elem ) {
|
|
6096
6457
|
return;
|
6097
6458
|
}
|
6098
6459
|
|
6460
|
+
container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
|
6461
|
+
"margin-top:1px;padding:0;border:0";
|
6099
6462
|
div.style.cssText =
|
6100
|
-
"box-sizing:border-box;" +
|
6101
|
-
"position:relative;display:block;" +
|
6463
|
+
"position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
|
6102
6464
|
"margin:auto;border:1px;padding:1px;" +
|
6103
|
-
"top:1
|
6104
|
-
|
6105
|
-
documentElement.appendChild( container );
|
6465
|
+
"width:60%;top:1%";
|
6466
|
+
documentElement.appendChild( container ).appendChild( div );
|
6106
6467
|
|
6107
6468
|
var divStyle = window.getComputedStyle( div );
|
6108
6469
|
pixelPositionVal = divStyle.top !== "1%";
|
6109
6470
|
|
6110
6471
|
// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
|
6111
|
-
reliableMarginLeftVal = divStyle.marginLeft ===
|
6112
|
-
boxSizingReliableVal = divStyle.width === "4px";
|
6472
|
+
reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
|
6113
6473
|
|
6114
|
-
// Support: Android 4.0 - 4.3 only
|
6474
|
+
// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
|
6115
6475
|
// Some styles come back with percentage values, even though they shouldn't
|
6116
|
-
div.style.
|
6117
|
-
|
6476
|
+
div.style.right = "60%";
|
6477
|
+
pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
|
6478
|
+
|
6479
|
+
// Support: IE 9 - 11 only
|
6480
|
+
// Detect misreporting of content dimensions for box-sizing:border-box elements
|
6481
|
+
boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
|
6482
|
+
|
6483
|
+
// Support: IE 9 only
|
6484
|
+
// Detect overflow:scroll screwiness (gh-3699)
|
6485
|
+
// Support: Chrome <=64
|
6486
|
+
// Don't get tricked when zoom affects offsetWidth (gh-4029)
|
6487
|
+
div.style.position = "absolute";
|
6488
|
+
scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
|
6118
6489
|
|
6119
6490
|
documentElement.removeChild( container );
|
6120
6491
|
|
@@ -6123,7 +6494,12 @@ var getStyles = function( elem ) {
|
|
6123
6494
|
div = null;
|
6124
6495
|
}
|
6125
6496
|
|
6126
|
-
|
6497
|
+
function roundPixelMeasures( measure ) {
|
6498
|
+
return Math.round( parseFloat( measure ) );
|
6499
|
+
}
|
6500
|
+
|
6501
|
+
var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
|
6502
|
+
reliableTrDimensionsVal, reliableMarginLeftVal,
|
6127
6503
|
container = document.createElement( "div" ),
|
6128
6504
|
div = document.createElement( "div" );
|
6129
6505
|
|
@@ -6138,26 +6514,55 @@ var getStyles = function( elem ) {
|
|
6138
6514
|
div.cloneNode( true ).style.backgroundClip = "";
|
6139
6515
|
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
6140
6516
|
|
6141
|
-
container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
|
6142
|
-
"padding:0;margin-top:1px;position:absolute";
|
6143
|
-
container.appendChild( div );
|
6144
|
-
|
6145
6517
|
jQuery.extend( support, {
|
6146
|
-
pixelPosition: function() {
|
6147
|
-
computeStyleTests();
|
6148
|
-
return pixelPositionVal;
|
6149
|
-
},
|
6150
6518
|
boxSizingReliable: function() {
|
6151
6519
|
computeStyleTests();
|
6152
6520
|
return boxSizingReliableVal;
|
6153
6521
|
},
|
6154
|
-
|
6522
|
+
pixelBoxStyles: function() {
|
6155
6523
|
computeStyleTests();
|
6156
|
-
return
|
6524
|
+
return pixelBoxStylesVal;
|
6525
|
+
},
|
6526
|
+
pixelPosition: function() {
|
6527
|
+
computeStyleTests();
|
6528
|
+
return pixelPositionVal;
|
6157
6529
|
},
|
6158
6530
|
reliableMarginLeft: function() {
|
6159
6531
|
computeStyleTests();
|
6160
6532
|
return reliableMarginLeftVal;
|
6533
|
+
},
|
6534
|
+
scrollboxSize: function() {
|
6535
|
+
computeStyleTests();
|
6536
|
+
return scrollboxSizeVal;
|
6537
|
+
},
|
6538
|
+
|
6539
|
+
// Support: IE 9 - 11+, Edge 15 - 18+
|
6540
|
+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
|
6541
|
+
// set in CSS while `offset*` properties report correct values.
|
6542
|
+
// Behavior in IE 9 is more subtle than in newer versions & it passes
|
6543
|
+
// some versions of this test; make sure not to make it pass there!
|
6544
|
+
reliableTrDimensions: function() {
|
6545
|
+
var table, tr, trChild, trStyle;
|
6546
|
+
if ( reliableTrDimensionsVal == null ) {
|
6547
|
+
table = document.createElement( "table" );
|
6548
|
+
tr = document.createElement( "tr" );
|
6549
|
+
trChild = document.createElement( "div" );
|
6550
|
+
|
6551
|
+
table.style.cssText = "position:absolute;left:-11111px";
|
6552
|
+
tr.style.height = "1px";
|
6553
|
+
trChild.style.height = "9px";
|
6554
|
+
|
6555
|
+
documentElement
|
6556
|
+
.appendChild( table )
|
6557
|
+
.appendChild( tr )
|
6558
|
+
.appendChild( trChild );
|
6559
|
+
|
6560
|
+
trStyle = window.getComputedStyle( tr );
|
6561
|
+
reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
|
6562
|
+
|
6563
|
+
documentElement.removeChild( table );
|
6564
|
+
}
|
6565
|
+
return reliableTrDimensionsVal;
|
6161
6566
|
}
|
6162
6567
|
} );
|
6163
6568
|
} )();
|
@@ -6180,7 +6585,7 @@ function curCSS( elem, name, computed ) {
|
|
6180
6585
|
if ( computed ) {
|
6181
6586
|
ret = computed.getPropertyValue( name ) || computed[ name ];
|
6182
6587
|
|
6183
|
-
if ( ret === "" && !
|
6588
|
+
if ( ret === "" && !isAttached( elem ) ) {
|
6184
6589
|
ret = jQuery.style( elem, name );
|
6185
6590
|
}
|
6186
6591
|
|
@@ -6189,7 +6594,7 @@ function curCSS( elem, name, computed ) {
|
|
6189
6594
|
// but width seems to be reliably pixels.
|
6190
6595
|
// This is against the CSSOM draft spec:
|
6191
6596
|
// https://drafts.csswg.org/cssom/#resolved-values
|
6192
|
-
if ( !support.
|
6597
|
+
if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
|
6193
6598
|
|
6194
6599
|
// Remember the original values
|
6195
6600
|
width = style.width;
|
@@ -6236,30 +6641,13 @@ function addGetHookIf( conditionFn, hookFn ) {
|
|
6236
6641
|
}
|
6237
6642
|
|
6238
6643
|
|
6239
|
-
var
|
6240
|
-
|
6241
|
-
|
6242
|
-
// except "table", "table-cell", or "table-caption"
|
6243
|
-
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
6244
|
-
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
6245
|
-
rcustomProp = /^--/,
|
6246
|
-
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
6247
|
-
cssNormalTransform = {
|
6248
|
-
letterSpacing: "0",
|
6249
|
-
fontWeight: "400"
|
6250
|
-
},
|
6251
|
-
|
6252
|
-
cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
6253
|
-
emptyStyle = document.createElement( "div" ).style;
|
6644
|
+
var cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
6645
|
+
emptyStyle = document.createElement( "div" ).style,
|
6646
|
+
vendorProps = {};
|
6254
6647
|
|
6255
|
-
// Return a
|
6648
|
+
// Return a vendor-prefixed property or undefined
|
6256
6649
|
function vendorPropName( name ) {
|
6257
6650
|
|
6258
|
-
// Shortcut for names that are not vendor prefixed
|
6259
|
-
if ( name in emptyStyle ) {
|
6260
|
-
return name;
|
6261
|
-
}
|
6262
|
-
|
6263
6651
|
// Check for vendor prefixed names
|
6264
6652
|
var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
|
6265
6653
|
i = cssPrefixes.length;
|
@@ -6272,17 +6660,34 @@ function vendorPropName( name ) {
|
|
6272
6660
|
}
|
6273
6661
|
}
|
6274
6662
|
|
6275
|
-
// Return a
|
6276
|
-
// a vendor prefixed property.
|
6663
|
+
// Return a potentially-mapped jQuery.cssProps or vendor prefixed property
|
6277
6664
|
function finalPropName( name ) {
|
6278
|
-
var
|
6279
|
-
|
6280
|
-
|
6665
|
+
var final = jQuery.cssProps[ name ] || vendorProps[ name ];
|
6666
|
+
|
6667
|
+
if ( final ) {
|
6668
|
+
return final;
|
6281
6669
|
}
|
6282
|
-
|
6670
|
+
if ( name in emptyStyle ) {
|
6671
|
+
return name;
|
6672
|
+
}
|
6673
|
+
return vendorProps[ name ] = vendorPropName( name ) || name;
|
6283
6674
|
}
|
6284
6675
|
|
6285
|
-
|
6676
|
+
|
6677
|
+
var
|
6678
|
+
|
6679
|
+
// Swappable if display is none or starts with table
|
6680
|
+
// except "table", "table-cell", or "table-caption"
|
6681
|
+
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
6682
|
+
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
6683
|
+
rcustomProp = /^--/,
|
6684
|
+
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
6685
|
+
cssNormalTransform = {
|
6686
|
+
letterSpacing: "0",
|
6687
|
+
fontWeight: "400"
|
6688
|
+
};
|
6689
|
+
|
6690
|
+
function setPositiveNumber( _elem, value, subtract ) {
|
6286
6691
|
|
6287
6692
|
// Any relative (+/-) values have already been
|
6288
6693
|
// normalized at this point
|
@@ -6294,87 +6699,146 @@ function setPositiveNumber( elem, value, subtract ) {
|
|
6294
6699
|
value;
|
6295
6700
|
}
|
6296
6701
|
|
6297
|
-
function
|
6298
|
-
var i,
|
6299
|
-
|
6300
|
-
|
6301
|
-
// If we already have the right measurement, avoid augmentation
|
6302
|
-
if ( extra === ( isBorderBox ? "border" : "content" ) ) {
|
6303
|
-
i = 4;
|
6702
|
+
function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
|
6703
|
+
var i = dimension === "width" ? 1 : 0,
|
6704
|
+
extra = 0,
|
6705
|
+
delta = 0;
|
6304
6706
|
|
6305
|
-
//
|
6306
|
-
|
6307
|
-
|
6707
|
+
// Adjustment may not be necessary
|
6708
|
+
if ( box === ( isBorderBox ? "border" : "content" ) ) {
|
6709
|
+
return 0;
|
6308
6710
|
}
|
6309
6711
|
|
6310
6712
|
for ( ; i < 4; i += 2 ) {
|
6311
6713
|
|
6312
|
-
// Both box models exclude margin
|
6313
|
-
if (
|
6314
|
-
|
6714
|
+
// Both box models exclude margin
|
6715
|
+
if ( box === "margin" ) {
|
6716
|
+
delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
|
6315
6717
|
}
|
6316
6718
|
|
6317
|
-
|
6719
|
+
// If we get here with a content-box, we're seeking "padding" or "border" or "margin"
|
6720
|
+
if ( !isBorderBox ) {
|
6318
6721
|
|
6319
|
-
//
|
6320
|
-
|
6321
|
-
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
6322
|
-
}
|
6722
|
+
// Add padding
|
6723
|
+
delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
6323
6724
|
|
6324
|
-
//
|
6325
|
-
if (
|
6326
|
-
|
6725
|
+
// For "border" or "margin", add border
|
6726
|
+
if ( box !== "padding" ) {
|
6727
|
+
delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
6728
|
+
|
6729
|
+
// But still keep track of it otherwise
|
6730
|
+
} else {
|
6731
|
+
extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
6327
6732
|
}
|
6733
|
+
|
6734
|
+
// If we get here with a border-box (content + padding + border), we're seeking "content" or
|
6735
|
+
// "padding" or "margin"
|
6328
6736
|
} else {
|
6329
6737
|
|
6330
|
-
//
|
6331
|
-
|
6738
|
+
// For "content", subtract padding
|
6739
|
+
if ( box === "content" ) {
|
6740
|
+
delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
6741
|
+
}
|
6332
6742
|
|
6333
|
-
//
|
6334
|
-
if (
|
6335
|
-
|
6743
|
+
// For "content" or "padding", subtract border
|
6744
|
+
if ( box !== "margin" ) {
|
6745
|
+
delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
6336
6746
|
}
|
6337
6747
|
}
|
6338
6748
|
}
|
6339
6749
|
|
6340
|
-
|
6750
|
+
// Account for positive content-box scroll gutter when requested by providing computedVal
|
6751
|
+
if ( !isBorderBox && computedVal >= 0 ) {
|
6752
|
+
|
6753
|
+
// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
|
6754
|
+
// Assuming integer scroll gutter, subtract the rest and round down
|
6755
|
+
delta += Math.max( 0, Math.ceil(
|
6756
|
+
elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
|
6757
|
+
computedVal -
|
6758
|
+
delta -
|
6759
|
+
extra -
|
6760
|
+
0.5
|
6761
|
+
|
6762
|
+
// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
|
6763
|
+
// Use an explicit zero to avoid NaN (gh-3964)
|
6764
|
+
) ) || 0;
|
6765
|
+
}
|
6766
|
+
|
6767
|
+
return delta;
|
6341
6768
|
}
|
6342
6769
|
|
6343
|
-
function getWidthOrHeight( elem,
|
6770
|
+
function getWidthOrHeight( elem, dimension, extra ) {
|
6344
6771
|
|
6345
6772
|
// Start with computed style
|
6346
|
-
var
|
6347
|
-
|
6348
|
-
|
6349
|
-
|
6773
|
+
var styles = getStyles( elem ),
|
6774
|
+
|
6775
|
+
// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
|
6776
|
+
// Fake content-box until we know it's needed to know the true value.
|
6777
|
+
boxSizingNeeded = !support.boxSizingReliable() || extra,
|
6778
|
+
isBorderBox = boxSizingNeeded &&
|
6779
|
+
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
6780
|
+
valueIsBorderBox = isBorderBox,
|
6350
6781
|
|
6351
|
-
|
6782
|
+
val = curCSS( elem, dimension, styles ),
|
6783
|
+
offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
|
6784
|
+
|
6785
|
+
// Support: Firefox <=54
|
6786
|
+
// Return a confounding non-pixel value or feign ignorance, as appropriate.
|
6352
6787
|
if ( rnumnonpx.test( val ) ) {
|
6353
|
-
|
6788
|
+
if ( !extra ) {
|
6789
|
+
return val;
|
6790
|
+
}
|
6791
|
+
val = "auto";
|
6354
6792
|
}
|
6355
6793
|
|
6356
|
-
// Check for style in case a browser which returns unreliable values
|
6357
|
-
// for getComputedStyle silently falls back to the reliable elem.style
|
6358
|
-
valueIsBorderBox = isBorderBox &&
|
6359
|
-
( support.boxSizingReliable() || val === elem.style[ name ] );
|
6360
6794
|
|
6361
|
-
//
|
6362
|
-
//
|
6363
|
-
|
6364
|
-
|
6795
|
+
// Support: IE 9 - 11 only
|
6796
|
+
// Use offsetWidth/offsetHeight for when box sizing is unreliable.
|
6797
|
+
// In those cases, the computed value can be trusted to be border-box.
|
6798
|
+
if ( ( !support.boxSizingReliable() && isBorderBox ||
|
6799
|
+
|
6800
|
+
// Support: IE 10 - 11+, Edge 15 - 18+
|
6801
|
+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
|
6802
|
+
// set in CSS while `offset*` properties report correct values.
|
6803
|
+
// Interestingly, in some cases IE 9 doesn't suffer from this issue.
|
6804
|
+
!support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
|
6805
|
+
|
6806
|
+
// Fall back to offsetWidth/offsetHeight when value is "auto"
|
6807
|
+
// This happens for inline elements with no explicit setting (gh-3571)
|
6808
|
+
val === "auto" ||
|
6809
|
+
|
6810
|
+
// Support: Android <=4.1 - 4.3 only
|
6811
|
+
// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
|
6812
|
+
!parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
|
6813
|
+
|
6814
|
+
// Make sure the element is visible & connected
|
6815
|
+
elem.getClientRects().length ) {
|
6816
|
+
|
6817
|
+
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
6818
|
+
|
6819
|
+
// Where available, offsetWidth/offsetHeight approximate border box dimensions.
|
6820
|
+
// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
|
6821
|
+
// retrieved value as a content box dimension.
|
6822
|
+
valueIsBorderBox = offsetProp in elem;
|
6823
|
+
if ( valueIsBorderBox ) {
|
6824
|
+
val = elem[ offsetProp ];
|
6825
|
+
}
|
6365
6826
|
}
|
6366
6827
|
|
6367
|
-
// Normalize ""
|
6828
|
+
// Normalize "" and auto
|
6368
6829
|
val = parseFloat( val ) || 0;
|
6369
6830
|
|
6370
|
-
//
|
6831
|
+
// Adjust for the element's box model
|
6371
6832
|
return ( val +
|
6372
|
-
|
6833
|
+
boxModelAdjustment(
|
6373
6834
|
elem,
|
6374
|
-
|
6835
|
+
dimension,
|
6375
6836
|
extra || ( isBorderBox ? "border" : "content" ),
|
6376
6837
|
valueIsBorderBox,
|
6377
|
-
styles
|
6838
|
+
styles,
|
6839
|
+
|
6840
|
+
// Provide the current computed size to request scroll gutter calculation (gh-3589)
|
6841
|
+
val
|
6378
6842
|
)
|
6379
6843
|
) + "px";
|
6380
6844
|
}
|
@@ -6404,6 +6868,13 @@ jQuery.extend( {
|
|
6404
6868
|
"flexGrow": true,
|
6405
6869
|
"flexShrink": true,
|
6406
6870
|
"fontWeight": true,
|
6871
|
+
"gridArea": true,
|
6872
|
+
"gridColumn": true,
|
6873
|
+
"gridColumnEnd": true,
|
6874
|
+
"gridColumnStart": true,
|
6875
|
+
"gridRow": true,
|
6876
|
+
"gridRowEnd": true,
|
6877
|
+
"gridRowStart": true,
|
6407
6878
|
"lineHeight": true,
|
6408
6879
|
"opacity": true,
|
6409
6880
|
"order": true,
|
@@ -6415,9 +6886,7 @@ jQuery.extend( {
|
|
6415
6886
|
|
6416
6887
|
// Add in properties whose names you wish to fix before
|
6417
6888
|
// setting or getting the value
|
6418
|
-
cssProps: {
|
6419
|
-
"float": "cssFloat"
|
6420
|
-
},
|
6889
|
+
cssProps: {},
|
6421
6890
|
|
6422
6891
|
// Get and set the style property on a DOM Node
|
6423
6892
|
style: function( elem, name, value, extra ) {
|
@@ -6429,7 +6898,7 @@ jQuery.extend( {
|
|
6429
6898
|
|
6430
6899
|
// Make sure that we're working with the right name
|
6431
6900
|
var ret, type, hooks,
|
6432
|
-
origName =
|
6901
|
+
origName = camelCase( name ),
|
6433
6902
|
isCustomProp = rcustomProp.test( name ),
|
6434
6903
|
style = elem.style;
|
6435
6904
|
|
@@ -6461,7 +6930,9 @@ jQuery.extend( {
|
|
6461
6930
|
}
|
6462
6931
|
|
6463
6932
|
// If a number was passed in, add the unit (except for certain CSS properties)
|
6464
|
-
|
6933
|
+
// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
|
6934
|
+
// "px" to a few hardcoded values.
|
6935
|
+
if ( type === "number" && !isCustomProp ) {
|
6465
6936
|
value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
|
6466
6937
|
}
|
6467
6938
|
|
@@ -6497,7 +6968,7 @@ jQuery.extend( {
|
|
6497
6968
|
|
6498
6969
|
css: function( elem, name, extra, styles ) {
|
6499
6970
|
var val, num, hooks,
|
6500
|
-
origName =
|
6971
|
+
origName = camelCase( name ),
|
6501
6972
|
isCustomProp = rcustomProp.test( name );
|
6502
6973
|
|
6503
6974
|
// Make sure that we're working with the right name. We don't
|
@@ -6535,8 +7006,8 @@ jQuery.extend( {
|
|
6535
7006
|
}
|
6536
7007
|
} );
|
6537
7008
|
|
6538
|
-
jQuery.each( [ "height", "width" ], function(
|
6539
|
-
jQuery.cssHooks[
|
7009
|
+
jQuery.each( [ "height", "width" ], function( _i, dimension ) {
|
7010
|
+
jQuery.cssHooks[ dimension ] = {
|
6540
7011
|
get: function( elem, computed, extra ) {
|
6541
7012
|
if ( computed ) {
|
6542
7013
|
|
@@ -6552,29 +7023,52 @@ jQuery.each( [ "height", "width" ], function( i, name ) {
|
|
6552
7023
|
// in IE throws an error.
|
6553
7024
|
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
|
6554
7025
|
swap( elem, cssShow, function() {
|
6555
|
-
return getWidthOrHeight( elem,
|
7026
|
+
return getWidthOrHeight( elem, dimension, extra );
|
6556
7027
|
} ) :
|
6557
|
-
getWidthOrHeight( elem,
|
7028
|
+
getWidthOrHeight( elem, dimension, extra );
|
6558
7029
|
}
|
6559
7030
|
},
|
6560
7031
|
|
6561
7032
|
set: function( elem, value, extra ) {
|
6562
7033
|
var matches,
|
6563
|
-
styles =
|
6564
|
-
|
6565
|
-
|
6566
|
-
|
6567
|
-
|
7034
|
+
styles = getStyles( elem ),
|
7035
|
+
|
7036
|
+
// Only read styles.position if the test has a chance to fail
|
7037
|
+
// to avoid forcing a reflow.
|
7038
|
+
scrollboxSizeBuggy = !support.scrollboxSize() &&
|
7039
|
+
styles.position === "absolute",
|
7040
|
+
|
7041
|
+
// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
|
7042
|
+
boxSizingNeeded = scrollboxSizeBuggy || extra,
|
7043
|
+
isBorderBox = boxSizingNeeded &&
|
6568
7044
|
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
6569
|
-
|
7045
|
+
subtract = extra ?
|
7046
|
+
boxModelAdjustment(
|
7047
|
+
elem,
|
7048
|
+
dimension,
|
7049
|
+
extra,
|
7050
|
+
isBorderBox,
|
7051
|
+
styles
|
7052
|
+
) :
|
7053
|
+
0;
|
7054
|
+
|
7055
|
+
// Account for unreliable border-box dimensions by comparing offset* to computed and
|
7056
|
+
// faking a content-box to get border and padding (gh-3699)
|
7057
|
+
if ( isBorderBox && scrollboxSizeBuggy ) {
|
7058
|
+
subtract -= Math.ceil(
|
7059
|
+
elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
|
7060
|
+
parseFloat( styles[ dimension ] ) -
|
7061
|
+
boxModelAdjustment( elem, dimension, "border", false, styles ) -
|
7062
|
+
0.5
|
6570
7063
|
);
|
7064
|
+
}
|
6571
7065
|
|
6572
7066
|
// Convert to pixels if value adjustment is needed
|
6573
7067
|
if ( subtract && ( matches = rcssNum.exec( value ) ) &&
|
6574
7068
|
( matches[ 3 ] || "px" ) !== "px" ) {
|
6575
7069
|
|
6576
|
-
elem.style[
|
6577
|
-
value = jQuery.css( elem,
|
7070
|
+
elem.style[ dimension ] = value;
|
7071
|
+
value = jQuery.css( elem, dimension );
|
6578
7072
|
}
|
6579
7073
|
|
6580
7074
|
return setPositiveNumber( elem, value, subtract );
|
@@ -6618,7 +7112,7 @@ jQuery.each( {
|
|
6618
7112
|
}
|
6619
7113
|
};
|
6620
7114
|
|
6621
|
-
if (
|
7115
|
+
if ( prefix !== "margin" ) {
|
6622
7116
|
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
|
6623
7117
|
}
|
6624
7118
|
} );
|
@@ -6728,9 +7222,9 @@ Tween.propHooks = {
|
|
6728
7222
|
// Use .style if available and use plain properties where available.
|
6729
7223
|
if ( jQuery.fx.step[ tween.prop ] ) {
|
6730
7224
|
jQuery.fx.step[ tween.prop ]( tween );
|
6731
|
-
} else if ( tween.elem.nodeType === 1 &&
|
6732
|
-
|
6733
|
-
|
7225
|
+
} else if ( tween.elem.nodeType === 1 && (
|
7226
|
+
jQuery.cssHooks[ tween.prop ] ||
|
7227
|
+
tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
|
6734
7228
|
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
|
6735
7229
|
} else {
|
6736
7230
|
tween.elem[ tween.prop ] = tween.now;
|
@@ -6789,7 +7283,7 @@ function createFxNow() {
|
|
6789
7283
|
window.setTimeout( function() {
|
6790
7284
|
fxNow = undefined;
|
6791
7285
|
} );
|
6792
|
-
return ( fxNow =
|
7286
|
+
return ( fxNow = Date.now() );
|
6793
7287
|
}
|
6794
7288
|
|
6795
7289
|
// Generate parameters to create a standard animation
|
@@ -6893,9 +7387,10 @@ function defaultPrefilter( elem, props, opts ) {
|
|
6893
7387
|
// Restrict "overflow" and "display" styles during box animations
|
6894
7388
|
if ( isBox && elem.nodeType === 1 ) {
|
6895
7389
|
|
6896
|
-
// Support: IE <=9 - 11, Edge 12 -
|
7390
|
+
// Support: IE <=9 - 11, Edge 12 - 15
|
6897
7391
|
// Record all 3 overflow attributes because IE does not infer the shorthand
|
6898
|
-
// from identically-valued overflowX and overflowY
|
7392
|
+
// from identically-valued overflowX and overflowY and Edge just mirrors
|
7393
|
+
// the overflowX value there.
|
6899
7394
|
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
|
6900
7395
|
|
6901
7396
|
// Identify a display type, preferring old show/hide data over the CSS cascade
|
@@ -7003,7 +7498,7 @@ function propFilter( props, specialEasing ) {
|
|
7003
7498
|
|
7004
7499
|
// camelCase, specialEasing and expand cssHook pass
|
7005
7500
|
for ( index in props ) {
|
7006
|
-
name =
|
7501
|
+
name = camelCase( index );
|
7007
7502
|
easing = specialEasing[ name ];
|
7008
7503
|
value = props[ index ];
|
7009
7504
|
if ( Array.isArray( value ) ) {
|
@@ -7128,9 +7623,9 @@ function Animation( elem, properties, options ) {
|
|
7128
7623
|
for ( ; index < length; index++ ) {
|
7129
7624
|
result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
|
7130
7625
|
if ( result ) {
|
7131
|
-
if (
|
7626
|
+
if ( isFunction( result.stop ) ) {
|
7132
7627
|
jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
|
7133
|
-
|
7628
|
+
result.stop.bind( result );
|
7134
7629
|
}
|
7135
7630
|
return result;
|
7136
7631
|
}
|
@@ -7138,7 +7633,7 @@ function Animation( elem, properties, options ) {
|
|
7138
7633
|
|
7139
7634
|
jQuery.map( props, createTween, animation );
|
7140
7635
|
|
7141
|
-
if (
|
7636
|
+
if ( isFunction( animation.opts.start ) ) {
|
7142
7637
|
animation.opts.start.call( elem, animation );
|
7143
7638
|
}
|
7144
7639
|
|
@@ -7171,7 +7666,7 @@ jQuery.Animation = jQuery.extend( Animation, {
|
|
7171
7666
|
},
|
7172
7667
|
|
7173
7668
|
tweener: function( props, callback ) {
|
7174
|
-
if (
|
7669
|
+
if ( isFunction( props ) ) {
|
7175
7670
|
callback = props;
|
7176
7671
|
props = [ "*" ];
|
7177
7672
|
} else {
|
@@ -7203,9 +7698,9 @@ jQuery.Animation = jQuery.extend( Animation, {
|
|
7203
7698
|
jQuery.speed = function( speed, easing, fn ) {
|
7204
7699
|
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
|
7205
7700
|
complete: fn || !fn && easing ||
|
7206
|
-
|
7701
|
+
isFunction( speed ) && speed,
|
7207
7702
|
duration: speed,
|
7208
|
-
easing: fn && easing || easing && !
|
7703
|
+
easing: fn && easing || easing && !isFunction( easing ) && easing
|
7209
7704
|
};
|
7210
7705
|
|
7211
7706
|
// Go to the end state if fx are off
|
@@ -7232,7 +7727,7 @@ jQuery.speed = function( speed, easing, fn ) {
|
|
7232
7727
|
opt.old = opt.complete;
|
7233
7728
|
|
7234
7729
|
opt.complete = function() {
|
7235
|
-
if (
|
7730
|
+
if ( isFunction( opt.old ) ) {
|
7236
7731
|
opt.old.call( this );
|
7237
7732
|
}
|
7238
7733
|
|
@@ -7284,7 +7779,7 @@ jQuery.fn.extend( {
|
|
7284
7779
|
clearQueue = type;
|
7285
7780
|
type = undefined;
|
7286
7781
|
}
|
7287
|
-
if ( clearQueue
|
7782
|
+
if ( clearQueue ) {
|
7288
7783
|
this.queue( type || "fx", [] );
|
7289
7784
|
}
|
7290
7785
|
|
@@ -7367,7 +7862,7 @@ jQuery.fn.extend( {
|
|
7367
7862
|
}
|
7368
7863
|
} );
|
7369
7864
|
|
7370
|
-
jQuery.each( [ "toggle", "show", "hide" ], function(
|
7865
|
+
jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
|
7371
7866
|
var cssFn = jQuery.fn[ name ];
|
7372
7867
|
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
7373
7868
|
return speed == null || typeof speed === "boolean" ?
|
@@ -7396,7 +7891,7 @@ jQuery.fx.tick = function() {
|
|
7396
7891
|
i = 0,
|
7397
7892
|
timers = jQuery.timers;
|
7398
7893
|
|
7399
|
-
fxNow =
|
7894
|
+
fxNow = Date.now();
|
7400
7895
|
|
7401
7896
|
for ( ; i < timers.length; i++ ) {
|
7402
7897
|
timer = timers[ i ];
|
@@ -7588,7 +8083,7 @@ boolHook = {
|
|
7588
8083
|
}
|
7589
8084
|
};
|
7590
8085
|
|
7591
|
-
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function(
|
8086
|
+
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
|
7592
8087
|
var getter = attrHandle[ name ] || jQuery.find.attr;
|
7593
8088
|
|
7594
8089
|
attrHandle[ name ] = function( elem, name, isXML ) {
|
@@ -7749,7 +8244,7 @@ jQuery.each( [
|
|
7749
8244
|
|
7750
8245
|
|
7751
8246
|
// Strip and collapse whitespace according to HTML spec
|
7752
|
-
// https://
|
8247
|
+
// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
|
7753
8248
|
function stripAndCollapse( value ) {
|
7754
8249
|
var tokens = value.match( rnothtmlwhite ) || [];
|
7755
8250
|
return tokens.join( " " );
|
@@ -7760,20 +8255,30 @@ function getClass( elem ) {
|
|
7760
8255
|
return elem.getAttribute && elem.getAttribute( "class" ) || "";
|
7761
8256
|
}
|
7762
8257
|
|
8258
|
+
function classesToArray( value ) {
|
8259
|
+
if ( Array.isArray( value ) ) {
|
8260
|
+
return value;
|
8261
|
+
}
|
8262
|
+
if ( typeof value === "string" ) {
|
8263
|
+
return value.match( rnothtmlwhite ) || [];
|
8264
|
+
}
|
8265
|
+
return [];
|
8266
|
+
}
|
8267
|
+
|
7763
8268
|
jQuery.fn.extend( {
|
7764
8269
|
addClass: function( value ) {
|
7765
8270
|
var classes, elem, cur, curValue, clazz, j, finalValue,
|
7766
8271
|
i = 0;
|
7767
8272
|
|
7768
|
-
if (
|
8273
|
+
if ( isFunction( value ) ) {
|
7769
8274
|
return this.each( function( j ) {
|
7770
8275
|
jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
|
7771
8276
|
} );
|
7772
8277
|
}
|
7773
8278
|
|
7774
|
-
|
7775
|
-
classes = value.match( rnothtmlwhite ) || [];
|
8279
|
+
classes = classesToArray( value );
|
7776
8280
|
|
8281
|
+
if ( classes.length ) {
|
7777
8282
|
while ( ( elem = this[ i++ ] ) ) {
|
7778
8283
|
curValue = getClass( elem );
|
7779
8284
|
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
@@ -7802,7 +8307,7 @@ jQuery.fn.extend( {
|
|
7802
8307
|
var classes, elem, cur, curValue, clazz, j, finalValue,
|
7803
8308
|
i = 0;
|
7804
8309
|
|
7805
|
-
if (
|
8310
|
+
if ( isFunction( value ) ) {
|
7806
8311
|
return this.each( function( j ) {
|
7807
8312
|
jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
|
7808
8313
|
} );
|
@@ -7812,9 +8317,9 @@ jQuery.fn.extend( {
|
|
7812
8317
|
return this.attr( "class", "" );
|
7813
8318
|
}
|
7814
8319
|
|
7815
|
-
|
7816
|
-
classes = value.match( rnothtmlwhite ) || [];
|
8320
|
+
classes = classesToArray( value );
|
7817
8321
|
|
8322
|
+
if ( classes.length ) {
|
7818
8323
|
while ( ( elem = this[ i++ ] ) ) {
|
7819
8324
|
curValue = getClass( elem );
|
7820
8325
|
|
@@ -7844,13 +8349,14 @@ jQuery.fn.extend( {
|
|
7844
8349
|
},
|
7845
8350
|
|
7846
8351
|
toggleClass: function( value, stateVal ) {
|
7847
|
-
var type = typeof value
|
8352
|
+
var type = typeof value,
|
8353
|
+
isValidValue = type === "string" || Array.isArray( value );
|
7848
8354
|
|
7849
|
-
if ( typeof stateVal === "boolean" &&
|
8355
|
+
if ( typeof stateVal === "boolean" && isValidValue ) {
|
7850
8356
|
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
7851
8357
|
}
|
7852
8358
|
|
7853
|
-
if (
|
8359
|
+
if ( isFunction( value ) ) {
|
7854
8360
|
return this.each( function( i ) {
|
7855
8361
|
jQuery( this ).toggleClass(
|
7856
8362
|
value.call( this, i, getClass( this ), stateVal ),
|
@@ -7862,12 +8368,12 @@ jQuery.fn.extend( {
|
|
7862
8368
|
return this.each( function() {
|
7863
8369
|
var className, i, self, classNames;
|
7864
8370
|
|
7865
|
-
if (
|
8371
|
+
if ( isValidValue ) {
|
7866
8372
|
|
7867
8373
|
// Toggle individual class names
|
7868
8374
|
i = 0;
|
7869
8375
|
self = jQuery( this );
|
7870
|
-
classNames =
|
8376
|
+
classNames = classesToArray( value );
|
7871
8377
|
|
7872
8378
|
while ( ( className = classNames[ i++ ] ) ) {
|
7873
8379
|
|
@@ -7926,7 +8432,7 @@ var rreturn = /\r/g;
|
|
7926
8432
|
|
7927
8433
|
jQuery.fn.extend( {
|
7928
8434
|
val: function( value ) {
|
7929
|
-
var hooks, ret,
|
8435
|
+
var hooks, ret, valueIsFunction,
|
7930
8436
|
elem = this[ 0 ];
|
7931
8437
|
|
7932
8438
|
if ( !arguments.length ) {
|
@@ -7955,7 +8461,7 @@ jQuery.fn.extend( {
|
|
7955
8461
|
return;
|
7956
8462
|
}
|
7957
8463
|
|
7958
|
-
|
8464
|
+
valueIsFunction = isFunction( value );
|
7959
8465
|
|
7960
8466
|
return this.each( function( i ) {
|
7961
8467
|
var val;
|
@@ -7964,7 +8470,7 @@ jQuery.fn.extend( {
|
|
7964
8470
|
return;
|
7965
8471
|
}
|
7966
8472
|
|
7967
|
-
if (
|
8473
|
+
if ( valueIsFunction ) {
|
7968
8474
|
val = value.call( this, i, jQuery( this ).val() );
|
7969
8475
|
} else {
|
7970
8476
|
val = value;
|
@@ -8106,18 +8612,24 @@ jQuery.each( [ "radio", "checkbox" ], function() {
|
|
8106
8612
|
// Return jQuery for attributes-only inclusion
|
8107
8613
|
|
8108
8614
|
|
8109
|
-
|
8615
|
+
support.focusin = "onfocusin" in window;
|
8616
|
+
|
8617
|
+
|
8618
|
+
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
8619
|
+
stopPropagationCallback = function( e ) {
|
8620
|
+
e.stopPropagation();
|
8621
|
+
};
|
8110
8622
|
|
8111
8623
|
jQuery.extend( jQuery.event, {
|
8112
8624
|
|
8113
8625
|
trigger: function( event, data, elem, onlyHandlers ) {
|
8114
8626
|
|
8115
|
-
var i, cur, tmp, bubbleType, ontype, handle, special,
|
8627
|
+
var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
|
8116
8628
|
eventPath = [ elem || document ],
|
8117
8629
|
type = hasOwn.call( event, "type" ) ? event.type : event,
|
8118
8630
|
namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
|
8119
8631
|
|
8120
|
-
cur = tmp = elem = elem || document;
|
8632
|
+
cur = lastElement = tmp = elem = elem || document;
|
8121
8633
|
|
8122
8634
|
// Don't do events on text and comment nodes
|
8123
8635
|
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
@@ -8169,7 +8681,7 @@ jQuery.extend( jQuery.event, {
|
|
8169
8681
|
|
8170
8682
|
// Determine event propagation path in advance, per W3C events spec (#9951)
|
8171
8683
|
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
8172
|
-
if ( !onlyHandlers && !special.noBubble && !
|
8684
|
+
if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
|
8173
8685
|
|
8174
8686
|
bubbleType = special.delegateType || type;
|
8175
8687
|
if ( !rfocusMorph.test( bubbleType + type ) ) {
|
@@ -8189,13 +8701,15 @@ jQuery.extend( jQuery.event, {
|
|
8189
8701
|
// Fire handlers on the event path
|
8190
8702
|
i = 0;
|
8191
8703
|
while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
|
8192
|
-
|
8704
|
+
lastElement = cur;
|
8193
8705
|
event.type = i > 1 ?
|
8194
8706
|
bubbleType :
|
8195
8707
|
special.bindType || type;
|
8196
8708
|
|
8197
8709
|
// jQuery handler
|
8198
|
-
handle = (
|
8710
|
+
handle = (
|
8711
|
+
dataPriv.get( cur, "events" ) || Object.create( null )
|
8712
|
+
)[ event.type ] &&
|
8199
8713
|
dataPriv.get( cur, "handle" );
|
8200
8714
|
if ( handle ) {
|
8201
8715
|
handle.apply( cur, data );
|
@@ -8221,7 +8735,7 @@ jQuery.extend( jQuery.event, {
|
|
8221
8735
|
|
8222
8736
|
// Call a native DOM method on the target with the same name as the event.
|
8223
8737
|
// Don't do default actions on window, that's where global variables be (#6170)
|
8224
|
-
if ( ontype &&
|
8738
|
+
if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
|
8225
8739
|
|
8226
8740
|
// Don't re-trigger an onFOO event when we call its FOO() method
|
8227
8741
|
tmp = elem[ ontype ];
|
@@ -8232,7 +8746,17 @@ jQuery.extend( jQuery.event, {
|
|
8232
8746
|
|
8233
8747
|
// Prevent re-triggering of the same event, since we already bubbled it above
|
8234
8748
|
jQuery.event.triggered = type;
|
8749
|
+
|
8750
|
+
if ( event.isPropagationStopped() ) {
|
8751
|
+
lastElement.addEventListener( type, stopPropagationCallback );
|
8752
|
+
}
|
8753
|
+
|
8235
8754
|
elem[ type ]();
|
8755
|
+
|
8756
|
+
if ( event.isPropagationStopped() ) {
|
8757
|
+
lastElement.removeEventListener( type, stopPropagationCallback );
|
8758
|
+
}
|
8759
|
+
|
8236
8760
|
jQuery.event.triggered = undefined;
|
8237
8761
|
|
8238
8762
|
if ( tmp ) {
|
@@ -8278,31 +8802,6 @@ jQuery.fn.extend( {
|
|
8278
8802
|
} );
|
8279
8803
|
|
8280
8804
|
|
8281
|
-
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
|
8282
|
-
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
8283
|
-
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
|
8284
|
-
function( i, name ) {
|
8285
|
-
|
8286
|
-
// Handle event binding
|
8287
|
-
jQuery.fn[ name ] = function( data, fn ) {
|
8288
|
-
return arguments.length > 0 ?
|
8289
|
-
this.on( name, null, data, fn ) :
|
8290
|
-
this.trigger( name );
|
8291
|
-
};
|
8292
|
-
} );
|
8293
|
-
|
8294
|
-
jQuery.fn.extend( {
|
8295
|
-
hover: function( fnOver, fnOut ) {
|
8296
|
-
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
8297
|
-
}
|
8298
|
-
} );
|
8299
|
-
|
8300
|
-
|
8301
|
-
|
8302
|
-
|
8303
|
-
support.focusin = "onfocusin" in window;
|
8304
|
-
|
8305
|
-
|
8306
8805
|
// Support: Firefox <=44
|
8307
8806
|
// Firefox doesn't have focus(in | out) events
|
8308
8807
|
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
|
@@ -8321,7 +8820,10 @@ if ( !support.focusin ) {
|
|
8321
8820
|
|
8322
8821
|
jQuery.event.special[ fix ] = {
|
8323
8822
|
setup: function() {
|
8324
|
-
|
8823
|
+
|
8824
|
+
// Handle: regular nodes (via `this.ownerDocument`), window
|
8825
|
+
// (via `this.document`) & document (via `this`).
|
8826
|
+
var doc = this.ownerDocument || this.document || this,
|
8325
8827
|
attaches = dataPriv.access( doc, fix );
|
8326
8828
|
|
8327
8829
|
if ( !attaches ) {
|
@@ -8330,7 +8832,7 @@ if ( !support.focusin ) {
|
|
8330
8832
|
dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
|
8331
8833
|
},
|
8332
8834
|
teardown: function() {
|
8333
|
-
var doc = this.ownerDocument || this,
|
8835
|
+
var doc = this.ownerDocument || this.document || this,
|
8334
8836
|
attaches = dataPriv.access( doc, fix ) - 1;
|
8335
8837
|
|
8336
8838
|
if ( !attaches ) {
|
@@ -8346,7 +8848,7 @@ if ( !support.focusin ) {
|
|
8346
8848
|
}
|
8347
8849
|
var location = window.location;
|
8348
8850
|
|
8349
|
-
var nonce =
|
8851
|
+
var nonce = { guid: Date.now() };
|
8350
8852
|
|
8351
8853
|
var rquery = ( /\?/ );
|
8352
8854
|
|
@@ -8404,7 +8906,7 @@ function buildParams( prefix, obj, traditional, add ) {
|
|
8404
8906
|
}
|
8405
8907
|
} );
|
8406
8908
|
|
8407
|
-
} else if ( !traditional &&
|
8909
|
+
} else if ( !traditional && toType( obj ) === "object" ) {
|
8408
8910
|
|
8409
8911
|
// Serialize object item.
|
8410
8912
|
for ( name in obj ) {
|
@@ -8426,7 +8928,7 @@ jQuery.param = function( a, traditional ) {
|
|
8426
8928
|
add = function( key, valueOrFunction ) {
|
8427
8929
|
|
8428
8930
|
// If value is a function, invoke it and use its return value
|
8429
|
-
var value =
|
8931
|
+
var value = isFunction( valueOrFunction ) ?
|
8430
8932
|
valueOrFunction() :
|
8431
8933
|
valueOrFunction;
|
8432
8934
|
|
@@ -8434,6 +8936,10 @@ jQuery.param = function( a, traditional ) {
|
|
8434
8936
|
encodeURIComponent( value == null ? "" : value );
|
8435
8937
|
};
|
8436
8938
|
|
8939
|
+
if ( a == null ) {
|
8940
|
+
return "";
|
8941
|
+
}
|
8942
|
+
|
8437
8943
|
// If an array was passed in, assume that it is an array of form elements.
|
8438
8944
|
if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
8439
8945
|
|
@@ -8474,7 +8980,7 @@ jQuery.fn.extend( {
|
|
8474
8980
|
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
|
8475
8981
|
( this.checked || !rcheckableType.test( type ) );
|
8476
8982
|
} )
|
8477
|
-
.map( function(
|
8983
|
+
.map( function( _i, elem ) {
|
8478
8984
|
var val = jQuery( this ).val();
|
8479
8985
|
|
8480
8986
|
if ( val == null ) {
|
@@ -8544,7 +9050,7 @@ function addToPrefiltersOrTransports( structure ) {
|
|
8544
9050
|
i = 0,
|
8545
9051
|
dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
|
8546
9052
|
|
8547
|
-
if (
|
9053
|
+
if ( isFunction( func ) ) {
|
8548
9054
|
|
8549
9055
|
// For each dataType in the dataTypeExpression
|
8550
9056
|
while ( ( dataType = dataTypes[ i++ ] ) ) {
|
@@ -8936,12 +9442,14 @@ jQuery.extend( {
|
|
8936
9442
|
if ( !responseHeaders ) {
|
8937
9443
|
responseHeaders = {};
|
8938
9444
|
while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
8939
|
-
responseHeaders[ match[ 1 ].toLowerCase()
|
9445
|
+
responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
|
9446
|
+
( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
|
9447
|
+
.concat( match[ 2 ] );
|
8940
9448
|
}
|
8941
9449
|
}
|
8942
|
-
match = responseHeaders[ key.toLowerCase() ];
|
9450
|
+
match = responseHeaders[ key.toLowerCase() + " " ];
|
8943
9451
|
}
|
8944
|
-
return match == null ? null : match;
|
9452
|
+
return match == null ? null : match.join( ", " );
|
8945
9453
|
},
|
8946
9454
|
|
8947
9455
|
// Raw string
|
@@ -9016,7 +9524,7 @@ jQuery.extend( {
|
|
9016
9524
|
if ( s.crossDomain == null ) {
|
9017
9525
|
urlAnchor = document.createElement( "a" );
|
9018
9526
|
|
9019
|
-
// Support: IE <=8 - 11, Edge 12 -
|
9527
|
+
// Support: IE <=8 - 11, Edge 12 - 15
|
9020
9528
|
// IE throws exception on accessing the href property if url is malformed,
|
9021
9529
|
// e.g. http://example.com:80x/
|
9022
9530
|
try {
|
@@ -9074,8 +9582,8 @@ jQuery.extend( {
|
|
9074
9582
|
// Remember the hash so we can put it back
|
9075
9583
|
uncached = s.url.slice( cacheURL.length );
|
9076
9584
|
|
9077
|
-
// If data is available, append data to url
|
9078
|
-
if ( s.data ) {
|
9585
|
+
// If data is available and should be processed, append data to url
|
9586
|
+
if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
|
9079
9587
|
cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
|
9080
9588
|
|
9081
9589
|
// #9682: remove data so that it's not used in an eventual retry
|
@@ -9085,7 +9593,8 @@ jQuery.extend( {
|
|
9085
9593
|
// Add or update anti-cache param if needed
|
9086
9594
|
if ( s.cache === false ) {
|
9087
9595
|
cacheURL = cacheURL.replace( rantiCache, "$1" );
|
9088
|
-
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) +
|
9596
|
+
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
|
9597
|
+
uncached;
|
9089
9598
|
}
|
9090
9599
|
|
9091
9600
|
// Put hash and anti-cache on the URL that will be requested (gh-1732)
|
@@ -9218,6 +9727,11 @@ jQuery.extend( {
|
|
9218
9727
|
response = ajaxHandleResponses( s, jqXHR, responses );
|
9219
9728
|
}
|
9220
9729
|
|
9730
|
+
// Use a noop converter for missing script
|
9731
|
+
if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
|
9732
|
+
s.converters[ "text script" ] = function() {};
|
9733
|
+
}
|
9734
|
+
|
9221
9735
|
// Convert no matter what (that way responseXXX fields are always set)
|
9222
9736
|
response = ajaxConvert( s, response, jqXHR, isSuccess );
|
9223
9737
|
|
@@ -9308,11 +9822,11 @@ jQuery.extend( {
|
|
9308
9822
|
}
|
9309
9823
|
} );
|
9310
9824
|
|
9311
|
-
jQuery.each( [ "get", "post" ], function(
|
9825
|
+
jQuery.each( [ "get", "post" ], function( _i, method ) {
|
9312
9826
|
jQuery[ method ] = function( url, data, callback, type ) {
|
9313
9827
|
|
9314
9828
|
// Shift arguments if data argument was omitted
|
9315
|
-
if (
|
9829
|
+
if ( isFunction( data ) ) {
|
9316
9830
|
type = type || callback;
|
9317
9831
|
callback = data;
|
9318
9832
|
data = undefined;
|
@@ -9329,8 +9843,17 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
|
|
9329
9843
|
};
|
9330
9844
|
} );
|
9331
9845
|
|
9846
|
+
jQuery.ajaxPrefilter( function( s ) {
|
9847
|
+
var i;
|
9848
|
+
for ( i in s.headers ) {
|
9849
|
+
if ( i.toLowerCase() === "content-type" ) {
|
9850
|
+
s.contentType = s.headers[ i ] || "";
|
9851
|
+
}
|
9852
|
+
}
|
9853
|
+
} );
|
9854
|
+
|
9332
9855
|
|
9333
|
-
jQuery._evalUrl = function( url ) {
|
9856
|
+
jQuery._evalUrl = function( url, options, doc ) {
|
9334
9857
|
return jQuery.ajax( {
|
9335
9858
|
url: url,
|
9336
9859
|
|
@@ -9340,7 +9863,16 @@ jQuery._evalUrl = function( url ) {
|
|
9340
9863
|
cache: true,
|
9341
9864
|
async: false,
|
9342
9865
|
global: false,
|
9343
|
-
|
9866
|
+
|
9867
|
+
// Only evaluate the response if it is successful (gh-4126)
|
9868
|
+
// dataFilter is not invoked for failure responses, so using it instead
|
9869
|
+
// of the default converter is kludgy but it works.
|
9870
|
+
converters: {
|
9871
|
+
"text script": function() {}
|
9872
|
+
},
|
9873
|
+
dataFilter: function( response ) {
|
9874
|
+
jQuery.globalEval( response, options, doc );
|
9875
|
+
}
|
9344
9876
|
} );
|
9345
9877
|
};
|
9346
9878
|
|
@@ -9350,7 +9882,7 @@ jQuery.fn.extend( {
|
|
9350
9882
|
var wrap;
|
9351
9883
|
|
9352
9884
|
if ( this[ 0 ] ) {
|
9353
|
-
if (
|
9885
|
+
if ( isFunction( html ) ) {
|
9354
9886
|
html = html.call( this[ 0 ] );
|
9355
9887
|
}
|
9356
9888
|
|
@@ -9376,7 +9908,7 @@ jQuery.fn.extend( {
|
|
9376
9908
|
},
|
9377
9909
|
|
9378
9910
|
wrapInner: function( html ) {
|
9379
|
-
if (
|
9911
|
+
if ( isFunction( html ) ) {
|
9380
9912
|
return this.each( function( i ) {
|
9381
9913
|
jQuery( this ).wrapInner( html.call( this, i ) );
|
9382
9914
|
} );
|
@@ -9396,10 +9928,10 @@ jQuery.fn.extend( {
|
|
9396
9928
|
},
|
9397
9929
|
|
9398
9930
|
wrap: function( html ) {
|
9399
|
-
var
|
9931
|
+
var htmlIsFunction = isFunction( html );
|
9400
9932
|
|
9401
9933
|
return this.each( function( i ) {
|
9402
|
-
jQuery( this ).wrapAll(
|
9934
|
+
jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
|
9403
9935
|
} );
|
9404
9936
|
},
|
9405
9937
|
|
@@ -9491,7 +10023,8 @@ jQuery.ajaxTransport( function( options ) {
|
|
9491
10023
|
return function() {
|
9492
10024
|
if ( callback ) {
|
9493
10025
|
callback = errorCallback = xhr.onload =
|
9494
|
-
xhr.onerror = xhr.onabort = xhr.
|
10026
|
+
xhr.onerror = xhr.onabort = xhr.ontimeout =
|
10027
|
+
xhr.onreadystatechange = null;
|
9495
10028
|
|
9496
10029
|
if ( type === "abort" ) {
|
9497
10030
|
xhr.abort();
|
@@ -9531,7 +10064,7 @@ jQuery.ajaxTransport( function( options ) {
|
|
9531
10064
|
|
9532
10065
|
// Listen to events
|
9533
10066
|
xhr.onload = callback();
|
9534
|
-
errorCallback = xhr.onerror = callback( "error" );
|
10067
|
+
errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
|
9535
10068
|
|
9536
10069
|
// Support: IE 9 only
|
9537
10070
|
// Use onreadystatechange to replace onabort
|
@@ -9622,24 +10155,21 @@ jQuery.ajaxPrefilter( "script", function( s ) {
|
|
9622
10155
|
// Bind script tag hack transport
|
9623
10156
|
jQuery.ajaxTransport( "script", function( s ) {
|
9624
10157
|
|
9625
|
-
// This transport only deals with cross domain requests
|
9626
|
-
if ( s.crossDomain ) {
|
10158
|
+
// This transport only deals with cross domain or forced-by-attrs requests
|
10159
|
+
if ( s.crossDomain || s.scriptAttrs ) {
|
9627
10160
|
var script, callback;
|
9628
10161
|
return {
|
9629
10162
|
send: function( _, complete ) {
|
9630
|
-
script = jQuery( "<script>" )
|
9631
|
-
|
9632
|
-
src: s.url
|
9633
|
-
|
9634
|
-
"load error",
|
9635
|
-
callback = function( evt ) {
|
10163
|
+
script = jQuery( "<script>" )
|
10164
|
+
.attr( s.scriptAttrs || {} )
|
10165
|
+
.prop( { charset: s.scriptCharset, src: s.url } )
|
10166
|
+
.on( "load error", callback = function( evt ) {
|
9636
10167
|
script.remove();
|
9637
10168
|
callback = null;
|
9638
10169
|
if ( evt ) {
|
9639
10170
|
complete( evt.type === "error" ? 404 : 200, evt.type );
|
9640
10171
|
}
|
9641
|
-
}
|
9642
|
-
);
|
10172
|
+
} );
|
9643
10173
|
|
9644
10174
|
// Use native DOM manipulation to avoid our domManip AJAX trickery
|
9645
10175
|
document.head.appendChild( script[ 0 ] );
|
@@ -9663,7 +10193,7 @@ var oldCallbacks = [],
|
|
9663
10193
|
jQuery.ajaxSetup( {
|
9664
10194
|
jsonp: "callback",
|
9665
10195
|
jsonpCallback: function() {
|
9666
|
-
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
|
10196
|
+
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
|
9667
10197
|
this[ callback ] = true;
|
9668
10198
|
return callback;
|
9669
10199
|
}
|
@@ -9685,7 +10215,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
|
9685
10215
|
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
|
9686
10216
|
|
9687
10217
|
// Get callback name, remembering preexisting value associated with it
|
9688
|
-
callbackName = s.jsonpCallback =
|
10218
|
+
callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
|
9689
10219
|
s.jsonpCallback() :
|
9690
10220
|
s.jsonpCallback;
|
9691
10221
|
|
@@ -9736,7 +10266,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
|
9736
10266
|
}
|
9737
10267
|
|
9738
10268
|
// Call if it was a function and we have a response
|
9739
|
-
if ( responseContainer &&
|
10269
|
+
if ( responseContainer && isFunction( overwritten ) ) {
|
9740
10270
|
overwritten( responseContainer[ 0 ] );
|
9741
10271
|
}
|
9742
10272
|
|
@@ -9828,7 +10358,7 @@ jQuery.fn.load = function( url, params, callback ) {
|
|
9828
10358
|
}
|
9829
10359
|
|
9830
10360
|
// If it's a function
|
9831
|
-
if (
|
10361
|
+
if ( isFunction( params ) ) {
|
9832
10362
|
|
9833
10363
|
// We assume that it's the callback
|
9834
10364
|
callback = params;
|
@@ -9880,23 +10410,6 @@ jQuery.fn.load = function( url, params, callback ) {
|
|
9880
10410
|
|
9881
10411
|
|
9882
10412
|
|
9883
|
-
// Attach a bunch of functions for handling common AJAX events
|
9884
|
-
jQuery.each( [
|
9885
|
-
"ajaxStart",
|
9886
|
-
"ajaxStop",
|
9887
|
-
"ajaxComplete",
|
9888
|
-
"ajaxError",
|
9889
|
-
"ajaxSuccess",
|
9890
|
-
"ajaxSend"
|
9891
|
-
], function( i, type ) {
|
9892
|
-
jQuery.fn[ type ] = function( fn ) {
|
9893
|
-
return this.on( type, fn );
|
9894
|
-
};
|
9895
|
-
} );
|
9896
|
-
|
9897
|
-
|
9898
|
-
|
9899
|
-
|
9900
10413
|
jQuery.expr.pseudos.animated = function( elem ) {
|
9901
10414
|
return jQuery.grep( jQuery.timers, function( fn ) {
|
9902
10415
|
return elem === fn.elem;
|
@@ -9936,7 +10449,7 @@ jQuery.offset = {
|
|
9936
10449
|
curLeft = parseFloat( curCSSLeft ) || 0;
|
9937
10450
|
}
|
9938
10451
|
|
9939
|
-
if (
|
10452
|
+
if ( isFunction( options ) ) {
|
9940
10453
|
|
9941
10454
|
// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
|
9942
10455
|
options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
|
@@ -9953,12 +10466,20 @@ jQuery.offset = {
|
|
9953
10466
|
options.using.call( elem, props );
|
9954
10467
|
|
9955
10468
|
} else {
|
10469
|
+
if ( typeof props.top === "number" ) {
|
10470
|
+
props.top += "px";
|
10471
|
+
}
|
10472
|
+
if ( typeof props.left === "number" ) {
|
10473
|
+
props.left += "px";
|
10474
|
+
}
|
9956
10475
|
curElem.css( props );
|
9957
10476
|
}
|
9958
10477
|
}
|
9959
10478
|
};
|
9960
10479
|
|
9961
10480
|
jQuery.fn.extend( {
|
10481
|
+
|
10482
|
+
// offset() relates an element's border box to the document origin
|
9962
10483
|
offset: function( options ) {
|
9963
10484
|
|
9964
10485
|
// Preserve chaining for setter
|
@@ -9970,7 +10491,7 @@ jQuery.fn.extend( {
|
|
9970
10491
|
} );
|
9971
10492
|
}
|
9972
10493
|
|
9973
|
-
var
|
10494
|
+
var rect, win,
|
9974
10495
|
elem = this[ 0 ];
|
9975
10496
|
|
9976
10497
|
if ( !elem ) {
|
@@ -9985,50 +10506,52 @@ jQuery.fn.extend( {
|
|
9985
10506
|
return { top: 0, left: 0 };
|
9986
10507
|
}
|
9987
10508
|
|
10509
|
+
// Get document-relative position by adding viewport scroll to viewport-relative gBCR
|
9988
10510
|
rect = elem.getBoundingClientRect();
|
9989
|
-
|
9990
|
-
doc = elem.ownerDocument;
|
9991
|
-
docElem = doc.documentElement;
|
9992
|
-
win = doc.defaultView;
|
9993
|
-
|
10511
|
+
win = elem.ownerDocument.defaultView;
|
9994
10512
|
return {
|
9995
|
-
top: rect.top + win.pageYOffset
|
9996
|
-
left: rect.left + win.pageXOffset
|
10513
|
+
top: rect.top + win.pageYOffset,
|
10514
|
+
left: rect.left + win.pageXOffset
|
9997
10515
|
};
|
9998
10516
|
},
|
9999
10517
|
|
10518
|
+
// position() relates an element's margin box to its offset parent's padding box
|
10519
|
+
// This corresponds to the behavior of CSS absolute positioning
|
10000
10520
|
position: function() {
|
10001
10521
|
if ( !this[ 0 ] ) {
|
10002
10522
|
return;
|
10003
10523
|
}
|
10004
10524
|
|
10005
|
-
var offsetParent, offset,
|
10525
|
+
var offsetParent, offset, doc,
|
10006
10526
|
elem = this[ 0 ],
|
10007
10527
|
parentOffset = { top: 0, left: 0 };
|
10008
10528
|
|
10009
|
-
//
|
10010
|
-
// because it is its only offset parent
|
10529
|
+
// position:fixed elements are offset from the viewport, which itself always has zero offset
|
10011
10530
|
if ( jQuery.css( elem, "position" ) === "fixed" ) {
|
10012
10531
|
|
10013
|
-
// Assume
|
10532
|
+
// Assume position:fixed implies availability of getBoundingClientRect
|
10014
10533
|
offset = elem.getBoundingClientRect();
|
10015
10534
|
|
10016
10535
|
} else {
|
10536
|
+
offset = this.offset();
|
10017
10537
|
|
10018
|
-
//
|
10019
|
-
|
10538
|
+
// Account for the *real* offset parent, which can be the document or its root element
|
10539
|
+
// when a statically positioned element is identified
|
10540
|
+
doc = elem.ownerDocument;
|
10541
|
+
offsetParent = elem.offsetParent || doc.documentElement;
|
10542
|
+
while ( offsetParent &&
|
10543
|
+
( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
|
10544
|
+
jQuery.css( offsetParent, "position" ) === "static" ) {
|
10020
10545
|
|
10021
|
-
|
10022
|
-
offset = this.offset();
|
10023
|
-
if ( !nodeName( offsetParent[ 0 ], "html" ) ) {
|
10024
|
-
parentOffset = offsetParent.offset();
|
10546
|
+
offsetParent = offsetParent.parentNode;
|
10025
10547
|
}
|
10548
|
+
if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
|
10026
10549
|
|
10027
|
-
|
10028
|
-
|
10029
|
-
|
10030
|
-
|
10031
|
-
}
|
10550
|
+
// Incorporate borders into its offset, since they are outside its content origin
|
10551
|
+
parentOffset = jQuery( offsetParent ).offset();
|
10552
|
+
parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
|
10553
|
+
parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
|
10554
|
+
}
|
10032
10555
|
}
|
10033
10556
|
|
10034
10557
|
// Subtract parent offsets and element margins
|
@@ -10070,7 +10593,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
|
|
10070
10593
|
|
10071
10594
|
// Coalesce documents and windows
|
10072
10595
|
var win;
|
10073
|
-
if (
|
10596
|
+
if ( isWindow( elem ) ) {
|
10074
10597
|
win = elem;
|
10075
10598
|
} else if ( elem.nodeType === 9 ) {
|
10076
10599
|
win = elem.defaultView;
|
@@ -10099,7 +10622,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
|
|
10099
10622
|
// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
|
10100
10623
|
// getComputedStyle returns percent when specified for top/left/bottom/right;
|
10101
10624
|
// rather than make the css module depend on the offset module, just check for it here
|
10102
|
-
jQuery.each( [ "top", "left" ], function(
|
10625
|
+
jQuery.each( [ "top", "left" ], function( _i, prop ) {
|
10103
10626
|
jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
|
10104
10627
|
function( elem, computed ) {
|
10105
10628
|
if ( computed ) {
|
@@ -10128,7 +10651,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
|
10128
10651
|
return access( this, function( elem, type, value ) {
|
10129
10652
|
var doc;
|
10130
10653
|
|
10131
|
-
if (
|
10654
|
+
if ( isWindow( elem ) ) {
|
10132
10655
|
|
10133
10656
|
// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
|
10134
10657
|
return funcName.indexOf( "outer" ) === 0 ?
|
@@ -10162,6 +10685,22 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
|
10162
10685
|
} );
|
10163
10686
|
|
10164
10687
|
|
10688
|
+
jQuery.each( [
|
10689
|
+
"ajaxStart",
|
10690
|
+
"ajaxStop",
|
10691
|
+
"ajaxComplete",
|
10692
|
+
"ajaxError",
|
10693
|
+
"ajaxSuccess",
|
10694
|
+
"ajaxSend"
|
10695
|
+
], function( _i, type ) {
|
10696
|
+
jQuery.fn[ type ] = function( fn ) {
|
10697
|
+
return this.on( type, fn );
|
10698
|
+
};
|
10699
|
+
} );
|
10700
|
+
|
10701
|
+
|
10702
|
+
|
10703
|
+
|
10165
10704
|
jQuery.fn.extend( {
|
10166
10705
|
|
10167
10706
|
bind: function( types, data, fn ) {
|
@@ -10180,9 +10719,64 @@ jQuery.fn.extend( {
|
|
10180
10719
|
return arguments.length === 1 ?
|
10181
10720
|
this.off( selector, "**" ) :
|
10182
10721
|
this.off( types, selector || "**", fn );
|
10722
|
+
},
|
10723
|
+
|
10724
|
+
hover: function( fnOver, fnOut ) {
|
10725
|
+
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
10183
10726
|
}
|
10184
10727
|
} );
|
10185
10728
|
|
10729
|
+
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
|
10730
|
+
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
10731
|
+
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
|
10732
|
+
function( _i, name ) {
|
10733
|
+
|
10734
|
+
// Handle event binding
|
10735
|
+
jQuery.fn[ name ] = function( data, fn ) {
|
10736
|
+
return arguments.length > 0 ?
|
10737
|
+
this.on( name, null, data, fn ) :
|
10738
|
+
this.trigger( name );
|
10739
|
+
};
|
10740
|
+
} );
|
10741
|
+
|
10742
|
+
|
10743
|
+
|
10744
|
+
|
10745
|
+
// Support: Android <=4.0 only
|
10746
|
+
// Make sure we trim BOM and NBSP
|
10747
|
+
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
10748
|
+
|
10749
|
+
// Bind a function to a context, optionally partially applying any
|
10750
|
+
// arguments.
|
10751
|
+
// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
|
10752
|
+
// However, it is not slated for removal any time soon
|
10753
|
+
jQuery.proxy = function( fn, context ) {
|
10754
|
+
var tmp, args, proxy;
|
10755
|
+
|
10756
|
+
if ( typeof context === "string" ) {
|
10757
|
+
tmp = fn[ context ];
|
10758
|
+
context = fn;
|
10759
|
+
fn = tmp;
|
10760
|
+
}
|
10761
|
+
|
10762
|
+
// Quick check to determine if target is callable, in the spec
|
10763
|
+
// this throws a TypeError, but we will just return undefined.
|
10764
|
+
if ( !isFunction( fn ) ) {
|
10765
|
+
return undefined;
|
10766
|
+
}
|
10767
|
+
|
10768
|
+
// Simulated bind
|
10769
|
+
args = slice.call( arguments, 2 );
|
10770
|
+
proxy = function() {
|
10771
|
+
return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
|
10772
|
+
};
|
10773
|
+
|
10774
|
+
// Set the guid of unique handler to the same of original handler, so it can be removed
|
10775
|
+
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
10776
|
+
|
10777
|
+
return proxy;
|
10778
|
+
};
|
10779
|
+
|
10186
10780
|
jQuery.holdReady = function( hold ) {
|
10187
10781
|
if ( hold ) {
|
10188
10782
|
jQuery.readyWait++;
|
@@ -10193,7 +10787,32 @@ jQuery.holdReady = function( hold ) {
|
|
10193
10787
|
jQuery.isArray = Array.isArray;
|
10194
10788
|
jQuery.parseJSON = JSON.parse;
|
10195
10789
|
jQuery.nodeName = nodeName;
|
10790
|
+
jQuery.isFunction = isFunction;
|
10791
|
+
jQuery.isWindow = isWindow;
|
10792
|
+
jQuery.camelCase = camelCase;
|
10793
|
+
jQuery.type = toType;
|
10794
|
+
|
10795
|
+
jQuery.now = Date.now;
|
10796
|
+
|
10797
|
+
jQuery.isNumeric = function( obj ) {
|
10196
10798
|
|
10799
|
+
// As of jQuery 3.0, isNumeric is limited to
|
10800
|
+
// strings and numbers (primitives or objects)
|
10801
|
+
// that can be coerced to finite numbers (gh-2662)
|
10802
|
+
var type = jQuery.type( obj );
|
10803
|
+
return ( type === "number" || type === "string" ) &&
|
10804
|
+
|
10805
|
+
// parseFloat NaNs numeric-cast false positives ("")
|
10806
|
+
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
10807
|
+
// subtraction forces infinities to NaN
|
10808
|
+
!isNaN( obj - parseFloat( obj ) );
|
10809
|
+
};
|
10810
|
+
|
10811
|
+
jQuery.trim = function( text ) {
|
10812
|
+
return text == null ?
|
10813
|
+
"" :
|
10814
|
+
( text + "" ).replace( rtrim, "" );
|
10815
|
+
};
|
10197
10816
|
|
10198
10817
|
|
10199
10818
|
|
@@ -10242,7 +10861,7 @@ jQuery.noConflict = function( deep ) {
|
|
10242
10861
|
// Expose jQuery and $ identifiers, even in AMD
|
10243
10862
|
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
|
10244
10863
|
// and CommonJS for browser emulators (#13566)
|
10245
|
-
if (
|
10864
|
+
if ( typeof noGlobal === "undefined" ) {
|
10246
10865
|
window.jQuery = window.$ = jQuery;
|
10247
10866
|
}
|
10248
10867
|
|