jquery-rails 4.3.5 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/CHANGELOG.md +22 -1
- data/VERSIONS.md +4 -0
- data/lib/jquery/assert_select.rb +2 -0
- data/lib/jquery/rails/version.rb +3 -3
- data/test/assert_select_jquery_test.rb +6 -0
- data/vendor/assets/javascripts/jquery3.js +1503 -1397
- data/vendor/assets/javascripts/jquery3.min.js +2 -2
- data/vendor/assets/javascripts/jquery3.min.map +1 -1
- data/vendor/assets/javascripts/jquery_ujs.js +18 -8
- metadata +6 -6
@@ -1,15 +1,12 @@
|
|
1
1
|
/*!
|
2
|
-
* jQuery JavaScript Library v3.
|
2
|
+
* jQuery JavaScript Library v3.7.0
|
3
3
|
* https://jquery.com/
|
4
4
|
*
|
5
|
-
*
|
6
|
-
* https://sizzlejs.com/
|
7
|
-
*
|
8
|
-
* Copyright JS Foundation and other contributors
|
5
|
+
* Copyright OpenJS Foundation and other contributors
|
9
6
|
* Released under the MIT license
|
10
7
|
* https://jquery.org/license
|
11
8
|
*
|
12
|
-
* Date:
|
9
|
+
* Date: 2023-05-11T18:29Z
|
13
10
|
*/
|
14
11
|
( function( global, factory ) {
|
15
12
|
|
@@ -23,7 +20,7 @@
|
|
23
20
|
// (such as Node.js), expose a factory as module.exports.
|
24
21
|
// This accentuates the need for the creation of a real `window`.
|
25
22
|
// e.g. var jQuery = require("jquery")(window);
|
26
|
-
// See ticket
|
23
|
+
// See ticket trac-14549 for more info.
|
27
24
|
module.exports = global.document ?
|
28
25
|
factory( global, true ) :
|
29
26
|
function( w ) {
|
@@ -47,13 +44,16 @@
|
|
47
44
|
|
48
45
|
var arr = [];
|
49
46
|
|
50
|
-
var document = window.document;
|
51
|
-
|
52
47
|
var getProto = Object.getPrototypeOf;
|
53
48
|
|
54
49
|
var slice = arr.slice;
|
55
50
|
|
56
|
-
var
|
51
|
+
var flat = arr.flat ? function( array ) {
|
52
|
+
return arr.flat.call( array );
|
53
|
+
} : function( array ) {
|
54
|
+
return arr.concat.apply( [], array );
|
55
|
+
};
|
56
|
+
|
57
57
|
|
58
58
|
var push = arr.push;
|
59
59
|
|
@@ -73,12 +73,16 @@ var support = {};
|
|
73
73
|
|
74
74
|
var isFunction = function isFunction( obj ) {
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
// Support: Chrome <=57, Firefox <=52
|
77
|
+
// In some browsers, typeof returns "function" for HTML <object> elements
|
78
|
+
// (i.e., `typeof document.createElement( "object" ) === "function"`).
|
79
|
+
// We don't want to classify *any* DOM node as a function.
|
80
|
+
// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
|
81
|
+
// Plus for old WebKit, typeof returns "function" for HTML collections
|
82
|
+
// (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
|
83
|
+
return typeof obj === "function" && typeof obj.nodeType !== "number" &&
|
84
|
+
typeof obj.item !== "function";
|
85
|
+
};
|
82
86
|
|
83
87
|
|
84
88
|
var isWindow = function isWindow( obj ) {
|
@@ -86,6 +90,8 @@ var isWindow = function isWindow( obj ) {
|
|
86
90
|
};
|
87
91
|
|
88
92
|
|
93
|
+
var document = window.document;
|
94
|
+
|
89
95
|
|
90
96
|
|
91
97
|
var preservedScriptAttributes = {
|
@@ -141,8 +147,9 @@ function toType( obj ) {
|
|
141
147
|
|
142
148
|
|
143
149
|
|
144
|
-
var
|
145
|
-
|
150
|
+
var version = "3.7.0",
|
151
|
+
|
152
|
+
rhtmlSuffix = /HTML$/i,
|
146
153
|
|
147
154
|
// Define a local copy of jQuery
|
148
155
|
jQuery = function( selector, context ) {
|
@@ -150,11 +157,7 @@ var
|
|
150
157
|
// The jQuery object is actually just the init constructor 'enhanced'
|
151
158
|
// Need init if jQuery is called (just allow error to be thrown if not included)
|
152
159
|
return new jQuery.fn.init( selector, context );
|
153
|
-
}
|
154
|
-
|
155
|
-
// Support: Android <=4.0 only
|
156
|
-
// Make sure we trim BOM and NBSP
|
157
|
-
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
160
|
+
};
|
158
161
|
|
159
162
|
jQuery.fn = jQuery.prototype = {
|
160
163
|
|
@@ -220,6 +223,18 @@ jQuery.fn = jQuery.prototype = {
|
|
220
223
|
return this.eq( -1 );
|
221
224
|
},
|
222
225
|
|
226
|
+
even: function() {
|
227
|
+
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
|
228
|
+
return ( i + 1 ) % 2;
|
229
|
+
} ) );
|
230
|
+
},
|
231
|
+
|
232
|
+
odd: function() {
|
233
|
+
return this.pushStack( jQuery.grep( this, function( _elem, i ) {
|
234
|
+
return i % 2;
|
235
|
+
} ) );
|
236
|
+
},
|
237
|
+
|
223
238
|
eq: function( i ) {
|
224
239
|
var len = this.length,
|
225
240
|
j = +i + ( i < 0 ? len : 0 );
|
@@ -353,9 +368,10 @@ jQuery.extend( {
|
|
353
368
|
return true;
|
354
369
|
},
|
355
370
|
|
356
|
-
// Evaluates a script in a global
|
357
|
-
|
358
|
-
|
371
|
+
// Evaluates a script in a provided context; falls back to the global one
|
372
|
+
// if not specified.
|
373
|
+
globalEval: function( code, options, doc ) {
|
374
|
+
DOMEval( code, { nonce: options && options.nonce }, doc );
|
359
375
|
},
|
360
376
|
|
361
377
|
each: function( obj, callback ) {
|
@@ -379,11 +395,31 @@ jQuery.extend( {
|
|
379
395
|
return obj;
|
380
396
|
},
|
381
397
|
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
398
|
+
|
399
|
+
// Retrieve the text value of an array of DOM nodes
|
400
|
+
text: function( elem ) {
|
401
|
+
var node,
|
402
|
+
ret = "",
|
403
|
+
i = 0,
|
404
|
+
nodeType = elem.nodeType;
|
405
|
+
|
406
|
+
if ( !nodeType ) {
|
407
|
+
|
408
|
+
// If no nodeType, this is expected to be an array
|
409
|
+
while ( ( node = elem[ i++ ] ) ) {
|
410
|
+
|
411
|
+
// Do not traverse comment nodes
|
412
|
+
ret += jQuery.text( node );
|
413
|
+
}
|
414
|
+
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
|
415
|
+
return elem.textContent;
|
416
|
+
} else if ( nodeType === 3 || nodeType === 4 ) {
|
417
|
+
return elem.nodeValue;
|
418
|
+
}
|
419
|
+
|
420
|
+
// Do not include comment or processing instruction nodes
|
421
|
+
|
422
|
+
return ret;
|
387
423
|
},
|
388
424
|
|
389
425
|
// results is for internal usage only
|
@@ -394,7 +430,7 @@ jQuery.extend( {
|
|
394
430
|
if ( isArrayLike( Object( arr ) ) ) {
|
395
431
|
jQuery.merge( ret,
|
396
432
|
typeof arr === "string" ?
|
397
|
-
|
433
|
+
[ arr ] : arr
|
398
434
|
);
|
399
435
|
} else {
|
400
436
|
push.call( ret, arr );
|
@@ -408,6 +444,15 @@ jQuery.extend( {
|
|
408
444
|
return arr == null ? -1 : indexOf.call( arr, elem, i );
|
409
445
|
},
|
410
446
|
|
447
|
+
isXMLDoc: function( elem ) {
|
448
|
+
var namespace = elem && elem.namespaceURI,
|
449
|
+
docElem = elem && ( elem.ownerDocument || elem ).documentElement;
|
450
|
+
|
451
|
+
// Assume HTML when documentElement doesn't yet exist, such as inside
|
452
|
+
// document fragments.
|
453
|
+
return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" );
|
454
|
+
},
|
455
|
+
|
411
456
|
// Support: Android <=4.0 only, PhantomJS 1 only
|
412
457
|
// push.apply(_, arraylike) throws on ancient WebKit
|
413
458
|
merge: function( first, second ) {
|
@@ -472,7 +517,7 @@ jQuery.extend( {
|
|
472
517
|
}
|
473
518
|
|
474
519
|
// Flatten any nested arrays
|
475
|
-
return
|
520
|
+
return flat( ret );
|
476
521
|
},
|
477
522
|
|
478
523
|
// A global GUID counter for objects
|
@@ -489,9 +534,9 @@ if ( typeof Symbol === "function" ) {
|
|
489
534
|
|
490
535
|
// Populate the class2type map
|
491
536
|
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
|
492
|
-
function(
|
493
|
-
|
494
|
-
} );
|
537
|
+
function( _i, name ) {
|
538
|
+
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
539
|
+
} );
|
495
540
|
|
496
541
|
function isArrayLike( obj ) {
|
497
542
|
|
@@ -509,44 +554,98 @@ function isArrayLike( obj ) {
|
|
509
554
|
return type === "array" || length === 0 ||
|
510
555
|
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
|
511
556
|
}
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
557
|
+
|
558
|
+
|
559
|
+
function nodeName( elem, name ) {
|
560
|
+
|
561
|
+
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
562
|
+
|
563
|
+
}
|
564
|
+
var pop = arr.pop;
|
565
|
+
|
566
|
+
|
567
|
+
var sort = arr.sort;
|
568
|
+
|
569
|
+
|
570
|
+
var splice = arr.splice;
|
571
|
+
|
572
|
+
|
573
|
+
var whitespace = "[\\x20\\t\\r\\n\\f]";
|
574
|
+
|
575
|
+
|
576
|
+
var rtrimCSS = new RegExp(
|
577
|
+
"^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
|
578
|
+
"g"
|
579
|
+
);
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
// Note: an element does not contain itself
|
585
|
+
jQuery.contains = function( a, b ) {
|
586
|
+
var bup = b && b.parentNode;
|
587
|
+
|
588
|
+
return a === bup || !!( bup && bup.nodeType === 1 && (
|
589
|
+
|
590
|
+
// Support: IE 9 - 11+
|
591
|
+
// IE doesn't have `contains` on SVG.
|
592
|
+
a.contains ?
|
593
|
+
a.contains( bup ) :
|
594
|
+
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
|
595
|
+
) );
|
596
|
+
};
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
// CSS string/identifier serialization
|
602
|
+
// https://drafts.csswg.org/cssom/#common-serializing-idioms
|
603
|
+
var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
|
604
|
+
|
605
|
+
function fcssescape( ch, asCodePoint ) {
|
606
|
+
if ( asCodePoint ) {
|
607
|
+
|
608
|
+
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
|
609
|
+
if ( ch === "\0" ) {
|
610
|
+
return "\uFFFD";
|
611
|
+
}
|
612
|
+
|
613
|
+
// Control characters and (dependent upon position) numbers get escaped as code points
|
614
|
+
return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
|
615
|
+
}
|
616
|
+
|
617
|
+
// Other potentially-special ASCII characters get backslash-escaped
|
618
|
+
return "\\" + ch;
|
619
|
+
}
|
620
|
+
|
621
|
+
jQuery.escapeSelector = function( sel ) {
|
622
|
+
return ( sel + "" ).replace( rcssescape, fcssescape );
|
623
|
+
};
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
var preferredDoc = document,
|
629
|
+
pushNative = push;
|
630
|
+
|
631
|
+
( function() {
|
524
632
|
|
525
633
|
var i,
|
526
|
-
support,
|
527
634
|
Expr,
|
528
|
-
getText,
|
529
|
-
isXML,
|
530
|
-
tokenize,
|
531
|
-
compile,
|
532
|
-
select,
|
533
635
|
outermostContext,
|
534
636
|
sortInput,
|
535
637
|
hasDuplicate,
|
638
|
+
push = pushNative,
|
536
639
|
|
537
640
|
// Local document vars
|
538
|
-
setDocument,
|
539
641
|
document,
|
540
|
-
|
642
|
+
documentElement,
|
541
643
|
documentIsHTML,
|
542
644
|
rbuggyQSA,
|
543
|
-
rbuggyMatches,
|
544
645
|
matches,
|
545
|
-
contains,
|
546
646
|
|
547
647
|
// Instance-specific data
|
548
|
-
expando =
|
549
|
-
preferredDoc = window.document,
|
648
|
+
expando = jQuery.expando,
|
550
649
|
dirruns = 0,
|
551
650
|
done = 0,
|
552
651
|
classCache = createCache(),
|
@@ -560,173 +659,145 @@ var i,
|
|
560
659
|
return 0;
|
561
660
|
},
|
562
661
|
|
563
|
-
|
564
|
-
|
565
|
-
arr = [],
|
566
|
-
pop = arr.pop,
|
567
|
-
push_native = arr.push,
|
568
|
-
push = arr.push,
|
569
|
-
slice = arr.slice,
|
570
|
-
// Use a stripped-down indexOf as it's faster than native
|
571
|
-
// https://jsperf.com/thor-indexof-vs-for/5
|
572
|
-
indexOf = function( list, elem ) {
|
573
|
-
var i = 0,
|
574
|
-
len = list.length;
|
575
|
-
for ( ; i < len; i++ ) {
|
576
|
-
if ( list[i] === elem ) {
|
577
|
-
return i;
|
578
|
-
}
|
579
|
-
}
|
580
|
-
return -1;
|
581
|
-
},
|
582
|
-
|
583
|
-
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
|
662
|
+
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
|
663
|
+
"loop|multiple|open|readonly|required|scoped",
|
584
664
|
|
585
665
|
// Regular expressions
|
586
666
|
|
587
|
-
//
|
588
|
-
|
589
|
-
|
590
|
-
// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
|
591
|
-
identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
|
667
|
+
// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
|
668
|
+
identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
|
669
|
+
"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
|
592
670
|
|
593
|
-
// Attribute selectors:
|
671
|
+
// Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
|
594
672
|
attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
|
673
|
+
|
595
674
|
// Operator (capture 2)
|
596
675
|
"*([*^$|!~]?=)" + whitespace +
|
676
|
+
|
597
677
|
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
|
598
|
-
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
|
599
|
-
"*\\]",
|
678
|
+
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
|
679
|
+
whitespace + "*\\]",
|
600
680
|
|
601
681
|
pseudos = ":(" + identifier + ")(?:\\((" +
|
682
|
+
|
602
683
|
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
|
603
684
|
// 1. quoted (capture 3; capture 4 or capture 5)
|
604
685
|
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
|
686
|
+
|
605
687
|
// 2. simple (capture 6)
|
606
688
|
"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
|
689
|
+
|
607
690
|
// 3. anything else (capture 2)
|
608
691
|
".*" +
|
609
692
|
")\\)|)",
|
610
693
|
|
611
694
|
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
|
612
695
|
rwhitespace = new RegExp( whitespace + "+", "g" ),
|
613
|
-
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
|
614
696
|
|
615
697
|
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
|
616
|
-
|
698
|
+
rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
|
699
|
+
whitespace + "*" ),
|
617
700
|
rdescend = new RegExp( whitespace + "|>" ),
|
618
701
|
|
619
702
|
rpseudo = new RegExp( pseudos ),
|
620
703
|
ridentifier = new RegExp( "^" + identifier + "$" ),
|
621
704
|
|
622
705
|
matchExpr = {
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
"
|
630
|
-
|
631
|
-
|
706
|
+
ID: new RegExp( "^#(" + identifier + ")" ),
|
707
|
+
CLASS: new RegExp( "^\\.(" + identifier + ")" ),
|
708
|
+
TAG: new RegExp( "^(" + identifier + "|[*])" ),
|
709
|
+
ATTR: new RegExp( "^" + attributes ),
|
710
|
+
PSEUDO: new RegExp( "^" + pseudos ),
|
711
|
+
CHILD: new RegExp(
|
712
|
+
"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
|
713
|
+
whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
|
714
|
+
whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
|
715
|
+
bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
|
716
|
+
|
632
717
|
// For use in libraries implementing .is()
|
633
718
|
// We use this for POS matching in `select`
|
634
|
-
|
635
|
-
|
719
|
+
needsContext: new RegExp( "^" + whitespace +
|
720
|
+
"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
|
721
|
+
"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
|
636
722
|
},
|
637
723
|
|
638
|
-
rhtml = /HTML$/i,
|
639
724
|
rinputs = /^(?:input|select|textarea|button)$/i,
|
640
725
|
rheader = /^h\d$/i,
|
641
726
|
|
642
|
-
rnative = /^[^{]+\{\s*\[native \w/,
|
643
|
-
|
644
727
|
// Easily-parseable/retrievable ID or TAG or CLASS selectors
|
645
728
|
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
646
729
|
|
647
730
|
rsibling = /[+~]/,
|
648
731
|
|
649
732
|
// CSS escapes
|
650
|
-
//
|
651
|
-
runescape = new RegExp( "\\\\
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
// Support: Firefox<24
|
656
|
-
// Workaround erroneous numeric interpretation of +"0x"
|
657
|
-
return high !== high || escapedWhitespace ?
|
658
|
-
escaped :
|
659
|
-
high < 0 ?
|
660
|
-
// BMP codepoint
|
661
|
-
String.fromCharCode( high + 0x10000 ) :
|
662
|
-
// Supplemental Plane codepoint (surrogate pair)
|
663
|
-
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
664
|
-
},
|
733
|
+
// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
|
734
|
+
runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
|
735
|
+
"?|\\\\([^\\r\\n\\f])", "g" ),
|
736
|
+
funescape = function( escape, nonHex ) {
|
737
|
+
var high = "0x" + escape.slice( 1 ) - 0x10000;
|
665
738
|
|
666
|
-
|
667
|
-
// https://drafts.csswg.org/cssom/#common-serializing-idioms
|
668
|
-
rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
|
669
|
-
fcssescape = function( ch, asCodePoint ) {
|
670
|
-
if ( asCodePoint ) {
|
739
|
+
if ( nonHex ) {
|
671
740
|
|
672
|
-
//
|
673
|
-
|
674
|
-
return "\uFFFD";
|
675
|
-
}
|
676
|
-
|
677
|
-
// Control characters and (dependent upon position) numbers get escaped as code points
|
678
|
-
return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
|
741
|
+
// Strip the backslash prefix from a non-hex escape sequence
|
742
|
+
return nonHex;
|
679
743
|
}
|
680
744
|
|
681
|
-
//
|
682
|
-
|
745
|
+
// Replace a hexadecimal escape sequence with the encoded Unicode code point
|
746
|
+
// Support: IE <=11+
|
747
|
+
// For values outside the Basic Multilingual Plane (BMP), manually construct a
|
748
|
+
// surrogate pair
|
749
|
+
return high < 0 ?
|
750
|
+
String.fromCharCode( high + 0x10000 ) :
|
751
|
+
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
683
752
|
},
|
684
753
|
|
685
|
-
// Used for iframes
|
686
|
-
//
|
754
|
+
// Used for iframes; see `setDocument`.
|
755
|
+
// Support: IE 9 - 11+, Edge 12 - 18+
|
687
756
|
// Removing the function wrapper causes a "Permission Denied"
|
688
|
-
// error in IE
|
757
|
+
// error in IE/Edge.
|
689
758
|
unloadHandler = function() {
|
690
759
|
setDocument();
|
691
760
|
},
|
692
761
|
|
693
762
|
inDisabledFieldset = addCombinator(
|
694
763
|
function( elem ) {
|
695
|
-
return elem.disabled === true &&
|
764
|
+
return elem.disabled === true && nodeName( elem, "fieldset" );
|
696
765
|
},
|
697
766
|
{ dir: "parentNode", next: "legend" }
|
698
767
|
);
|
699
768
|
|
769
|
+
// Support: IE <=9 only
|
770
|
+
// Accessing document.activeElement can throw unexpectedly
|
771
|
+
// https://bugs.jquery.com/ticket/13393
|
772
|
+
function safeActiveElement() {
|
773
|
+
try {
|
774
|
+
return document.activeElement;
|
775
|
+
} catch ( err ) { }
|
776
|
+
}
|
777
|
+
|
700
778
|
// Optimize for push.apply( _, NodeList )
|
701
779
|
try {
|
702
780
|
push.apply(
|
703
|
-
(arr = slice.call( preferredDoc.childNodes )),
|
781
|
+
( arr = slice.call( preferredDoc.childNodes ) ),
|
704
782
|
preferredDoc.childNodes
|
705
783
|
);
|
706
|
-
|
784
|
+
|
785
|
+
// Support: Android <=4.0
|
707
786
|
// Detect silently failing push.apply
|
787
|
+
// eslint-disable-next-line no-unused-expressions
|
708
788
|
arr[ preferredDoc.childNodes.length ].nodeType;
|
709
789
|
} catch ( e ) {
|
710
|
-
push = {
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
// Support: IE<9
|
718
|
-
// Otherwise append directly
|
719
|
-
function( target, els ) {
|
720
|
-
var j = target.length,
|
721
|
-
i = 0;
|
722
|
-
// Can't trust NodeList.length
|
723
|
-
while ( (target[j++] = els[i++]) ) {}
|
724
|
-
target.length = j - 1;
|
790
|
+
push = {
|
791
|
+
apply: function( target, els ) {
|
792
|
+
pushNative.apply( target, slice.call( els ) );
|
793
|
+
},
|
794
|
+
call: function( target ) {
|
795
|
+
pushNative.apply( target, slice.call( arguments, 1 ) );
|
725
796
|
}
|
726
797
|
};
|
727
798
|
}
|
728
799
|
|
729
|
-
function
|
800
|
+
function find( selector, context, results, seed ) {
|
730
801
|
var m, i, elem, nid, match, groups, newSelector,
|
731
802
|
newContext = context && context.ownerDocument,
|
732
803
|
|
@@ -744,30 +815,26 @@ function Sizzle( selector, context, results, seed ) {
|
|
744
815
|
|
745
816
|
// Try to shortcut find operations (as opposed to filters) in HTML documents
|
746
817
|
if ( !seed ) {
|
747
|
-
|
748
|
-
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
|
749
|
-
setDocument( context );
|
750
|
-
}
|
818
|
+
setDocument( context );
|
751
819
|
context = context || document;
|
752
820
|
|
753
821
|
if ( documentIsHTML ) {
|
754
822
|
|
755
823
|
// If the selector is sufficiently simple, try using a "get*By*" DOM method
|
756
824
|
// (excepting DocumentFragment context, where the methods don't exist)
|
757
|
-
if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
|
825
|
+
if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
|
758
826
|
|
759
827
|
// ID selector
|
760
|
-
if ( (m = match[1]) ) {
|
828
|
+
if ( ( m = match[ 1 ] ) ) {
|
761
829
|
|
762
830
|
// Document context
|
763
831
|
if ( nodeType === 9 ) {
|
764
|
-
if ( (elem = context.getElementById( m )) ) {
|
832
|
+
if ( ( elem = context.getElementById( m ) ) ) {
|
765
833
|
|
766
|
-
// Support: IE
|
767
|
-
// TODO: identify versions
|
834
|
+
// Support: IE 9 only
|
768
835
|
// getElementById can match elements by name instead of ID
|
769
836
|
if ( elem.id === m ) {
|
770
|
-
|
837
|
+
push.call( results, elem );
|
771
838
|
return results;
|
772
839
|
}
|
773
840
|
} else {
|
@@ -777,40 +844,32 @@ function Sizzle( selector, context, results, seed ) {
|
|
777
844
|
// Element context
|
778
845
|
} else {
|
779
846
|
|
780
|
-
// Support: IE
|
781
|
-
// TODO: identify versions
|
847
|
+
// Support: IE 9 only
|
782
848
|
// getElementById can match elements by name instead of ID
|
783
|
-
if ( newContext && (elem = newContext.getElementById( m )) &&
|
784
|
-
contains( context, elem ) &&
|
849
|
+
if ( newContext && ( elem = newContext.getElementById( m ) ) &&
|
850
|
+
find.contains( context, elem ) &&
|
785
851
|
elem.id === m ) {
|
786
852
|
|
787
|
-
|
853
|
+
push.call( results, elem );
|
788
854
|
return results;
|
789
855
|
}
|
790
856
|
}
|
791
857
|
|
792
858
|
// Type selector
|
793
|
-
} else if ( match[2] ) {
|
859
|
+
} else if ( match[ 2 ] ) {
|
794
860
|
push.apply( results, context.getElementsByTagName( selector ) );
|
795
861
|
return results;
|
796
862
|
|
797
863
|
// Class selector
|
798
|
-
} else if ( (m = match[3]) &&
|
799
|
-
context.getElementsByClassName ) {
|
800
|
-
|
864
|
+
} else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {
|
801
865
|
push.apply( results, context.getElementsByClassName( m ) );
|
802
866
|
return results;
|
803
867
|
}
|
804
868
|
}
|
805
869
|
|
806
870
|
// Take advantage of querySelectorAll
|
807
|
-
if (
|
808
|
-
!
|
809
|
-
(!rbuggyQSA || !rbuggyQSA.test( selector )) &&
|
810
|
-
|
811
|
-
// Support: IE 8 only
|
812
|
-
// Exclude object elements
|
813
|
-
(nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
|
871
|
+
if ( !nonnativeSelectorCache[ selector + " " ] &&
|
872
|
+
( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {
|
814
873
|
|
815
874
|
newSelector = selector;
|
816
875
|
newContext = context;
|
@@ -819,27 +878,40 @@ function Sizzle( selector, context, results, seed ) {
|
|
819
878
|
// descendant combinators, which is not what we want.
|
820
879
|
// In such cases, we work around the behavior by prefixing every selector in the
|
821
880
|
// list with an ID selector referencing the scope context.
|
881
|
+
// The technique has to be used as well when a leading combinator is used
|
882
|
+
// as such selectors are not recognized by querySelectorAll.
|
822
883
|
// Thanks to Andrew Dupont for this technique.
|
823
|
-
if ( nodeType === 1 &&
|
884
|
+
if ( nodeType === 1 &&
|
885
|
+
( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
|
824
886
|
|
825
|
-
//
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
887
|
+
// Expand context for sibling selectors
|
888
|
+
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
|
889
|
+
context;
|
890
|
+
|
891
|
+
// We can use :scope instead of the ID hack if the browser
|
892
|
+
// supports it & if we're not changing the context.
|
893
|
+
// Support: IE 11+, Edge 17 - 18+
|
894
|
+
// IE/Edge sometimes throw a "Permission denied" error when
|
895
|
+
// strict-comparing two documents; shallow comparisons work.
|
896
|
+
// eslint-disable-next-line eqeqeq
|
897
|
+
if ( newContext != context || !support.scope ) {
|
898
|
+
|
899
|
+
// Capture the context ID, setting it first if necessary
|
900
|
+
if ( ( nid = context.getAttribute( "id" ) ) ) {
|
901
|
+
nid = jQuery.escapeSelector( nid );
|
902
|
+
} else {
|
903
|
+
context.setAttribute( "id", ( nid = expando ) );
|
904
|
+
}
|
830
905
|
}
|
831
906
|
|
832
907
|
// Prefix every selector in the list
|
833
908
|
groups = tokenize( selector );
|
834
909
|
i = groups.length;
|
835
910
|
while ( i-- ) {
|
836
|
-
groups[i] = "#" + nid
|
911
|
+
groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
|
912
|
+
toSelector( groups[ i ] );
|
837
913
|
}
|
838
914
|
newSelector = groups.join( "," );
|
839
|
-
|
840
|
-
// Expand context for sibling selectors
|
841
|
-
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
|
842
|
-
context;
|
843
915
|
}
|
844
916
|
|
845
917
|
try {
|
@@ -859,7 +931,7 @@ function Sizzle( selector, context, results, seed ) {
|
|
859
931
|
}
|
860
932
|
|
861
933
|
// All others
|
862
|
-
return select( selector.replace(
|
934
|
+
return select( selector.replace( rtrimCSS, "$1" ), context, results, seed );
|
863
935
|
}
|
864
936
|
|
865
937
|
/**
|
@@ -872,18 +944,21 @@ function createCache() {
|
|
872
944
|
var keys = [];
|
873
945
|
|
874
946
|
function cache( key, value ) {
|
875
|
-
|
947
|
+
|
948
|
+
// Use (key + " ") to avoid collision with native prototype properties
|
949
|
+
// (see https://github.com/jquery/sizzle/issues/157)
|
876
950
|
if ( keys.push( key + " " ) > Expr.cacheLength ) {
|
951
|
+
|
877
952
|
// Only keep the most recent entries
|
878
953
|
delete cache[ keys.shift() ];
|
879
954
|
}
|
880
|
-
return (cache[ key + " " ] = value);
|
955
|
+
return ( cache[ key + " " ] = value );
|
881
956
|
}
|
882
957
|
return cache;
|
883
958
|
}
|
884
959
|
|
885
960
|
/**
|
886
|
-
* Mark a function for special use by
|
961
|
+
* Mark a function for special use by jQuery selector module
|
887
962
|
* @param {Function} fn The function to mark
|
888
963
|
*/
|
889
964
|
function markFunction( fn ) {
|
@@ -896,72 +971,31 @@ function markFunction( fn ) {
|
|
896
971
|
* @param {Function} fn Passed the created element and returns a boolean result
|
897
972
|
*/
|
898
973
|
function assert( fn ) {
|
899
|
-
var el = document.createElement("fieldset");
|
974
|
+
var el = document.createElement( "fieldset" );
|
900
975
|
|
901
976
|
try {
|
902
977
|
return !!fn( el );
|
903
|
-
} catch (e) {
|
978
|
+
} catch ( e ) {
|
904
979
|
return false;
|
905
980
|
} finally {
|
981
|
+
|
906
982
|
// Remove from its parent by default
|
907
983
|
if ( el.parentNode ) {
|
908
984
|
el.parentNode.removeChild( el );
|
909
985
|
}
|
986
|
+
|
910
987
|
// release memory in IE
|
911
988
|
el = null;
|
912
989
|
}
|
913
990
|
}
|
914
991
|
|
915
|
-
/**
|
916
|
-
* Adds the same handler for all of the specified attrs
|
917
|
-
* @param {String} attrs Pipe-separated list of attributes
|
918
|
-
* @param {Function} handler The method that will be applied
|
919
|
-
*/
|
920
|
-
function addHandle( attrs, handler ) {
|
921
|
-
var arr = attrs.split("|"),
|
922
|
-
i = arr.length;
|
923
|
-
|
924
|
-
while ( i-- ) {
|
925
|
-
Expr.attrHandle[ arr[i] ] = handler;
|
926
|
-
}
|
927
|
-
}
|
928
|
-
|
929
|
-
/**
|
930
|
-
* Checks document order of two siblings
|
931
|
-
* @param {Element} a
|
932
|
-
* @param {Element} b
|
933
|
-
* @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
|
934
|
-
*/
|
935
|
-
function siblingCheck( a, b ) {
|
936
|
-
var cur = b && a,
|
937
|
-
diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
|
938
|
-
a.sourceIndex - b.sourceIndex;
|
939
|
-
|
940
|
-
// Use IE sourceIndex if available on both nodes
|
941
|
-
if ( diff ) {
|
942
|
-
return diff;
|
943
|
-
}
|
944
|
-
|
945
|
-
// Check if b follows a
|
946
|
-
if ( cur ) {
|
947
|
-
while ( (cur = cur.nextSibling) ) {
|
948
|
-
if ( cur === b ) {
|
949
|
-
return -1;
|
950
|
-
}
|
951
|
-
}
|
952
|
-
}
|
953
|
-
|
954
|
-
return a ? 1 : -1;
|
955
|
-
}
|
956
|
-
|
957
992
|
/**
|
958
993
|
* Returns a function to use in pseudos for input types
|
959
994
|
* @param {String} type
|
960
995
|
*/
|
961
996
|
function createInputPseudo( type ) {
|
962
997
|
return function( elem ) {
|
963
|
-
|
964
|
-
return name === "input" && elem.type === type;
|
998
|
+
return nodeName( elem, "input" ) && elem.type === type;
|
965
999
|
};
|
966
1000
|
}
|
967
1001
|
|
@@ -971,8 +1005,8 @@ function createInputPseudo( type ) {
|
|
971
1005
|
*/
|
972
1006
|
function createButtonPseudo( type ) {
|
973
1007
|
return function( elem ) {
|
974
|
-
|
975
|
-
|
1008
|
+
return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) &&
|
1009
|
+
elem.type === type;
|
976
1010
|
};
|
977
1011
|
}
|
978
1012
|
|
@@ -1008,12 +1042,11 @@ function createDisabledPseudo( disabled ) {
|
|
1008
1042
|
}
|
1009
1043
|
}
|
1010
1044
|
|
1011
|
-
// Support: IE 6 - 11
|
1045
|
+
// Support: IE 6 - 11+
|
1012
1046
|
// Use the isDisabled shortcut property to check for disabled fieldset ancestors
|
1013
1047
|
return elem.isDisabled === disabled ||
|
1014
1048
|
|
1015
1049
|
// Where there is no isDisabled, check manually
|
1016
|
-
/* jshint -W018 */
|
1017
1050
|
elem.isDisabled !== !disabled &&
|
1018
1051
|
inDisabledFieldset( elem ) === disabled;
|
1019
1052
|
}
|
@@ -1037,25 +1070,25 @@ function createDisabledPseudo( disabled ) {
|
|
1037
1070
|
* @param {Function} fn
|
1038
1071
|
*/
|
1039
1072
|
function createPositionalPseudo( fn ) {
|
1040
|
-
return markFunction(function( argument ) {
|
1073
|
+
return markFunction( function( argument ) {
|
1041
1074
|
argument = +argument;
|
1042
|
-
return markFunction(function( seed, matches ) {
|
1075
|
+
return markFunction( function( seed, matches ) {
|
1043
1076
|
var j,
|
1044
1077
|
matchIndexes = fn( [], seed.length, argument ),
|
1045
1078
|
i = matchIndexes.length;
|
1046
1079
|
|
1047
1080
|
// Match elements found at the specified indexes
|
1048
1081
|
while ( i-- ) {
|
1049
|
-
if ( seed[ (j = matchIndexes[i]) ] ) {
|
1050
|
-
seed[j] = !(matches[j] = seed[j]);
|
1082
|
+
if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
|
1083
|
+
seed[ j ] = !( matches[ j ] = seed[ j ] );
|
1051
1084
|
}
|
1052
1085
|
}
|
1053
|
-
});
|
1054
|
-
});
|
1086
|
+
} );
|
1087
|
+
} );
|
1055
1088
|
}
|
1056
1089
|
|
1057
1090
|
/**
|
1058
|
-
* Checks a node for validity as a
|
1091
|
+
* Checks a node for validity as a jQuery selector context
|
1059
1092
|
* @param {Element|Object=} context
|
1060
1093
|
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
|
1061
1094
|
*/
|
@@ -1063,117 +1096,116 @@ function testContext( context ) {
|
|
1063
1096
|
return context && typeof context.getElementsByTagName !== "undefined" && context;
|
1064
1097
|
}
|
1065
1098
|
|
1066
|
-
// Expose support vars for convenience
|
1067
|
-
support = Sizzle.support = {};
|
1068
|
-
|
1069
|
-
/**
|
1070
|
-
* Detects XML nodes
|
1071
|
-
* @param {Element|Object} elem An element or a document
|
1072
|
-
* @returns {Boolean} True iff elem is a non-HTML XML node
|
1073
|
-
*/
|
1074
|
-
isXML = Sizzle.isXML = function( elem ) {
|
1075
|
-
var namespace = elem.namespaceURI,
|
1076
|
-
docElem = (elem.ownerDocument || elem).documentElement;
|
1077
|
-
|
1078
|
-
// Support: IE <=8
|
1079
|
-
// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
|
1080
|
-
// https://bugs.jquery.com/ticket/4833
|
1081
|
-
return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
|
1082
|
-
};
|
1083
|
-
|
1084
1099
|
/**
|
1085
1100
|
* Sets document-related variables once based on the current document
|
1086
|
-
* @param {Element|Object} [
|
1101
|
+
* @param {Element|Object} [node] An element or document object to use to set the document
|
1087
1102
|
* @returns {Object} Returns the current document
|
1088
1103
|
*/
|
1089
|
-
|
1090
|
-
var
|
1104
|
+
function setDocument( node ) {
|
1105
|
+
var subWindow,
|
1091
1106
|
doc = node ? node.ownerDocument || node : preferredDoc;
|
1092
1107
|
|
1093
1108
|
// Return early if doc is invalid or already selected
|
1094
|
-
|
1109
|
+
// Support: IE 11+, Edge 17 - 18+
|
1110
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1111
|
+
// two documents; shallow comparisons work.
|
1112
|
+
// eslint-disable-next-line eqeqeq
|
1113
|
+
if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
|
1095
1114
|
return document;
|
1096
1115
|
}
|
1097
1116
|
|
1098
1117
|
// Update global variables
|
1099
1118
|
document = doc;
|
1100
|
-
|
1101
|
-
documentIsHTML = !
|
1119
|
+
documentElement = document.documentElement;
|
1120
|
+
documentIsHTML = !jQuery.isXMLDoc( document );
|
1102
1121
|
|
1103
|
-
// Support: IE 9-11
|
1104
|
-
//
|
1105
|
-
|
1106
|
-
|
1122
|
+
// Support: iOS 7 only, IE 9 - 11+
|
1123
|
+
// Older browsers didn't support unprefixed `matches`.
|
1124
|
+
matches = documentElement.matches ||
|
1125
|
+
documentElement.webkitMatchesSelector ||
|
1126
|
+
documentElement.msMatchesSelector;
|
1107
1127
|
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1128
|
+
// Support: IE 9 - 11+, Edge 12 - 18+
|
1129
|
+
// Accessing iframe documents after unload throws "permission denied" errors (see trac-13936)
|
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 ( preferredDoc != document &&
|
1135
|
+
( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
|
1111
1136
|
|
1112
|
-
// Support: IE 9 -
|
1113
|
-
|
1114
|
-
subWindow.attachEvent( "onunload", unloadHandler );
|
1115
|
-
}
|
1137
|
+
// Support: IE 9 - 11+, Edge 12 - 18+
|
1138
|
+
subWindow.addEventListener( "unload", unloadHandler );
|
1116
1139
|
}
|
1117
1140
|
|
1118
|
-
|
1119
|
-
---------------------------------------------------------------------- */
|
1120
|
-
|
1121
|
-
// Support: IE<8
|
1122
|
-
// Verify that getAttribute really returns attributes and not properties
|
1123
|
-
// (excepting IE8 booleans)
|
1124
|
-
support.attributes = assert(function( el ) {
|
1125
|
-
el.className = "i";
|
1126
|
-
return !el.getAttribute("className");
|
1127
|
-
});
|
1128
|
-
|
1129
|
-
/* getElement(s)By*
|
1130
|
-
---------------------------------------------------------------------- */
|
1131
|
-
|
1132
|
-
// Check if getElementsByTagName("*") returns only elements
|
1133
|
-
support.getElementsByTagName = assert(function( el ) {
|
1134
|
-
el.appendChild( document.createComment("") );
|
1135
|
-
return !el.getElementsByTagName("*").length;
|
1136
|
-
});
|
1137
|
-
|
1138
|
-
// Support: IE<9
|
1139
|
-
support.getElementsByClassName = rnative.test( document.getElementsByClassName );
|
1140
|
-
|
1141
|
-
// Support: IE<10
|
1141
|
+
// Support: IE <10
|
1142
1142
|
// Check if getElementById returns elements by name
|
1143
1143
|
// The broken getElementById methods don't pick up programmatically-set names,
|
1144
1144
|
// so use a roundabout getElementsByName test
|
1145
|
-
support.getById = assert(function( el ) {
|
1146
|
-
|
1147
|
-
return !document.getElementsByName ||
|
1148
|
-
|
1145
|
+
support.getById = assert( function( el ) {
|
1146
|
+
documentElement.appendChild( el ).id = jQuery.expando;
|
1147
|
+
return !document.getElementsByName ||
|
1148
|
+
!document.getElementsByName( jQuery.expando ).length;
|
1149
|
+
} );
|
1150
|
+
|
1151
|
+
// Support: IE 9 only
|
1152
|
+
// Check to see if it's possible to do matchesSelector
|
1153
|
+
// on a disconnected node.
|
1154
|
+
support.disconnectedMatch = assert( function( el ) {
|
1155
|
+
return matches.call( el, "*" );
|
1156
|
+
} );
|
1157
|
+
|
1158
|
+
// Support: IE 9 - 11+, Edge 12 - 18+
|
1159
|
+
// IE/Edge don't support the :scope pseudo-class.
|
1160
|
+
support.scope = assert( function() {
|
1161
|
+
return document.querySelectorAll( ":scope" );
|
1162
|
+
} );
|
1163
|
+
|
1164
|
+
// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
|
1165
|
+
// Make sure the `:has()` argument is parsed unforgivingly.
|
1166
|
+
// We include `*` in the test to detect buggy implementations that are
|
1167
|
+
// _selectively_ forgiving (specifically when the list includes at least
|
1168
|
+
// one valid selector).
|
1169
|
+
// Note that we treat complete lack of support for `:has()` as if it were
|
1170
|
+
// spec-compliant support, which is fine because use of `:has()` in such
|
1171
|
+
// environments will fail in the qSA path and fall back to jQuery traversal
|
1172
|
+
// anyway.
|
1173
|
+
support.cssHas = assert( function() {
|
1174
|
+
try {
|
1175
|
+
document.querySelector( ":has(*,:jqfake)" );
|
1176
|
+
return false;
|
1177
|
+
} catch ( e ) {
|
1178
|
+
return true;
|
1179
|
+
}
|
1180
|
+
} );
|
1149
1181
|
|
1150
1182
|
// ID filter and find
|
1151
1183
|
if ( support.getById ) {
|
1152
|
-
Expr.filter
|
1184
|
+
Expr.filter.ID = function( id ) {
|
1153
1185
|
var attrId = id.replace( runescape, funescape );
|
1154
1186
|
return function( elem ) {
|
1155
|
-
return elem.getAttribute("id") === attrId;
|
1187
|
+
return elem.getAttribute( "id" ) === attrId;
|
1156
1188
|
};
|
1157
1189
|
};
|
1158
|
-
Expr.find
|
1190
|
+
Expr.find.ID = function( id, context ) {
|
1159
1191
|
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
|
1160
1192
|
var elem = context.getElementById( id );
|
1161
1193
|
return elem ? [ elem ] : [];
|
1162
1194
|
}
|
1163
1195
|
};
|
1164
1196
|
} else {
|
1165
|
-
Expr.filter
|
1197
|
+
Expr.filter.ID = function( id ) {
|
1166
1198
|
var attrId = id.replace( runescape, funescape );
|
1167
1199
|
return function( elem ) {
|
1168
1200
|
var node = typeof elem.getAttributeNode !== "undefined" &&
|
1169
|
-
elem.getAttributeNode("id");
|
1201
|
+
elem.getAttributeNode( "id" );
|
1170
1202
|
return node && node.value === attrId;
|
1171
1203
|
};
|
1172
1204
|
};
|
1173
1205
|
|
1174
1206
|
// Support: IE 6 - 7 only
|
1175
1207
|
// getElementById is not reliable as a find shortcut
|
1176
|
-
Expr.find
|
1208
|
+
Expr.find.ID = function( id, context ) {
|
1177
1209
|
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
|
1178
1210
|
var node, i, elems,
|
1179
1211
|
elem = context.getElementById( id );
|
@@ -1181,7 +1213,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1181
1213
|
if ( elem ) {
|
1182
1214
|
|
1183
1215
|
// Verify the id attribute
|
1184
|
-
node = elem.getAttributeNode("id");
|
1216
|
+
node = elem.getAttributeNode( "id" );
|
1185
1217
|
if ( node && node.value === id ) {
|
1186
1218
|
return [ elem ];
|
1187
1219
|
}
|
@@ -1189,8 +1221,8 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1189
1221
|
// Fall back on getElementsByName
|
1190
1222
|
elems = context.getElementsByName( id );
|
1191
1223
|
i = 0;
|
1192
|
-
while ( (elem = elems[i++]) ) {
|
1193
|
-
node = elem.getAttributeNode("id");
|
1224
|
+
while ( ( elem = elems[ i++ ] ) ) {
|
1225
|
+
node = elem.getAttributeNode( "id" );
|
1194
1226
|
if ( node && node.value === id ) {
|
1195
1227
|
return [ elem ];
|
1196
1228
|
}
|
@@ -1203,39 +1235,18 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1203
1235
|
}
|
1204
1236
|
|
1205
1237
|
// Tag
|
1206
|
-
Expr.find
|
1207
|
-
|
1208
|
-
|
1209
|
-
return context.getElementsByTagName( tag );
|
1210
|
-
|
1211
|
-
// DocumentFragment nodes don't have gEBTN
|
1212
|
-
} else if ( support.qsa ) {
|
1213
|
-
return context.querySelectorAll( tag );
|
1214
|
-
}
|
1215
|
-
} :
|
1238
|
+
Expr.find.TAG = function( tag, context ) {
|
1239
|
+
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
1240
|
+
return context.getElementsByTagName( tag );
|
1216
1241
|
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
results = context.getElementsByTagName( tag );
|
1223
|
-
|
1224
|
-
// Filter out possible comments
|
1225
|
-
if ( tag === "*" ) {
|
1226
|
-
while ( (elem = results[i++]) ) {
|
1227
|
-
if ( elem.nodeType === 1 ) {
|
1228
|
-
tmp.push( elem );
|
1229
|
-
}
|
1230
|
-
}
|
1231
|
-
|
1232
|
-
return tmp;
|
1233
|
-
}
|
1234
|
-
return results;
|
1235
|
-
};
|
1242
|
+
// DocumentFragment nodes don't have gEBTN
|
1243
|
+
} else {
|
1244
|
+
return context.querySelectorAll( tag );
|
1245
|
+
}
|
1246
|
+
};
|
1236
1247
|
|
1237
1248
|
// Class
|
1238
|
-
Expr.find
|
1249
|
+
Expr.find.CLASS = function( className, context ) {
|
1239
1250
|
if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
|
1240
1251
|
return context.getElementsByClassName( className );
|
1241
1252
|
}
|
@@ -1246,153 +1257,94 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1246
1257
|
|
1247
1258
|
// QSA and matchesSelector support
|
1248
1259
|
|
1249
|
-
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
|
1250
|
-
rbuggyMatches = [];
|
1251
|
-
|
1252
|
-
// qSa(:focus) reports false when true (Chrome 21)
|
1253
|
-
// We allow this because of a bug in IE8/9 that throws an error
|
1254
|
-
// whenever `document.activeElement` is accessed on an iframe
|
1255
|
-
// So, we allow :focus to pass through QSA all the time to avoid the IE error
|
1256
|
-
// See https://bugs.jquery.com/ticket/13378
|
1257
1260
|
rbuggyQSA = [];
|
1258
1261
|
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
assert(function( el ) {
|
1263
|
-
// Select is set to empty string on purpose
|
1264
|
-
// This is to test IE's treatment of not explicitly
|
1265
|
-
// setting a boolean content attribute,
|
1266
|
-
// since its presence should be enough
|
1267
|
-
// https://bugs.jquery.com/ticket/12359
|
1268
|
-
docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
|
1269
|
-
"<select id='" + expando + "-\r\\' msallowcapture=''>" +
|
1270
|
-
"<option selected=''></option></select>";
|
1271
|
-
|
1272
|
-
// Support: IE8, Opera 11-12.16
|
1273
|
-
// Nothing should be selected when empty strings follow ^= or $= or *=
|
1274
|
-
// The test attribute must be unknown in Opera but "safe" for WinRT
|
1275
|
-
// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
|
1276
|
-
if ( el.querySelectorAll("[msallowcapture^='']").length ) {
|
1277
|
-
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
|
1278
|
-
}
|
1279
|
-
|
1280
|
-
// Support: IE8
|
1281
|
-
// Boolean attributes and "value" are not treated correctly
|
1282
|
-
if ( !el.querySelectorAll("[selected]").length ) {
|
1283
|
-
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
|
1284
|
-
}
|
1285
|
-
|
1286
|
-
// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
|
1287
|
-
if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
|
1288
|
-
rbuggyQSA.push("~=");
|
1289
|
-
}
|
1290
|
-
|
1291
|
-
// Webkit/Opera - :checked should return selected option elements
|
1292
|
-
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
|
1293
|
-
// IE8 throws error here and will not see later tests
|
1294
|
-
if ( !el.querySelectorAll(":checked").length ) {
|
1295
|
-
rbuggyQSA.push(":checked");
|
1296
|
-
}
|
1297
|
-
|
1298
|
-
// Support: Safari 8+, iOS 8+
|
1299
|
-
// https://bugs.webkit.org/show_bug.cgi?id=136851
|
1300
|
-
// In-page `selector#id sibling-combinator selector` fails
|
1301
|
-
if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
|
1302
|
-
rbuggyQSA.push(".#.+[+~]");
|
1303
|
-
}
|
1304
|
-
});
|
1262
|
+
// Build QSA regex
|
1263
|
+
// Regex strategy adopted from Diego Perini
|
1264
|
+
assert( function( el ) {
|
1305
1265
|
|
1306
|
-
|
1307
|
-
el.innerHTML = "<a href='' disabled='disabled'></a>" +
|
1308
|
-
"<select disabled='disabled'><option/></select>";
|
1266
|
+
var input;
|
1309
1267
|
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
el.appendChild( input ).setAttribute( "name", "D" );
|
1268
|
+
documentElement.appendChild( el ).innerHTML =
|
1269
|
+
"<a id='" + expando + "' href='' disabled='disabled'></a>" +
|
1270
|
+
"<select id='" + expando + "-\r\\' disabled='disabled'>" +
|
1271
|
+
"<option selected=''></option></select>";
|
1315
1272
|
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1273
|
+
// Support: iOS <=7 - 8 only
|
1274
|
+
// Boolean attributes and "value" are not treated correctly in some XML documents
|
1275
|
+
if ( !el.querySelectorAll( "[selected]" ).length ) {
|
1276
|
+
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
|
1277
|
+
}
|
1321
1278
|
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
}
|
1279
|
+
// Support: iOS <=7 - 8 only
|
1280
|
+
if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
|
1281
|
+
rbuggyQSA.push( "~=" );
|
1282
|
+
}
|
1327
1283
|
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1284
|
+
// Support: iOS 8 only
|
1285
|
+
// https://bugs.webkit.org/show_bug.cgi?id=136851
|
1286
|
+
// In-page `selector#id sibling-combinator selector` fails
|
1287
|
+
if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
|
1288
|
+
rbuggyQSA.push( ".#.+[+~]" );
|
1289
|
+
}
|
1334
1290
|
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1291
|
+
// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
|
1292
|
+
// In some of the document kinds, these selectors wouldn't work natively.
|
1293
|
+
// This is probably OK but for backwards compatibility we want to maintain
|
1294
|
+
// handling them through jQuery traversal in jQuery 3.x.
|
1295
|
+
if ( !el.querySelectorAll( ":checked" ).length ) {
|
1296
|
+
rbuggyQSA.push( ":checked" );
|
1297
|
+
}
|
1340
1298
|
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1299
|
+
// Support: Windows 8 Native Apps
|
1300
|
+
// The type and name attributes are restricted during .innerHTML assignment
|
1301
|
+
input = document.createElement( "input" );
|
1302
|
+
input.setAttribute( "type", "hidden" );
|
1303
|
+
el.appendChild( input ).setAttribute( "name", "D" );
|
1304
|
+
|
1305
|
+
// Support: IE 9 - 11+
|
1306
|
+
// IE's :disabled selector does not pick up the children of disabled fieldsets
|
1307
|
+
// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
|
1308
|
+
// In some of the document kinds, these selectors wouldn't work natively.
|
1309
|
+
// This is probably OK but for backwards compatibility we want to maintain
|
1310
|
+
// handling them through jQuery traversal in jQuery 3.x.
|
1311
|
+
documentElement.appendChild( el ).disabled = true;
|
1312
|
+
if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
|
1313
|
+
rbuggyQSA.push( ":enabled", ":disabled" );
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
// Support: IE 11+, Edge 15 - 18+
|
1317
|
+
// IE 11/Edge don't find elements on a `[name='']` query in some cases.
|
1318
|
+
// Adding a temporary attribute to the document before the selection works
|
1319
|
+
// around the issue.
|
1320
|
+
// Interestingly, IE 10 & older don't seem to have the issue.
|
1321
|
+
input = document.createElement( "input" );
|
1322
|
+
input.setAttribute( "name", "" );
|
1323
|
+
el.appendChild( input );
|
1324
|
+
if ( !el.querySelectorAll( "[name='']" ).length ) {
|
1325
|
+
rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
|
1326
|
+
whitespace + "*(?:''|\"\")" );
|
1327
|
+
}
|
1328
|
+
} );
|
1346
1329
|
|
1347
|
-
|
1348
|
-
// Check to see if it's possible to do matchesSelector
|
1349
|
-
// on a disconnected node (IE 9)
|
1350
|
-
support.disconnectedMatch = matches.call( el, "*" );
|
1330
|
+
if ( !support.cssHas ) {
|
1351
1331
|
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1332
|
+
// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
|
1333
|
+
// Our regular `try-catch` mechanism fails to detect natively-unsupported
|
1334
|
+
// pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
|
1335
|
+
// in browsers that parse the `:has()` argument as a forgiving selector list.
|
1336
|
+
// https://drafts.csswg.org/selectors/#relational now requires the argument
|
1337
|
+
// to be parsed unforgivingly, but browsers have not yet fully adjusted.
|
1338
|
+
rbuggyQSA.push( ":has" );
|
1357
1339
|
}
|
1358
1340
|
|
1359
|
-
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
|
1360
|
-
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
|
1361
|
-
|
1362
|
-
/* Contains
|
1363
|
-
---------------------------------------------------------------------- */
|
1364
|
-
hasCompare = rnative.test( docElem.compareDocumentPosition );
|
1365
|
-
|
1366
|
-
// Element contains another
|
1367
|
-
// Purposefully self-exclusive
|
1368
|
-
// As in, an element does not contain itself
|
1369
|
-
contains = hasCompare || rnative.test( docElem.contains ) ?
|
1370
|
-
function( a, b ) {
|
1371
|
-
var adown = a.nodeType === 9 ? a.documentElement : a,
|
1372
|
-
bup = b && b.parentNode;
|
1373
|
-
return a === bup || !!( bup && bup.nodeType === 1 && (
|
1374
|
-
adown.contains ?
|
1375
|
-
adown.contains( bup ) :
|
1376
|
-
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
|
1377
|
-
));
|
1378
|
-
} :
|
1379
|
-
function( a, b ) {
|
1380
|
-
if ( b ) {
|
1381
|
-
while ( (b = b.parentNode) ) {
|
1382
|
-
if ( b === a ) {
|
1383
|
-
return true;
|
1384
|
-
}
|
1385
|
-
}
|
1386
|
-
}
|
1387
|
-
return false;
|
1388
|
-
};
|
1341
|
+
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
|
1389
1342
|
|
1390
1343
|
/* Sorting
|
1391
1344
|
---------------------------------------------------------------------- */
|
1392
1345
|
|
1393
1346
|
// Document order sorting
|
1394
|
-
sortOrder =
|
1395
|
-
function( a, b ) {
|
1347
|
+
sortOrder = function( a, b ) {
|
1396
1348
|
|
1397
1349
|
// Flag for duplicate removal
|
1398
1350
|
if ( a === b ) {
|
@@ -1407,7 +1359,11 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1407
1359
|
}
|
1408
1360
|
|
1409
1361
|
// Calculate position if both inputs belong to the same document
|
1410
|
-
|
1362
|
+
// Support: IE 11+, Edge 17 - 18+
|
1363
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1364
|
+
// two documents; shallow comparisons work.
|
1365
|
+
// eslint-disable-next-line eqeqeq
|
1366
|
+
compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
|
1411
1367
|
a.compareDocumentPosition( b ) :
|
1412
1368
|
|
1413
1369
|
// Otherwise we know they are disconnected
|
@@ -1415,148 +1371,109 @@ setDocument = Sizzle.setDocument = function( node ) {
|
|
1415
1371
|
|
1416
1372
|
// Disconnected nodes
|
1417
1373
|
if ( compare & 1 ||
|
1418
|
-
(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
|
1374
|
+
( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
|
1419
1375
|
|
1420
1376
|
// Choose the first element that is related to our preferred document
|
1421
|
-
|
1377
|
+
// Support: IE 11+, Edge 17 - 18+
|
1378
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1379
|
+
// two documents; shallow comparisons work.
|
1380
|
+
// eslint-disable-next-line eqeqeq
|
1381
|
+
if ( a === document || a.ownerDocument == preferredDoc &&
|
1382
|
+
find.contains( preferredDoc, a ) ) {
|
1422
1383
|
return -1;
|
1423
1384
|
}
|
1424
|
-
|
1385
|
+
|
1386
|
+
// Support: IE 11+, Edge 17 - 18+
|
1387
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1388
|
+
// two documents; shallow comparisons work.
|
1389
|
+
// eslint-disable-next-line eqeqeq
|
1390
|
+
if ( b === document || b.ownerDocument == preferredDoc &&
|
1391
|
+
find.contains( preferredDoc, b ) ) {
|
1425
1392
|
return 1;
|
1426
1393
|
}
|
1427
1394
|
|
1428
1395
|
// Maintain original order
|
1429
1396
|
return sortInput ?
|
1430
|
-
( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
|
1397
|
+
( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
|
1431
1398
|
0;
|
1432
1399
|
}
|
1433
1400
|
|
1434
1401
|
return compare & 4 ? -1 : 1;
|
1435
|
-
} :
|
1436
|
-
function( a, b ) {
|
1437
|
-
// Exit early if the nodes are identical
|
1438
|
-
if ( a === b ) {
|
1439
|
-
hasDuplicate = true;
|
1440
|
-
return 0;
|
1441
|
-
}
|
1442
|
-
|
1443
|
-
var cur,
|
1444
|
-
i = 0,
|
1445
|
-
aup = a.parentNode,
|
1446
|
-
bup = b.parentNode,
|
1447
|
-
ap = [ a ],
|
1448
|
-
bp = [ b ];
|
1449
|
-
|
1450
|
-
// Parentless nodes are either documents or disconnected
|
1451
|
-
if ( !aup || !bup ) {
|
1452
|
-
return a === document ? -1 :
|
1453
|
-
b === document ? 1 :
|
1454
|
-
aup ? -1 :
|
1455
|
-
bup ? 1 :
|
1456
|
-
sortInput ?
|
1457
|
-
( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
|
1458
|
-
0;
|
1459
|
-
|
1460
|
-
// If the nodes are siblings, we can do a quick check
|
1461
|
-
} else if ( aup === bup ) {
|
1462
|
-
return siblingCheck( a, b );
|
1463
|
-
}
|
1464
|
-
|
1465
|
-
// Otherwise we need full lists of their ancestors for comparison
|
1466
|
-
cur = a;
|
1467
|
-
while ( (cur = cur.parentNode) ) {
|
1468
|
-
ap.unshift( cur );
|
1469
|
-
}
|
1470
|
-
cur = b;
|
1471
|
-
while ( (cur = cur.parentNode) ) {
|
1472
|
-
bp.unshift( cur );
|
1473
|
-
}
|
1474
|
-
|
1475
|
-
// Walk down the tree looking for a discrepancy
|
1476
|
-
while ( ap[i] === bp[i] ) {
|
1477
|
-
i++;
|
1478
|
-
}
|
1479
|
-
|
1480
|
-
return i ?
|
1481
|
-
// Do a sibling check if the nodes have a common ancestor
|
1482
|
-
siblingCheck( ap[i], bp[i] ) :
|
1483
|
-
|
1484
|
-
// Otherwise nodes in our document sort first
|
1485
|
-
ap[i] === preferredDoc ? -1 :
|
1486
|
-
bp[i] === preferredDoc ? 1 :
|
1487
|
-
0;
|
1488
1402
|
};
|
1489
1403
|
|
1490
1404
|
return document;
|
1491
|
-
}
|
1405
|
+
}
|
1492
1406
|
|
1493
|
-
|
1494
|
-
return
|
1407
|
+
find.matches = function( expr, elements ) {
|
1408
|
+
return find( expr, null, null, elements );
|
1495
1409
|
};
|
1496
1410
|
|
1497
|
-
|
1498
|
-
|
1499
|
-
if ( ( elem.ownerDocument || elem ) !== document ) {
|
1500
|
-
setDocument( elem );
|
1501
|
-
}
|
1411
|
+
find.matchesSelector = function( elem, expr ) {
|
1412
|
+
setDocument( elem );
|
1502
1413
|
|
1503
|
-
if (
|
1414
|
+
if ( documentIsHTML &&
|
1504
1415
|
!nonnativeSelectorCache[ expr + " " ] &&
|
1505
|
-
( !
|
1506
|
-
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
|
1416
|
+
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
|
1507
1417
|
|
1508
1418
|
try {
|
1509
1419
|
var ret = matches.call( elem, expr );
|
1510
1420
|
|
1511
1421
|
// IE 9's matchesSelector returns false on disconnected nodes
|
1512
1422
|
if ( ret || support.disconnectedMatch ||
|
1423
|
+
|
1513
1424
|
// As well, disconnected nodes are said to be in a document
|
1514
1425
|
// fragment in IE 9
|
1515
1426
|
elem.document && elem.document.nodeType !== 11 ) {
|
1516
1427
|
return ret;
|
1517
1428
|
}
|
1518
|
-
} catch (e) {
|
1429
|
+
} catch ( e ) {
|
1519
1430
|
nonnativeSelectorCache( expr, true );
|
1520
1431
|
}
|
1521
1432
|
}
|
1522
1433
|
|
1523
|
-
return
|
1434
|
+
return find( expr, document, null, [ elem ] ).length > 0;
|
1524
1435
|
};
|
1525
1436
|
|
1526
|
-
|
1437
|
+
find.contains = function( context, elem ) {
|
1438
|
+
|
1527
1439
|
// Set document vars if needed
|
1528
|
-
|
1440
|
+
// Support: IE 11+, Edge 17 - 18+
|
1441
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1442
|
+
// two documents; shallow comparisons work.
|
1443
|
+
// eslint-disable-next-line eqeqeq
|
1444
|
+
if ( ( context.ownerDocument || context ) != document ) {
|
1529
1445
|
setDocument( context );
|
1530
1446
|
}
|
1531
|
-
return contains( context, elem );
|
1447
|
+
return jQuery.contains( context, elem );
|
1532
1448
|
};
|
1533
1449
|
|
1534
|
-
|
1450
|
+
|
1451
|
+
find.attr = function( elem, name ) {
|
1452
|
+
|
1535
1453
|
// Set document vars if needed
|
1536
|
-
|
1454
|
+
// Support: IE 11+, Edge 17 - 18+
|
1455
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
1456
|
+
// two documents; shallow comparisons work.
|
1457
|
+
// eslint-disable-next-line eqeqeq
|
1458
|
+
if ( ( elem.ownerDocument || elem ) != document ) {
|
1537
1459
|
setDocument( elem );
|
1538
1460
|
}
|
1539
1461
|
|
1540
1462
|
var fn = Expr.attrHandle[ name.toLowerCase() ],
|
1541
|
-
|
1463
|
+
|
1464
|
+
// Don't get fooled by Object.prototype properties (see trac-13807)
|
1542
1465
|
val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
|
1543
1466
|
fn( elem, name, !documentIsHTML ) :
|
1544
1467
|
undefined;
|
1545
1468
|
|
1546
|
-
|
1547
|
-
val
|
1548
|
-
|
1549
|
-
elem.getAttribute( name ) :
|
1550
|
-
(val = elem.getAttributeNode(name)) && val.specified ?
|
1551
|
-
val.value :
|
1552
|
-
null;
|
1553
|
-
};
|
1469
|
+
if ( val !== undefined ) {
|
1470
|
+
return val;
|
1471
|
+
}
|
1554
1472
|
|
1555
|
-
|
1556
|
-
return (sel + "").replace( rcssescape, fcssescape );
|
1473
|
+
return elem.getAttribute( name );
|
1557
1474
|
};
|
1558
1475
|
|
1559
|
-
|
1476
|
+
find.error = function( msg ) {
|
1560
1477
|
throw new Error( "Syntax error, unrecognized expression: " + msg );
|
1561
1478
|
};
|
1562
1479
|
|
@@ -1564,25 +1481,29 @@ Sizzle.error = function( msg ) {
|
|
1564
1481
|
* Document sorting and removing duplicates
|
1565
1482
|
* @param {ArrayLike} results
|
1566
1483
|
*/
|
1567
|
-
|
1484
|
+
jQuery.uniqueSort = function( results ) {
|
1568
1485
|
var elem,
|
1569
1486
|
duplicates = [],
|
1570
1487
|
j = 0,
|
1571
1488
|
i = 0;
|
1572
1489
|
|
1573
1490
|
// Unless we *know* we can detect duplicates, assume their presence
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1491
|
+
//
|
1492
|
+
// Support: Android <=4.0+
|
1493
|
+
// Testing for detecting duplicates is unpredictable so instead assume we can't
|
1494
|
+
// depend on duplicate detection in all browsers without a stable sort.
|
1495
|
+
hasDuplicate = !support.sortStable;
|
1496
|
+
sortInput = !support.sortStable && slice.call( results, 0 );
|
1497
|
+
sort.call( results, sortOrder );
|
1577
1498
|
|
1578
1499
|
if ( hasDuplicate ) {
|
1579
|
-
while ( (elem = results[i++]) ) {
|
1500
|
+
while ( ( elem = results[ i++ ] ) ) {
|
1580
1501
|
if ( elem === results[ i ] ) {
|
1581
1502
|
j = duplicates.push( i );
|
1582
1503
|
}
|
1583
1504
|
}
|
1584
1505
|
while ( j-- ) {
|
1585
|
-
|
1506
|
+
splice.call( results, duplicates[ j ], 1 );
|
1586
1507
|
}
|
1587
1508
|
}
|
1588
1509
|
|
@@ -1593,42 +1514,11 @@ Sizzle.uniqueSort = function( results ) {
|
|
1593
1514
|
return results;
|
1594
1515
|
};
|
1595
1516
|
|
1596
|
-
|
1597
|
-
|
1598
|
-
* @param {Array|Element} elem
|
1599
|
-
*/
|
1600
|
-
getText = Sizzle.getText = function( elem ) {
|
1601
|
-
var node,
|
1602
|
-
ret = "",
|
1603
|
-
i = 0,
|
1604
|
-
nodeType = elem.nodeType;
|
1605
|
-
|
1606
|
-
if ( !nodeType ) {
|
1607
|
-
// If no nodeType, this is expected to be an array
|
1608
|
-
while ( (node = elem[i++]) ) {
|
1609
|
-
// Do not traverse comment nodes
|
1610
|
-
ret += getText( node );
|
1611
|
-
}
|
1612
|
-
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
|
1613
|
-
// Use textContent for elements
|
1614
|
-
// innerText usage removed for consistency of new lines (jQuery #11153)
|
1615
|
-
if ( typeof elem.textContent === "string" ) {
|
1616
|
-
return elem.textContent;
|
1617
|
-
} else {
|
1618
|
-
// Traverse its children
|
1619
|
-
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
1620
|
-
ret += getText( elem );
|
1621
|
-
}
|
1622
|
-
}
|
1623
|
-
} else if ( nodeType === 3 || nodeType === 4 ) {
|
1624
|
-
return elem.nodeValue;
|
1625
|
-
}
|
1626
|
-
// Do not include comment or processing instruction nodes
|
1627
|
-
|
1628
|
-
return ret;
|
1517
|
+
jQuery.fn.uniqueSort = function() {
|
1518
|
+
return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );
|
1629
1519
|
};
|
1630
1520
|
|
1631
|
-
Expr =
|
1521
|
+
Expr = jQuery.expr = {
|
1632
1522
|
|
1633
1523
|
// Can be adjusted by the user
|
1634
1524
|
cacheLength: 50,
|
@@ -1649,20 +1539,22 @@ Expr = Sizzle.selectors = {
|
|
1649
1539
|
},
|
1650
1540
|
|
1651
1541
|
preFilter: {
|
1652
|
-
|
1653
|
-
match[1] = match[1].replace( runescape, funescape );
|
1542
|
+
ATTR: function( match ) {
|
1543
|
+
match[ 1 ] = match[ 1 ].replace( runescape, funescape );
|
1654
1544
|
|
1655
1545
|
// Move the given value to match[3] whether quoted or unquoted
|
1656
|
-
match[3] = ( match[3] || match[4] || match[5] || "" )
|
1546
|
+
match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" )
|
1547
|
+
.replace( runescape, funescape );
|
1657
1548
|
|
1658
|
-
if ( match[2] === "~=" ) {
|
1659
|
-
match[3] = " " + match[3] + " ";
|
1549
|
+
if ( match[ 2 ] === "~=" ) {
|
1550
|
+
match[ 3 ] = " " + match[ 3 ] + " ";
|
1660
1551
|
}
|
1661
1552
|
|
1662
1553
|
return match.slice( 0, 4 );
|
1663
1554
|
},
|
1664
1555
|
|
1665
|
-
|
1556
|
+
CHILD: function( match ) {
|
1557
|
+
|
1666
1558
|
/* matches from matchExpr["CHILD"]
|
1667
1559
|
1 type (only|nth|...)
|
1668
1560
|
2 what (child|of-type)
|
@@ -1673,49 +1565,55 @@ Expr = Sizzle.selectors = {
|
|
1673
1565
|
7 sign of y-component
|
1674
1566
|
8 y of y-component
|
1675
1567
|
*/
|
1676
|
-
match[1] = match[1].toLowerCase();
|
1568
|
+
match[ 1 ] = match[ 1 ].toLowerCase();
|
1569
|
+
|
1570
|
+
if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
|
1677
1571
|
|
1678
|
-
if ( match[1].slice( 0, 3 ) === "nth" ) {
|
1679
1572
|
// nth-* requires argument
|
1680
|
-
if ( !match[3] ) {
|
1681
|
-
|
1573
|
+
if ( !match[ 3 ] ) {
|
1574
|
+
find.error( match[ 0 ] );
|
1682
1575
|
}
|
1683
1576
|
|
1684
1577
|
// numeric x and y parameters for Expr.filter.CHILD
|
1685
1578
|
// remember that false/true cast respectively to 0/1
|
1686
|
-
match[4] = +( match[4] ?
|
1687
|
-
|
1579
|
+
match[ 4 ] = +( match[ 4 ] ?
|
1580
|
+
match[ 5 ] + ( match[ 6 ] || 1 ) :
|
1581
|
+
2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" )
|
1582
|
+
);
|
1583
|
+
match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
|
1688
1584
|
|
1689
1585
|
// other types prohibit arguments
|
1690
|
-
} else if ( match[3] ) {
|
1691
|
-
|
1586
|
+
} else if ( match[ 3 ] ) {
|
1587
|
+
find.error( match[ 0 ] );
|
1692
1588
|
}
|
1693
1589
|
|
1694
1590
|
return match;
|
1695
1591
|
},
|
1696
1592
|
|
1697
|
-
|
1593
|
+
PSEUDO: function( match ) {
|
1698
1594
|
var excess,
|
1699
|
-
unquoted = !match[6] && match[2];
|
1595
|
+
unquoted = !match[ 6 ] && match[ 2 ];
|
1700
1596
|
|
1701
|
-
if ( matchExpr
|
1597
|
+
if ( matchExpr.CHILD.test( match[ 0 ] ) ) {
|
1702
1598
|
return null;
|
1703
1599
|
}
|
1704
1600
|
|
1705
1601
|
// Accept quoted arguments as-is
|
1706
|
-
if ( match[3] ) {
|
1707
|
-
match[2] = match[4] || match[5] || "";
|
1602
|
+
if ( match[ 3 ] ) {
|
1603
|
+
match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
|
1708
1604
|
|
1709
1605
|
// Strip excess characters from unquoted arguments
|
1710
1606
|
} else if ( unquoted && rpseudo.test( unquoted ) &&
|
1607
|
+
|
1711
1608
|
// Get excess from tokenize (recursively)
|
1712
|
-
(excess = tokenize( unquoted, true )) &&
|
1609
|
+
( excess = tokenize( unquoted, true ) ) &&
|
1610
|
+
|
1713
1611
|
// advance to the next closing parenthesis
|
1714
|
-
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
|
1612
|
+
( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
|
1715
1613
|
|
1716
1614
|
// excess is a negative index
|
1717
|
-
match[0] = match[0].slice( 0, excess );
|
1718
|
-
match[2] = unquoted.slice( 0, excess );
|
1615
|
+
match[ 0 ] = match[ 0 ].slice( 0, excess );
|
1616
|
+
match[ 2 ] = unquoted.slice( 0, excess );
|
1719
1617
|
}
|
1720
1618
|
|
1721
1619
|
// Return only captures needed by the pseudo filter method (type and argument)
|
@@ -1725,28 +1623,36 @@ Expr = Sizzle.selectors = {
|
|
1725
1623
|
|
1726
1624
|
filter: {
|
1727
1625
|
|
1728
|
-
|
1729
|
-
var
|
1626
|
+
TAG: function( nodeNameSelector ) {
|
1627
|
+
var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
|
1730
1628
|
return nodeNameSelector === "*" ?
|
1731
|
-
function() {
|
1629
|
+
function() {
|
1630
|
+
return true;
|
1631
|
+
} :
|
1732
1632
|
function( elem ) {
|
1733
|
-
return
|
1633
|
+
return nodeName( elem, expectedNodeName );
|
1734
1634
|
};
|
1735
1635
|
},
|
1736
1636
|
|
1737
|
-
|
1637
|
+
CLASS: function( className ) {
|
1738
1638
|
var pattern = classCache[ className + " " ];
|
1739
1639
|
|
1740
1640
|
return pattern ||
|
1741
|
-
(pattern = new RegExp( "(^|" + whitespace + ")" + className +
|
1641
|
+
( pattern = new RegExp( "(^|" + whitespace + ")" + className +
|
1642
|
+
"(" + whitespace + "|$)" ) ) &&
|
1742
1643
|
classCache( className, function( elem ) {
|
1743
|
-
return pattern.test(
|
1744
|
-
|
1644
|
+
return pattern.test(
|
1645
|
+
typeof elem.className === "string" && elem.className ||
|
1646
|
+
typeof elem.getAttribute !== "undefined" &&
|
1647
|
+
elem.getAttribute( "class" ) ||
|
1648
|
+
""
|
1649
|
+
);
|
1650
|
+
} );
|
1745
1651
|
},
|
1746
1652
|
|
1747
|
-
|
1653
|
+
ATTR: function( name, operator, check ) {
|
1748
1654
|
return function( elem ) {
|
1749
|
-
var result =
|
1655
|
+
var result = find.attr( elem, name );
|
1750
1656
|
|
1751
1657
|
if ( result == null ) {
|
1752
1658
|
return operator === "!=";
|
@@ -1757,18 +1663,34 @@ Expr = Sizzle.selectors = {
|
|
1757
1663
|
|
1758
1664
|
result += "";
|
1759
1665
|
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1666
|
+
if ( operator === "=" ) {
|
1667
|
+
return result === check;
|
1668
|
+
}
|
1669
|
+
if ( operator === "!=" ) {
|
1670
|
+
return result !== check;
|
1671
|
+
}
|
1672
|
+
if ( operator === "^=" ) {
|
1673
|
+
return check && result.indexOf( check ) === 0;
|
1674
|
+
}
|
1675
|
+
if ( operator === "*=" ) {
|
1676
|
+
return check && result.indexOf( check ) > -1;
|
1677
|
+
}
|
1678
|
+
if ( operator === "$=" ) {
|
1679
|
+
return check && result.slice( -check.length ) === check;
|
1680
|
+
}
|
1681
|
+
if ( operator === "~=" ) {
|
1682
|
+
return ( " " + result.replace( rwhitespace, " " ) + " " )
|
1683
|
+
.indexOf( check ) > -1;
|
1684
|
+
}
|
1685
|
+
if ( operator === "|=" ) {
|
1686
|
+
return result === check || result.slice( 0, check.length + 1 ) === check + "-";
|
1687
|
+
}
|
1688
|
+
|
1689
|
+
return false;
|
1768
1690
|
};
|
1769
1691
|
},
|
1770
1692
|
|
1771
|
-
|
1693
|
+
CHILD: function( type, what, _argument, first, last ) {
|
1772
1694
|
var simple = type.slice( 0, 3 ) !== "nth",
|
1773
1695
|
forward = type.slice( -4 ) !== "last",
|
1774
1696
|
ofType = what === "of-type";
|
@@ -1780,8 +1702,8 @@ Expr = Sizzle.selectors = {
|
|
1780
1702
|
return !!elem.parentNode;
|
1781
1703
|
} :
|
1782
1704
|
|
1783
|
-
function( elem,
|
1784
|
-
var cache,
|
1705
|
+
function( elem, _context, xml ) {
|
1706
|
+
var cache, outerCache, node, nodeIndex, start,
|
1785
1707
|
dir = simple !== forward ? "nextSibling" : "previousSibling",
|
1786
1708
|
parent = elem.parentNode,
|
1787
1709
|
name = ofType && elem.nodeName.toLowerCase(),
|
@@ -1794,14 +1716,15 @@ Expr = Sizzle.selectors = {
|
|
1794
1716
|
if ( simple ) {
|
1795
1717
|
while ( dir ) {
|
1796
1718
|
node = elem;
|
1797
|
-
while ( (node = node[ dir ]) ) {
|
1719
|
+
while ( ( node = node[ dir ] ) ) {
|
1798
1720
|
if ( ofType ?
|
1799
|
-
|
1721
|
+
nodeName( node, name ) :
|
1800
1722
|
node.nodeType === 1 ) {
|
1801
1723
|
|
1802
1724
|
return false;
|
1803
1725
|
}
|
1804
1726
|
}
|
1727
|
+
|
1805
1728
|
// Reverse direction for :only-* (if we haven't yet done so)
|
1806
1729
|
start = dir = type === "only" && !start && "nextSibling";
|
1807
1730
|
}
|
@@ -1814,46 +1737,30 @@ Expr = Sizzle.selectors = {
|
|
1814
1737
|
if ( forward && useCache ) {
|
1815
1738
|
|
1816
1739
|
// Seek `elem` from a previously-cached index
|
1817
|
-
|
1818
|
-
|
1819
|
-
node = parent;
|
1820
|
-
outerCache = node[ expando ] || (node[ expando ] = {});
|
1821
|
-
|
1822
|
-
// Support: IE <9 only
|
1823
|
-
// Defend against cloned attroperties (jQuery gh-1709)
|
1824
|
-
uniqueCache = outerCache[ node.uniqueID ] ||
|
1825
|
-
(outerCache[ node.uniqueID ] = {});
|
1826
|
-
|
1827
|
-
cache = uniqueCache[ type ] || [];
|
1740
|
+
outerCache = parent[ expando ] || ( parent[ expando ] = {} );
|
1741
|
+
cache = outerCache[ type ] || [];
|
1828
1742
|
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
|
1829
1743
|
diff = nodeIndex && cache[ 2 ];
|
1830
1744
|
node = nodeIndex && parent.childNodes[ nodeIndex ];
|
1831
1745
|
|
1832
|
-
while ( (node = ++nodeIndex && node && node[ dir ] ||
|
1746
|
+
while ( ( node = ++nodeIndex && node && node[ dir ] ||
|
1833
1747
|
|
1834
1748
|
// Fallback to seeking `elem` from the start
|
1835
|
-
(diff = nodeIndex = 0) || start.pop()) ) {
|
1749
|
+
( diff = nodeIndex = 0 ) || start.pop() ) ) {
|
1836
1750
|
|
1837
1751
|
// When found, cache indexes on `parent` and break
|
1838
1752
|
if ( node.nodeType === 1 && ++diff && node === elem ) {
|
1839
|
-
|
1753
|
+
outerCache[ type ] = [ dirruns, nodeIndex, diff ];
|
1840
1754
|
break;
|
1841
1755
|
}
|
1842
1756
|
}
|
1843
1757
|
|
1844
1758
|
} else {
|
1759
|
+
|
1845
1760
|
// Use previously-cached element index if available
|
1846
1761
|
if ( useCache ) {
|
1847
|
-
|
1848
|
-
|
1849
|
-
outerCache = node[ expando ] || (node[ expando ] = {});
|
1850
|
-
|
1851
|
-
// Support: IE <9 only
|
1852
|
-
// Defend against cloned attroperties (jQuery gh-1709)
|
1853
|
-
uniqueCache = outerCache[ node.uniqueID ] ||
|
1854
|
-
(outerCache[ node.uniqueID ] = {});
|
1855
|
-
|
1856
|
-
cache = uniqueCache[ type ] || [];
|
1762
|
+
outerCache = elem[ expando ] || ( elem[ expando ] = {} );
|
1763
|
+
cache = outerCache[ type ] || [];
|
1857
1764
|
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
|
1858
1765
|
diff = nodeIndex;
|
1859
1766
|
}
|
@@ -1861,25 +1768,21 @@ Expr = Sizzle.selectors = {
|
|
1861
1768
|
// xml :nth-child(...)
|
1862
1769
|
// or :nth-last-child(...) or :nth(-last)?-of-type(...)
|
1863
1770
|
if ( diff === false ) {
|
1771
|
+
|
1864
1772
|
// Use the same loop as above to seek `elem` from the start
|
1865
|
-
while ( (node = ++nodeIndex && node && node[ dir ] ||
|
1866
|
-
(diff = nodeIndex = 0) || start.pop()) ) {
|
1773
|
+
while ( ( node = ++nodeIndex && node && node[ dir ] ||
|
1774
|
+
( diff = nodeIndex = 0 ) || start.pop() ) ) {
|
1867
1775
|
|
1868
1776
|
if ( ( ofType ?
|
1869
|
-
|
1777
|
+
nodeName( node, name ) :
|
1870
1778
|
node.nodeType === 1 ) &&
|
1871
1779
|
++diff ) {
|
1872
1780
|
|
1873
1781
|
// Cache the index of each encountered element
|
1874
1782
|
if ( useCache ) {
|
1875
|
-
outerCache = node[ expando ] ||
|
1876
|
-
|
1877
|
-
|
1878
|
-
// Defend against cloned attroperties (jQuery gh-1709)
|
1879
|
-
uniqueCache = outerCache[ node.uniqueID ] ||
|
1880
|
-
(outerCache[ node.uniqueID ] = {});
|
1881
|
-
|
1882
|
-
uniqueCache[ type ] = [ dirruns, diff ];
|
1783
|
+
outerCache = node[ expando ] ||
|
1784
|
+
( node[ expando ] = {} );
|
1785
|
+
outerCache[ type ] = [ dirruns, diff ];
|
1883
1786
|
}
|
1884
1787
|
|
1885
1788
|
if ( node === elem ) {
|
@@ -1897,18 +1800,19 @@ Expr = Sizzle.selectors = {
|
|
1897
1800
|
};
|
1898
1801
|
},
|
1899
1802
|
|
1900
|
-
|
1803
|
+
PSEUDO: function( pseudo, argument ) {
|
1804
|
+
|
1901
1805
|
// pseudo-class names are case-insensitive
|
1902
|
-
//
|
1806
|
+
// https://www.w3.org/TR/selectors/#pseudo-classes
|
1903
1807
|
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
|
1904
1808
|
// Remember that setFilters inherits from pseudos
|
1905
1809
|
var args,
|
1906
1810
|
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
|
1907
|
-
|
1811
|
+
find.error( "unsupported pseudo: " + pseudo );
|
1908
1812
|
|
1909
1813
|
// The user may use createPseudo to indicate that
|
1910
1814
|
// arguments are needed to create the filter function
|
1911
|
-
// just as
|
1815
|
+
// just as jQuery does
|
1912
1816
|
if ( fn[ expando ] ) {
|
1913
1817
|
return fn( argument );
|
1914
1818
|
}
|
@@ -1917,15 +1821,15 @@ Expr = Sizzle.selectors = {
|
|
1917
1821
|
if ( fn.length > 1 ) {
|
1918
1822
|
args = [ pseudo, pseudo, "", argument ];
|
1919
1823
|
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
|
1920
|
-
markFunction(function( seed, matches ) {
|
1824
|
+
markFunction( function( seed, matches ) {
|
1921
1825
|
var idx,
|
1922
1826
|
matched = fn( seed, argument ),
|
1923
1827
|
i = matched.length;
|
1924
1828
|
while ( i-- ) {
|
1925
|
-
idx = indexOf( seed, matched[i] );
|
1926
|
-
seed[ idx ] = !( matches[ idx ] = matched[i] );
|
1829
|
+
idx = indexOf.call( seed, matched[ i ] );
|
1830
|
+
seed[ idx ] = !( matches[ idx ] = matched[ i ] );
|
1927
1831
|
}
|
1928
|
-
}) :
|
1832
|
+
} ) :
|
1929
1833
|
function( elem ) {
|
1930
1834
|
return fn( elem, 0, args );
|
1931
1835
|
};
|
@@ -1936,49 +1840,53 @@ Expr = Sizzle.selectors = {
|
|
1936
1840
|
},
|
1937
1841
|
|
1938
1842
|
pseudos: {
|
1843
|
+
|
1939
1844
|
// Potentially complex pseudos
|
1940
|
-
|
1845
|
+
not: markFunction( function( selector ) {
|
1846
|
+
|
1941
1847
|
// Trim the selector passed to compile
|
1942
1848
|
// to avoid treating leading and trailing
|
1943
1849
|
// spaces as combinators
|
1944
1850
|
var input = [],
|
1945
1851
|
results = [],
|
1946
|
-
matcher = compile( selector.replace(
|
1852
|
+
matcher = compile( selector.replace( rtrimCSS, "$1" ) );
|
1947
1853
|
|
1948
1854
|
return matcher[ expando ] ?
|
1949
|
-
markFunction(function( seed, matches,
|
1855
|
+
markFunction( function( seed, matches, _context, xml ) {
|
1950
1856
|
var elem,
|
1951
1857
|
unmatched = matcher( seed, null, xml, [] ),
|
1952
1858
|
i = seed.length;
|
1953
1859
|
|
1954
1860
|
// Match elements unmatched by `matcher`
|
1955
1861
|
while ( i-- ) {
|
1956
|
-
if ( (elem = unmatched[i]) ) {
|
1957
|
-
seed[i] = !(matches[i] = elem);
|
1862
|
+
if ( ( elem = unmatched[ i ] ) ) {
|
1863
|
+
seed[ i ] = !( matches[ i ] = elem );
|
1958
1864
|
}
|
1959
1865
|
}
|
1960
|
-
}) :
|
1961
|
-
function( elem,
|
1962
|
-
input[0] = elem;
|
1866
|
+
} ) :
|
1867
|
+
function( elem, _context, xml ) {
|
1868
|
+
input[ 0 ] = elem;
|
1963
1869
|
matcher( input, null, xml, results );
|
1964
|
-
|
1965
|
-
|
1870
|
+
|
1871
|
+
// Don't keep the element
|
1872
|
+
// (see https://github.com/jquery/sizzle/issues/299)
|
1873
|
+
input[ 0 ] = null;
|
1966
1874
|
return !results.pop();
|
1967
1875
|
};
|
1968
|
-
}),
|
1876
|
+
} ),
|
1969
1877
|
|
1970
|
-
|
1878
|
+
has: markFunction( function( selector ) {
|
1971
1879
|
return function( elem ) {
|
1972
|
-
return
|
1880
|
+
return find( selector, elem ).length > 0;
|
1973
1881
|
};
|
1974
|
-
}),
|
1882
|
+
} ),
|
1975
1883
|
|
1976
|
-
|
1884
|
+
contains: markFunction( function( text ) {
|
1977
1885
|
text = text.replace( runescape, funescape );
|
1978
1886
|
return function( elem ) {
|
1979
|
-
return ( elem.textContent ||
|
1887
|
+
return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;
|
1980
1888
|
};
|
1981
|
-
}),
|
1889
|
+
} ),
|
1982
1890
|
|
1983
1891
|
// "Whether an element is represented by a :lang() selector
|
1984
1892
|
// is based solely on the element's language value
|
@@ -1986,57 +1894,65 @@ Expr = Sizzle.selectors = {
|
|
1986
1894
|
// or beginning with the identifier C immediately followed by "-".
|
1987
1895
|
// The matching of C against the element's language value is performed case-insensitively.
|
1988
1896
|
// The identifier C does not have to be a valid language name."
|
1989
|
-
//
|
1990
|
-
|
1897
|
+
// https://www.w3.org/TR/selectors/#lang-pseudo
|
1898
|
+
lang: markFunction( function( lang ) {
|
1899
|
+
|
1991
1900
|
// lang value must be a valid identifier
|
1992
|
-
if ( !ridentifier.test(lang || "") ) {
|
1993
|
-
|
1901
|
+
if ( !ridentifier.test( lang || "" ) ) {
|
1902
|
+
find.error( "unsupported lang: " + lang );
|
1994
1903
|
}
|
1995
1904
|
lang = lang.replace( runescape, funescape ).toLowerCase();
|
1996
1905
|
return function( elem ) {
|
1997
1906
|
var elemLang;
|
1998
1907
|
do {
|
1999
|
-
if ( (elemLang = documentIsHTML ?
|
1908
|
+
if ( ( elemLang = documentIsHTML ?
|
2000
1909
|
elem.lang :
|
2001
|
-
elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
|
1910
|
+
elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
|
2002
1911
|
|
2003
1912
|
elemLang = elemLang.toLowerCase();
|
2004
1913
|
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
|
2005
1914
|
}
|
2006
|
-
} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
|
1915
|
+
} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
|
2007
1916
|
return false;
|
2008
1917
|
};
|
2009
|
-
}),
|
1918
|
+
} ),
|
2010
1919
|
|
2011
1920
|
// Miscellaneous
|
2012
|
-
|
1921
|
+
target: function( elem ) {
|
2013
1922
|
var hash = window.location && window.location.hash;
|
2014
1923
|
return hash && hash.slice( 1 ) === elem.id;
|
2015
1924
|
},
|
2016
1925
|
|
2017
|
-
|
2018
|
-
return elem ===
|
1926
|
+
root: function( elem ) {
|
1927
|
+
return elem === documentElement;
|
2019
1928
|
},
|
2020
1929
|
|
2021
|
-
|
2022
|
-
return elem ===
|
1930
|
+
focus: function( elem ) {
|
1931
|
+
return elem === safeActiveElement() &&
|
1932
|
+
document.hasFocus() &&
|
1933
|
+
!!( elem.type || elem.href || ~elem.tabIndex );
|
2023
1934
|
},
|
2024
1935
|
|
2025
1936
|
// Boolean properties
|
2026
|
-
|
2027
|
-
|
1937
|
+
enabled: createDisabledPseudo( false ),
|
1938
|
+
disabled: createDisabledPseudo( true ),
|
1939
|
+
|
1940
|
+
checked: function( elem ) {
|
2028
1941
|
|
2029
|
-
"checked": function( elem ) {
|
2030
1942
|
// In CSS3, :checked should return both checked and selected elements
|
2031
|
-
//
|
2032
|
-
|
2033
|
-
|
1943
|
+
// https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
|
1944
|
+
return ( nodeName( elem, "input" ) && !!elem.checked ) ||
|
1945
|
+
( nodeName( elem, "option" ) && !!elem.selected );
|
2034
1946
|
},
|
2035
1947
|
|
2036
|
-
|
2037
|
-
|
2038
|
-
//
|
1948
|
+
selected: function( elem ) {
|
1949
|
+
|
1950
|
+
// Support: IE <=11+
|
1951
|
+
// Accessing the selectedIndex property
|
1952
|
+
// forces the browser to treat the default option as
|
1953
|
+
// selected when in an optgroup.
|
2039
1954
|
if ( elem.parentNode ) {
|
1955
|
+
// eslint-disable-next-line no-unused-expressions
|
2040
1956
|
elem.parentNode.selectedIndex;
|
2041
1957
|
}
|
2042
1958
|
|
@@ -2044,8 +1960,9 @@ Expr = Sizzle.selectors = {
|
|
2044
1960
|
},
|
2045
1961
|
|
2046
1962
|
// Contents
|
2047
|
-
|
2048
|
-
|
1963
|
+
empty: function( elem ) {
|
1964
|
+
|
1965
|
+
// https://www.w3.org/TR/selectors/#empty-pseudo
|
2049
1966
|
// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
|
2050
1967
|
// but not by others (comment: 8; processing instruction: 7; etc.)
|
2051
1968
|
// nodeType < 6 works because attributes (2) do not appear as children
|
@@ -2057,86 +1974,92 @@ Expr = Sizzle.selectors = {
|
|
2057
1974
|
return true;
|
2058
1975
|
},
|
2059
1976
|
|
2060
|
-
|
2061
|
-
return !Expr.pseudos
|
1977
|
+
parent: function( elem ) {
|
1978
|
+
return !Expr.pseudos.empty( elem );
|
2062
1979
|
},
|
2063
1980
|
|
2064
1981
|
// Element/input types
|
2065
|
-
|
1982
|
+
header: function( elem ) {
|
2066
1983
|
return rheader.test( elem.nodeName );
|
2067
1984
|
},
|
2068
1985
|
|
2069
|
-
|
1986
|
+
input: function( elem ) {
|
2070
1987
|
return rinputs.test( elem.nodeName );
|
2071
1988
|
},
|
2072
1989
|
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
1990
|
+
button: function( elem ) {
|
1991
|
+
return nodeName( elem, "input" ) && elem.type === "button" ||
|
1992
|
+
nodeName( elem, "button" );
|
2076
1993
|
},
|
2077
1994
|
|
2078
|
-
|
1995
|
+
text: function( elem ) {
|
2079
1996
|
var attr;
|
2080
|
-
return
|
2081
|
-
elem.type === "text" &&
|
1997
|
+
return nodeName( elem, "input" ) && elem.type === "text" &&
|
2082
1998
|
|
2083
|
-
// Support: IE<
|
2084
|
-
// New HTML5 attribute values (e.g., "search") appear
|
2085
|
-
|
1999
|
+
// Support: IE <10 only
|
2000
|
+
// New HTML5 attribute values (e.g., "search") appear
|
2001
|
+
// with elem.type === "text"
|
2002
|
+
( ( attr = elem.getAttribute( "type" ) ) == null ||
|
2003
|
+
attr.toLowerCase() === "text" );
|
2086
2004
|
},
|
2087
2005
|
|
2088
2006
|
// Position-in-collection
|
2089
|
-
|
2007
|
+
first: createPositionalPseudo( function() {
|
2090
2008
|
return [ 0 ];
|
2091
|
-
}),
|
2009
|
+
} ),
|
2092
2010
|
|
2093
|
-
|
2011
|
+
last: createPositionalPseudo( function( _matchIndexes, length ) {
|
2094
2012
|
return [ length - 1 ];
|
2095
|
-
}),
|
2013
|
+
} ),
|
2096
2014
|
|
2097
|
-
|
2015
|
+
eq: createPositionalPseudo( function( _matchIndexes, length, argument ) {
|
2098
2016
|
return [ argument < 0 ? argument + length : argument ];
|
2099
|
-
}),
|
2017
|
+
} ),
|
2100
2018
|
|
2101
|
-
|
2019
|
+
even: createPositionalPseudo( function( matchIndexes, length ) {
|
2102
2020
|
var i = 0;
|
2103
2021
|
for ( ; i < length; i += 2 ) {
|
2104
2022
|
matchIndexes.push( i );
|
2105
2023
|
}
|
2106
2024
|
return matchIndexes;
|
2107
|
-
}),
|
2025
|
+
} ),
|
2108
2026
|
|
2109
|
-
|
2027
|
+
odd: createPositionalPseudo( function( matchIndexes, length ) {
|
2110
2028
|
var i = 1;
|
2111
2029
|
for ( ; i < length; i += 2 ) {
|
2112
2030
|
matchIndexes.push( i );
|
2113
2031
|
}
|
2114
2032
|
return matchIndexes;
|
2115
|
-
}),
|
2116
|
-
|
2117
|
-
|
2118
|
-
var i
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2033
|
+
} ),
|
2034
|
+
|
2035
|
+
lt: createPositionalPseudo( function( matchIndexes, length, argument ) {
|
2036
|
+
var i;
|
2037
|
+
|
2038
|
+
if ( argument < 0 ) {
|
2039
|
+
i = argument + length;
|
2040
|
+
} else if ( argument > length ) {
|
2041
|
+
i = length;
|
2042
|
+
} else {
|
2043
|
+
i = argument;
|
2044
|
+
}
|
2045
|
+
|
2123
2046
|
for ( ; --i >= 0; ) {
|
2124
2047
|
matchIndexes.push( i );
|
2125
2048
|
}
|
2126
2049
|
return matchIndexes;
|
2127
|
-
}),
|
2050
|
+
} ),
|
2128
2051
|
|
2129
|
-
|
2052
|
+
gt: createPositionalPseudo( function( matchIndexes, length, argument ) {
|
2130
2053
|
var i = argument < 0 ? argument + length : argument;
|
2131
2054
|
for ( ; ++i < length; ) {
|
2132
2055
|
matchIndexes.push( i );
|
2133
2056
|
}
|
2134
2057
|
return matchIndexes;
|
2135
|
-
})
|
2058
|
+
} )
|
2136
2059
|
}
|
2137
2060
|
};
|
2138
2061
|
|
2139
|
-
Expr.pseudos
|
2062
|
+
Expr.pseudos.nth = Expr.pseudos.eq;
|
2140
2063
|
|
2141
2064
|
// Add button/input type pseudos
|
2142
2065
|
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
|
@@ -2151,7 +2074,7 @@ function setFilters() {}
|
|
2151
2074
|
setFilters.prototype = Expr.filters = Expr.pseudos;
|
2152
2075
|
Expr.setFilters = new setFilters();
|
2153
2076
|
|
2154
|
-
|
2077
|
+
function tokenize( selector, parseOnly ) {
|
2155
2078
|
var matched, match, tokens, type,
|
2156
2079
|
soFar, groups, preFilters,
|
2157
2080
|
cached = tokenCache[ selector + " " ];
|
@@ -2167,37 +2090,39 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
|
|
2167
2090
|
while ( soFar ) {
|
2168
2091
|
|
2169
2092
|
// Comma and first run
|
2170
|
-
if ( !matched || (match = rcomma.exec( soFar )) ) {
|
2093
|
+
if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
|
2171
2094
|
if ( match ) {
|
2095
|
+
|
2172
2096
|
// Don't consume trailing commas as valid
|
2173
|
-
soFar = soFar.slice( match[0].length ) || soFar;
|
2097
|
+
soFar = soFar.slice( match[ 0 ].length ) || soFar;
|
2174
2098
|
}
|
2175
|
-
groups.push( (tokens = []) );
|
2099
|
+
groups.push( ( tokens = [] ) );
|
2176
2100
|
}
|
2177
2101
|
|
2178
2102
|
matched = false;
|
2179
2103
|
|
2180
2104
|
// Combinators
|
2181
|
-
if ( (match =
|
2105
|
+
if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
|
2182
2106
|
matched = match.shift();
|
2183
|
-
tokens.push({
|
2107
|
+
tokens.push( {
|
2184
2108
|
value: matched,
|
2109
|
+
|
2185
2110
|
// Cast descendant combinators to space
|
2186
|
-
type: match[0].replace(
|
2187
|
-
});
|
2111
|
+
type: match[ 0 ].replace( rtrimCSS, " " )
|
2112
|
+
} );
|
2188
2113
|
soFar = soFar.slice( matched.length );
|
2189
2114
|
}
|
2190
2115
|
|
2191
2116
|
// Filters
|
2192
2117
|
for ( type in Expr.filter ) {
|
2193
|
-
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
|
2194
|
-
(match = preFilters[ type ]( match ))) ) {
|
2118
|
+
if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
|
2119
|
+
( match = preFilters[ type ]( match ) ) ) ) {
|
2195
2120
|
matched = match.shift();
|
2196
|
-
tokens.push({
|
2121
|
+
tokens.push( {
|
2197
2122
|
value: matched,
|
2198
2123
|
type: type,
|
2199
2124
|
matches: match
|
2200
|
-
});
|
2125
|
+
} );
|
2201
2126
|
soFar = soFar.slice( matched.length );
|
2202
2127
|
}
|
2203
2128
|
}
|
@@ -2210,20 +2135,23 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
|
|
2210
2135
|
// Return the length of the invalid excess
|
2211
2136
|
// if we're just parsing
|
2212
2137
|
// Otherwise, throw an error or return tokens
|
2213
|
-
|
2214
|
-
soFar.length
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2138
|
+
if ( parseOnly ) {
|
2139
|
+
return soFar.length;
|
2140
|
+
}
|
2141
|
+
|
2142
|
+
return soFar ?
|
2143
|
+
find.error( selector ) :
|
2144
|
+
|
2145
|
+
// Cache the tokens
|
2146
|
+
tokenCache( selector, groups ).slice( 0 );
|
2147
|
+
}
|
2220
2148
|
|
2221
2149
|
function toSelector( tokens ) {
|
2222
2150
|
var i = 0,
|
2223
2151
|
len = tokens.length,
|
2224
2152
|
selector = "";
|
2225
2153
|
for ( ; i < len; i++ ) {
|
2226
|
-
selector += tokens[i].value;
|
2154
|
+
selector += tokens[ i ].value;
|
2227
2155
|
}
|
2228
2156
|
return selector;
|
2229
2157
|
}
|
@@ -2236,9 +2164,10 @@ function addCombinator( matcher, combinator, base ) {
|
|
2236
2164
|
doneName = done++;
|
2237
2165
|
|
2238
2166
|
return combinator.first ?
|
2167
|
+
|
2239
2168
|
// Check against closest ancestor/preceding element
|
2240
2169
|
function( elem, context, xml ) {
|
2241
|
-
while ( (elem = elem[ dir ]) ) {
|
2170
|
+
while ( ( elem = elem[ dir ] ) ) {
|
2242
2171
|
if ( elem.nodeType === 1 || checkNonElements ) {
|
2243
2172
|
return matcher( elem, context, xml );
|
2244
2173
|
}
|
@@ -2248,12 +2177,12 @@ function addCombinator( matcher, combinator, base ) {
|
|
2248
2177
|
|
2249
2178
|
// Check against all ancestor/preceding elements
|
2250
2179
|
function( elem, context, xml ) {
|
2251
|
-
var oldCache,
|
2180
|
+
var oldCache, outerCache,
|
2252
2181
|
newCache = [ dirruns, doneName ];
|
2253
2182
|
|
2254
2183
|
// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
|
2255
2184
|
if ( xml ) {
|
2256
|
-
while ( (elem = elem[ dir ]) ) {
|
2185
|
+
while ( ( elem = elem[ dir ] ) ) {
|
2257
2186
|
if ( elem.nodeType === 1 || checkNonElements ) {
|
2258
2187
|
if ( matcher( elem, context, xml ) ) {
|
2259
2188
|
return true;
|
@@ -2261,27 +2190,24 @@ function addCombinator( matcher, combinator, base ) {
|
|
2261
2190
|
}
|
2262
2191
|
}
|
2263
2192
|
} else {
|
2264
|
-
while ( (elem = elem[ dir ]) ) {
|
2193
|
+
while ( ( elem = elem[ dir ] ) ) {
|
2265
2194
|
if ( elem.nodeType === 1 || checkNonElements ) {
|
2266
|
-
outerCache = elem[ expando ] || (elem[ expando ] = {});
|
2267
|
-
|
2268
|
-
// Support: IE <9 only
|
2269
|
-
// Defend against cloned attroperties (jQuery gh-1709)
|
2270
|
-
uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
|
2195
|
+
outerCache = elem[ expando ] || ( elem[ expando ] = {} );
|
2271
2196
|
|
2272
|
-
if ( skip && skip
|
2197
|
+
if ( skip && nodeName( elem, skip ) ) {
|
2273
2198
|
elem = elem[ dir ] || elem;
|
2274
|
-
} else if ( (oldCache =
|
2199
|
+
} else if ( ( oldCache = outerCache[ key ] ) &&
|
2275
2200
|
oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
|
2276
2201
|
|
2277
2202
|
// Assign to newCache so results back-propagate to previous elements
|
2278
|
-
return (newCache[ 2 ] = oldCache[ 2 ]);
|
2203
|
+
return ( newCache[ 2 ] = oldCache[ 2 ] );
|
2279
2204
|
} else {
|
2205
|
+
|
2280
2206
|
// Reuse newcache so results back-propagate to previous elements
|
2281
|
-
|
2207
|
+
outerCache[ key ] = newCache;
|
2282
2208
|
|
2283
2209
|
// A match means we're done; a fail means we have to keep checking
|
2284
|
-
if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
|
2210
|
+
if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
|
2285
2211
|
return true;
|
2286
2212
|
}
|
2287
2213
|
}
|
@@ -2297,20 +2223,20 @@ function elementMatcher( matchers ) {
|
|
2297
2223
|
function( elem, context, xml ) {
|
2298
2224
|
var i = matchers.length;
|
2299
2225
|
while ( i-- ) {
|
2300
|
-
if ( !matchers[i]( elem, context, xml ) ) {
|
2226
|
+
if ( !matchers[ i ]( elem, context, xml ) ) {
|
2301
2227
|
return false;
|
2302
2228
|
}
|
2303
2229
|
}
|
2304
2230
|
return true;
|
2305
2231
|
} :
|
2306
|
-
matchers[0];
|
2232
|
+
matchers[ 0 ];
|
2307
2233
|
}
|
2308
2234
|
|
2309
2235
|
function multipleContexts( selector, contexts, results ) {
|
2310
2236
|
var i = 0,
|
2311
2237
|
len = contexts.length;
|
2312
2238
|
for ( ; i < len; i++ ) {
|
2313
|
-
|
2239
|
+
find( selector, contexts[ i ], results );
|
2314
2240
|
}
|
2315
2241
|
return results;
|
2316
2242
|
}
|
@@ -2323,7 +2249,7 @@ function condense( unmatched, map, filter, context, xml ) {
|
|
2323
2249
|
mapped = map != null;
|
2324
2250
|
|
2325
2251
|
for ( ; i < len; i++ ) {
|
2326
|
-
if ( (elem = unmatched[i]) ) {
|
2252
|
+
if ( ( elem = unmatched[ i ] ) ) {
|
2327
2253
|
if ( !filter || filter( elem, context, xml ) ) {
|
2328
2254
|
newUnmatched.push( elem );
|
2329
2255
|
if ( mapped ) {
|
@@ -2343,34 +2269,38 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2343
2269
|
if ( postFinder && !postFinder[ expando ] ) {
|
2344
2270
|
postFinder = setMatcher( postFinder, postSelector );
|
2345
2271
|
}
|
2346
|
-
return markFunction(function( seed, results, context, xml ) {
|
2347
|
-
var temp, i, elem,
|
2272
|
+
return markFunction( function( seed, results, context, xml ) {
|
2273
|
+
var temp, i, elem, matcherOut,
|
2348
2274
|
preMap = [],
|
2349
2275
|
postMap = [],
|
2350
2276
|
preexisting = results.length,
|
2351
2277
|
|
2352
2278
|
// Get initial elements from seed or context
|
2353
|
-
elems = seed ||
|
2279
|
+
elems = seed ||
|
2280
|
+
multipleContexts( selector || "*",
|
2281
|
+
context.nodeType ? [ context ] : context, [] ),
|
2354
2282
|
|
2355
2283
|
// Prefilter to get matcher input, preserving a map for seed-results synchronization
|
2356
2284
|
matcherIn = preFilter && ( seed || !selector ) ?
|
2357
2285
|
condense( elems, preMap, preFilter, context, xml ) :
|
2358
|
-
elems
|
2286
|
+
elems;
|
2287
|
+
|
2288
|
+
if ( matcher ) {
|
2359
2289
|
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2290
|
+
// If we have a postFinder, or filtered seed, or non-seed postFilter
|
2291
|
+
// or preexisting results,
|
2292
|
+
matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
|
2363
2293
|
|
2364
|
-
|
2365
|
-
|
2294
|
+
// ...intermediate processing is necessary
|
2295
|
+
[] :
|
2366
2296
|
|
2367
|
-
|
2368
|
-
|
2369
|
-
matcherIn;
|
2297
|
+
// ...otherwise use results directly
|
2298
|
+
results;
|
2370
2299
|
|
2371
|
-
|
2372
|
-
if ( matcher ) {
|
2300
|
+
// Find primary matches
|
2373
2301
|
matcher( matcherIn, matcherOut, context, xml );
|
2302
|
+
} else {
|
2303
|
+
matcherOut = matcherIn;
|
2374
2304
|
}
|
2375
2305
|
|
2376
2306
|
// Apply postFilter
|
@@ -2381,8 +2311,8 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2381
2311
|
// Un-match failing elements by moving them back to matcherIn
|
2382
2312
|
i = temp.length;
|
2383
2313
|
while ( i-- ) {
|
2384
|
-
if ( (elem = temp[i]) ) {
|
2385
|
-
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
|
2314
|
+
if ( ( elem = temp[ i ] ) ) {
|
2315
|
+
matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
|
2386
2316
|
}
|
2387
2317
|
}
|
2388
2318
|
}
|
@@ -2390,25 +2320,27 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2390
2320
|
if ( seed ) {
|
2391
2321
|
if ( postFinder || preFilter ) {
|
2392
2322
|
if ( postFinder ) {
|
2323
|
+
|
2393
2324
|
// Get the final matcherOut by condensing this intermediate into postFinder contexts
|
2394
2325
|
temp = [];
|
2395
2326
|
i = matcherOut.length;
|
2396
2327
|
while ( i-- ) {
|
2397
|
-
if ( (elem = matcherOut[i]) ) {
|
2328
|
+
if ( ( elem = matcherOut[ i ] ) ) {
|
2329
|
+
|
2398
2330
|
// Restore matcherIn since elem is not yet a final match
|
2399
|
-
temp.push( (matcherIn[i] = elem) );
|
2331
|
+
temp.push( ( matcherIn[ i ] = elem ) );
|
2400
2332
|
}
|
2401
2333
|
}
|
2402
|
-
postFinder( null, (matcherOut = []), temp, xml );
|
2334
|
+
postFinder( null, ( matcherOut = [] ), temp, xml );
|
2403
2335
|
}
|
2404
2336
|
|
2405
2337
|
// Move matched elements from seed to results to keep them synchronized
|
2406
2338
|
i = matcherOut.length;
|
2407
2339
|
while ( i-- ) {
|
2408
|
-
if ( (elem = matcherOut[i]) &&
|
2409
|
-
(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
|
2340
|
+
if ( ( elem = matcherOut[ i ] ) &&
|
2341
|
+
( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {
|
2410
2342
|
|
2411
|
-
seed[temp] = !(results[temp] = elem);
|
2343
|
+
seed[ temp ] = !( results[ temp ] = elem );
|
2412
2344
|
}
|
2413
2345
|
}
|
2414
2346
|
}
|
@@ -2426,14 +2358,14 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
|
|
2426
2358
|
push.apply( results, matcherOut );
|
2427
2359
|
}
|
2428
2360
|
}
|
2429
|
-
});
|
2361
|
+
} );
|
2430
2362
|
}
|
2431
2363
|
|
2432
2364
|
function matcherFromTokens( tokens ) {
|
2433
2365
|
var checkContext, matcher, j,
|
2434
2366
|
len = tokens.length,
|
2435
|
-
leadingRelative = Expr.relative[ tokens[0].type ],
|
2436
|
-
implicitRelative = leadingRelative || Expr.relative[" "],
|
2367
|
+
leadingRelative = Expr.relative[ tokens[ 0 ].type ],
|
2368
|
+
implicitRelative = leadingRelative || Expr.relative[ " " ],
|
2437
2369
|
i = leadingRelative ? 1 : 0,
|
2438
2370
|
|
2439
2371
|
// The foundational matcher ensures that elements are reachable from top-level context(s)
|
@@ -2441,42 +2373,52 @@ function matcherFromTokens( tokens ) {
|
|
2441
2373
|
return elem === checkContext;
|
2442
2374
|
}, implicitRelative, true ),
|
2443
2375
|
matchAnyContext = addCombinator( function( elem ) {
|
2444
|
-
return indexOf( checkContext, elem ) > -1;
|
2376
|
+
return indexOf.call( checkContext, elem ) > -1;
|
2445
2377
|
}, implicitRelative, true ),
|
2446
2378
|
matchers = [ function( elem, context, xml ) {
|
2447
|
-
|
2448
|
-
|
2379
|
+
|
2380
|
+
// Support: IE 11+, Edge 17 - 18+
|
2381
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
2382
|
+
// two documents; shallow comparisons work.
|
2383
|
+
// eslint-disable-next-line eqeqeq
|
2384
|
+
var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
|
2385
|
+
( checkContext = context ).nodeType ?
|
2449
2386
|
matchContext( elem, context, xml ) :
|
2450
2387
|
matchAnyContext( elem, context, xml ) );
|
2451
|
-
|
2388
|
+
|
2389
|
+
// Avoid hanging onto element
|
2390
|
+
// (see https://github.com/jquery/sizzle/issues/299)
|
2452
2391
|
checkContext = null;
|
2453
2392
|
return ret;
|
2454
2393
|
} ];
|
2455
2394
|
|
2456
2395
|
for ( ; i < len; i++ ) {
|
2457
|
-
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
|
2458
|
-
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
|
2396
|
+
if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
|
2397
|
+
matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
|
2459
2398
|
} else {
|
2460
|
-
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
|
2399
|
+
matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
|
2461
2400
|
|
2462
2401
|
// Return special upon seeing a positional matcher
|
2463
2402
|
if ( matcher[ expando ] ) {
|
2403
|
+
|
2464
2404
|
// Find the next relative operator (if any) for proper handling
|
2465
2405
|
j = ++i;
|
2466
2406
|
for ( ; j < len; j++ ) {
|
2467
|
-
if ( Expr.relative[ tokens[j].type ] ) {
|
2407
|
+
if ( Expr.relative[ tokens[ j ].type ] ) {
|
2468
2408
|
break;
|
2469
2409
|
}
|
2470
2410
|
}
|
2471
2411
|
return setMatcher(
|
2472
2412
|
i > 1 && elementMatcher( matchers ),
|
2473
2413
|
i > 1 && toSelector(
|
2414
|
+
|
2474
2415
|
// If the preceding token was a descendant combinator, insert an implicit any-element `*`
|
2475
|
-
tokens.slice( 0, i - 1 )
|
2476
|
-
|
2416
|
+
tokens.slice( 0, i - 1 )
|
2417
|
+
.concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
|
2418
|
+
).replace( rtrimCSS, "$1" ),
|
2477
2419
|
matcher,
|
2478
2420
|
i < j && matcherFromTokens( tokens.slice( i, j ) ),
|
2479
|
-
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
|
2421
|
+
j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
|
2480
2422
|
j < len && toSelector( tokens )
|
2481
2423
|
);
|
2482
2424
|
}
|
@@ -2497,29 +2439,42 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2497
2439
|
unmatched = seed && [],
|
2498
2440
|
setMatched = [],
|
2499
2441
|
contextBackup = outermostContext,
|
2442
|
+
|
2500
2443
|
// We must always have either seed elements or outermost context
|
2501
|
-
elems = seed || byElement && Expr.find
|
2444
|
+
elems = seed || byElement && Expr.find.TAG( "*", outermost ),
|
2445
|
+
|
2502
2446
|
// Use integer dirruns iff this is the outermost matcher
|
2503
|
-
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
|
2447
|
+
dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
|
2504
2448
|
len = elems.length;
|
2505
2449
|
|
2506
2450
|
if ( outermost ) {
|
2507
|
-
|
2451
|
+
|
2452
|
+
// Support: IE 11+, Edge 17 - 18+
|
2453
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
2454
|
+
// two documents; shallow comparisons work.
|
2455
|
+
// eslint-disable-next-line eqeqeq
|
2456
|
+
outermostContext = context == document || context || outermost;
|
2508
2457
|
}
|
2509
2458
|
|
2510
2459
|
// Add elements passing elementMatchers directly to results
|
2511
|
-
// Support:
|
2512
|
-
// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
|
2513
|
-
|
2460
|
+
// Support: iOS <=7 - 9 only
|
2461
|
+
// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
|
2462
|
+
// elements by id. (see trac-14142)
|
2463
|
+
for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
|
2514
2464
|
if ( byElement && elem ) {
|
2515
2465
|
j = 0;
|
2516
|
-
|
2466
|
+
|
2467
|
+
// Support: IE 11+, Edge 17 - 18+
|
2468
|
+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
|
2469
|
+
// two documents; shallow comparisons work.
|
2470
|
+
// eslint-disable-next-line eqeqeq
|
2471
|
+
if ( !context && elem.ownerDocument != document ) {
|
2517
2472
|
setDocument( elem );
|
2518
2473
|
xml = !documentIsHTML;
|
2519
2474
|
}
|
2520
|
-
while ( (matcher = elementMatchers[j++]) ) {
|
2521
|
-
if ( matcher( elem, context || document, xml) ) {
|
2522
|
-
|
2475
|
+
while ( ( matcher = elementMatchers[ j++ ] ) ) {
|
2476
|
+
if ( matcher( elem, context || document, xml ) ) {
|
2477
|
+
push.call( results, elem );
|
2523
2478
|
break;
|
2524
2479
|
}
|
2525
2480
|
}
|
@@ -2530,8 +2485,9 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2530
2485
|
|
2531
2486
|
// Track unmatched elements for set filters
|
2532
2487
|
if ( bySet ) {
|
2488
|
+
|
2533
2489
|
// They will have gone through all possible matchers
|
2534
|
-
if ( (elem = !matcher && elem) ) {
|
2490
|
+
if ( ( elem = !matcher && elem ) ) {
|
2535
2491
|
matchedCount--;
|
2536
2492
|
}
|
2537
2493
|
|
@@ -2555,16 +2511,17 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2555
2511
|
// numerically zero.
|
2556
2512
|
if ( bySet && i !== matchedCount ) {
|
2557
2513
|
j = 0;
|
2558
|
-
while ( (matcher = setMatchers[j++]) ) {
|
2514
|
+
while ( ( matcher = setMatchers[ j++ ] ) ) {
|
2559
2515
|
matcher( unmatched, setMatched, context, xml );
|
2560
2516
|
}
|
2561
2517
|
|
2562
2518
|
if ( seed ) {
|
2519
|
+
|
2563
2520
|
// Reintegrate element matches to eliminate the need for sorting
|
2564
2521
|
if ( matchedCount > 0 ) {
|
2565
2522
|
while ( i-- ) {
|
2566
|
-
if ( !(unmatched[i] || setMatched[i]) ) {
|
2567
|
-
setMatched[i] = pop.call( results );
|
2523
|
+
if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
|
2524
|
+
setMatched[ i ] = pop.call( results );
|
2568
2525
|
}
|
2569
2526
|
}
|
2570
2527
|
}
|
@@ -2580,7 +2537,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2580
2537
|
if ( outermost && !seed && setMatched.length > 0 &&
|
2581
2538
|
( matchedCount + setMatchers.length ) > 1 ) {
|
2582
2539
|
|
2583
|
-
|
2540
|
+
jQuery.uniqueSort( results );
|
2584
2541
|
}
|
2585
2542
|
}
|
2586
2543
|
|
@@ -2598,20 +2555,21 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
|
2598
2555
|
superMatcher;
|
2599
2556
|
}
|
2600
2557
|
|
2601
|
-
|
2558
|
+
function compile( selector, match /* Internal Use Only */ ) {
|
2602
2559
|
var i,
|
2603
2560
|
setMatchers = [],
|
2604
2561
|
elementMatchers = [],
|
2605
2562
|
cached = compilerCache[ selector + " " ];
|
2606
2563
|
|
2607
2564
|
if ( !cached ) {
|
2565
|
+
|
2608
2566
|
// Generate a function of recursive functions that can be used to check each element
|
2609
2567
|
if ( !match ) {
|
2610
2568
|
match = tokenize( selector );
|
2611
2569
|
}
|
2612
2570
|
i = match.length;
|
2613
2571
|
while ( i-- ) {
|
2614
|
-
cached = matcherFromTokens( match[i] );
|
2572
|
+
cached = matcherFromTokens( match[ i ] );
|
2615
2573
|
if ( cached[ expando ] ) {
|
2616
2574
|
setMatchers.push( cached );
|
2617
2575
|
} else {
|
@@ -2620,27 +2578,28 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
|
|
2620
2578
|
}
|
2621
2579
|
|
2622
2580
|
// Cache the compiled function
|
2623
|
-
cached = compilerCache( selector,
|
2581
|
+
cached = compilerCache( selector,
|
2582
|
+
matcherFromGroupMatchers( elementMatchers, setMatchers ) );
|
2624
2583
|
|
2625
2584
|
// Save selector and tokenization
|
2626
2585
|
cached.selector = selector;
|
2627
2586
|
}
|
2628
2587
|
return cached;
|
2629
|
-
}
|
2588
|
+
}
|
2630
2589
|
|
2631
2590
|
/**
|
2632
|
-
* A low-level selection function that works with
|
2591
|
+
* A low-level selection function that works with jQuery's compiled
|
2633
2592
|
* selector functions
|
2634
2593
|
* @param {String|Function} selector A selector or a pre-compiled
|
2635
|
-
* selector function built with
|
2594
|
+
* selector function built with jQuery selector compile
|
2636
2595
|
* @param {Element} context
|
2637
2596
|
* @param {Array} [results]
|
2638
2597
|
* @param {Array} [seed] A set of elements to match against
|
2639
2598
|
*/
|
2640
|
-
|
2599
|
+
function select( selector, context, results, seed ) {
|
2641
2600
|
var i, tokens, token, type, find,
|
2642
2601
|
compiled = typeof selector === "function" && selector,
|
2643
|
-
match = !seed && tokenize( (selector = compiled.selector || selector) );
|
2602
|
+
match = !seed && tokenize( ( selector = compiled.selector || selector ) );
|
2644
2603
|
|
2645
2604
|
results = results || [];
|
2646
2605
|
|
@@ -2649,11 +2608,14 @@ select = Sizzle.select = function( selector, context, results, seed ) {
|
|
2649
2608
|
if ( match.length === 1 ) {
|
2650
2609
|
|
2651
2610
|
// Reduce context if the leading compound selector is an ID
|
2652
|
-
tokens = match[0] = match[0].slice( 0 );
|
2653
|
-
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
|
2654
|
-
context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
|
2655
|
-
|
2656
|
-
context = ( Expr.find
|
2611
|
+
tokens = match[ 0 ] = match[ 0 ].slice( 0 );
|
2612
|
+
if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
|
2613
|
+
context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
|
2614
|
+
|
2615
|
+
context = ( Expr.find.ID(
|
2616
|
+
token.matches[ 0 ].replace( runescape, funescape ),
|
2617
|
+
context
|
2618
|
+
) || [] )[ 0 ];
|
2657
2619
|
if ( !context ) {
|
2658
2620
|
return results;
|
2659
2621
|
|
@@ -2666,20 +2628,22 @@ select = Sizzle.select = function( selector, context, results, seed ) {
|
|
2666
2628
|
}
|
2667
2629
|
|
2668
2630
|
// Fetch a seed set for right-to-left matching
|
2669
|
-
i = matchExpr
|
2631
|
+
i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;
|
2670
2632
|
while ( i-- ) {
|
2671
|
-
token = tokens[i];
|
2633
|
+
token = tokens[ i ];
|
2672
2634
|
|
2673
2635
|
// Abort if we hit a combinator
|
2674
|
-
if ( Expr.relative[ (type = token.type) ] ) {
|
2636
|
+
if ( Expr.relative[ ( type = token.type ) ] ) {
|
2675
2637
|
break;
|
2676
2638
|
}
|
2677
|
-
if ( (find = Expr.find[ type ]) ) {
|
2639
|
+
if ( ( find = Expr.find[ type ] ) ) {
|
2640
|
+
|
2678
2641
|
// Search, expanding context for leading sibling combinators
|
2679
|
-
if ( (seed = find(
|
2680
|
-
token.matches[0].replace( runescape, funescape ),
|
2681
|
-
rsibling.test( tokens[0].type ) &&
|
2682
|
-
|
2642
|
+
if ( ( seed = find(
|
2643
|
+
token.matches[ 0 ].replace( runescape, funescape ),
|
2644
|
+
rsibling.test( tokens[ 0 ].type ) &&
|
2645
|
+
testContext( context.parentNode ) || context
|
2646
|
+
) ) ) {
|
2683
2647
|
|
2684
2648
|
// If seed is empty or no tokens remain, we can return early
|
2685
2649
|
tokens.splice( i, 1 );
|
@@ -2705,89 +2669,48 @@ select = Sizzle.select = function( selector, context, results, seed ) {
|
|
2705
2669
|
!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
|
2706
2670
|
);
|
2707
2671
|
return results;
|
2708
|
-
}
|
2672
|
+
}
|
2709
2673
|
|
2710
2674
|
// One-time assignments
|
2711
2675
|
|
2676
|
+
// Support: Android <=4.0 - 4.1+
|
2712
2677
|
// Sort stability
|
2713
|
-
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
|
2714
|
-
|
2715
|
-
// Support: Chrome 14-35+
|
2716
|
-
// Always assume duplicates if they aren't passed to the comparison function
|
2717
|
-
support.detectDuplicates = !!hasDuplicate;
|
2678
|
+
support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
|
2718
2679
|
|
2719
2680
|
// Initialize against the default document
|
2720
2681
|
setDocument();
|
2721
2682
|
|
2722
|
-
// Support:
|
2683
|
+
// Support: Android <=4.0 - 4.1+
|
2723
2684
|
// Detached nodes confoundingly follow *each other*
|
2724
|
-
support.sortDetached = assert(function( el ) {
|
2725
|
-
// Should return 1, but returns 4 (following)
|
2726
|
-
return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
|
2727
|
-
});
|
2728
|
-
|
2729
|
-
// Support: IE<8
|
2730
|
-
// Prevent attribute/property "interpolation"
|
2731
|
-
// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
2732
|
-
if ( !assert(function( el ) {
|
2733
|
-
el.innerHTML = "<a href='#'></a>";
|
2734
|
-
return el.firstChild.getAttribute("href") === "#" ;
|
2735
|
-
}) ) {
|
2736
|
-
addHandle( "type|href|height|width", function( elem, name, isXML ) {
|
2737
|
-
if ( !isXML ) {
|
2738
|
-
return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
|
2739
|
-
}
|
2740
|
-
});
|
2741
|
-
}
|
2742
|
-
|
2743
|
-
// Support: IE<9
|
2744
|
-
// Use defaultValue in place of getAttribute("value")
|
2745
|
-
if ( !support.attributes || !assert(function( el ) {
|
2746
|
-
el.innerHTML = "<input/>";
|
2747
|
-
el.firstChild.setAttribute( "value", "" );
|
2748
|
-
return el.firstChild.getAttribute( "value" ) === "";
|
2749
|
-
}) ) {
|
2750
|
-
addHandle( "value", function( elem, name, isXML ) {
|
2751
|
-
if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
|
2752
|
-
return elem.defaultValue;
|
2753
|
-
}
|
2754
|
-
});
|
2755
|
-
}
|
2756
|
-
|
2757
|
-
// Support: IE<9
|
2758
|
-
// Use getAttributeNode to fetch booleans when getAttribute lies
|
2759
|
-
if ( !assert(function( el ) {
|
2760
|
-
return el.getAttribute("disabled") == null;
|
2761
|
-
}) ) {
|
2762
|
-
addHandle( booleans, function( elem, name, isXML ) {
|
2763
|
-
var val;
|
2764
|
-
if ( !isXML ) {
|
2765
|
-
return elem[ name ] === true ? name.toLowerCase() :
|
2766
|
-
(val = elem.getAttributeNode( name )) && val.specified ?
|
2767
|
-
val.value :
|
2768
|
-
null;
|
2769
|
-
}
|
2770
|
-
});
|
2771
|
-
}
|
2772
|
-
|
2773
|
-
return Sizzle;
|
2774
|
-
|
2775
|
-
})( window );
|
2776
|
-
|
2685
|
+
support.sortDetached = assert( function( el ) {
|
2777
2686
|
|
2687
|
+
// Should return 1, but returns 4 (following)
|
2688
|
+
return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
|
2689
|
+
} );
|
2778
2690
|
|
2779
|
-
jQuery.find =
|
2780
|
-
jQuery.expr = Sizzle.selectors;
|
2691
|
+
jQuery.find = find;
|
2781
2692
|
|
2782
2693
|
// Deprecated
|
2783
2694
|
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
|
2784
|
-
jQuery.
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2695
|
+
jQuery.unique = jQuery.uniqueSort;
|
2696
|
+
|
2697
|
+
// These have always been private, but they used to be documented
|
2698
|
+
// as part of Sizzle so let's maintain them in the 3.x line
|
2699
|
+
// for backwards compatibility purposes.
|
2700
|
+
find.compile = compile;
|
2701
|
+
find.select = select;
|
2702
|
+
find.setDocument = setDocument;
|
2703
|
+
|
2704
|
+
find.escape = jQuery.escapeSelector;
|
2705
|
+
find.getText = jQuery.text;
|
2706
|
+
find.isXML = jQuery.isXMLDoc;
|
2707
|
+
find.selectors = jQuery.expr;
|
2708
|
+
find.support = jQuery.support;
|
2709
|
+
find.uniqueSort = jQuery.uniqueSort;
|
2789
2710
|
|
2711
|
+
/* eslint-enable */
|
2790
2712
|
|
2713
|
+
} )();
|
2791
2714
|
|
2792
2715
|
|
2793
2716
|
var dir = function( elem, dir, until ) {
|
@@ -2821,13 +2744,6 @@ var siblings = function( n, elem ) {
|
|
2821
2744
|
|
2822
2745
|
var rneedsContext = jQuery.expr.match.needsContext;
|
2823
2746
|
|
2824
|
-
|
2825
|
-
|
2826
|
-
function nodeName( elem, name ) {
|
2827
|
-
|
2828
|
-
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
2829
|
-
|
2830
|
-
};
|
2831
2747
|
var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
|
2832
2748
|
|
2833
2749
|
|
@@ -2926,8 +2842,8 @@ jQuery.fn.extend( {
|
|
2926
2842
|
var rootjQuery,
|
2927
2843
|
|
2928
2844
|
// A simple way to check for HTML strings
|
2929
|
-
// Prioritize #id over <tag> to avoid XSS via location.hash (
|
2930
|
-
// Strict HTML recognition (
|
2845
|
+
// Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
|
2846
|
+
// Strict HTML recognition (trac-11290: must start with <)
|
2931
2847
|
// Shortcut simple #id case for speed
|
2932
2848
|
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
|
2933
2849
|
|
@@ -3078,7 +2994,7 @@ jQuery.fn.extend( {
|
|
3078
2994
|
if ( cur.nodeType < 11 && ( targets ?
|
3079
2995
|
targets.index( cur ) > -1 :
|
3080
2996
|
|
3081
|
-
// Don't pass non-elements to
|
2997
|
+
// Don't pass non-elements to jQuery#find
|
3082
2998
|
cur.nodeType === 1 &&
|
3083
2999
|
jQuery.find.matchesSelector( cur, selectors ) ) ) {
|
3084
3000
|
|
@@ -3141,7 +3057,7 @@ jQuery.each( {
|
|
3141
3057
|
parents: function( elem ) {
|
3142
3058
|
return dir( elem, "parentNode" );
|
3143
3059
|
},
|
3144
|
-
parentsUntil: function( elem,
|
3060
|
+
parentsUntil: function( elem, _i, until ) {
|
3145
3061
|
return dir( elem, "parentNode", until );
|
3146
3062
|
},
|
3147
3063
|
next: function( elem ) {
|
@@ -3156,10 +3072,10 @@ jQuery.each( {
|
|
3156
3072
|
prevAll: function( elem ) {
|
3157
3073
|
return dir( elem, "previousSibling" );
|
3158
3074
|
},
|
3159
|
-
nextUntil: function( elem,
|
3075
|
+
nextUntil: function( elem, _i, until ) {
|
3160
3076
|
return dir( elem, "nextSibling", until );
|
3161
3077
|
},
|
3162
|
-
prevUntil: function( elem,
|
3078
|
+
prevUntil: function( elem, _i, until ) {
|
3163
3079
|
return dir( elem, "previousSibling", until );
|
3164
3080
|
},
|
3165
3081
|
siblings: function( elem ) {
|
@@ -3169,7 +3085,13 @@ jQuery.each( {
|
|
3169
3085
|
return siblings( elem.firstChild );
|
3170
3086
|
},
|
3171
3087
|
contents: function( elem ) {
|
3172
|
-
if (
|
3088
|
+
if ( elem.contentDocument != null &&
|
3089
|
+
|
3090
|
+
// Support: IE 11+
|
3091
|
+
// <object> elements with no `data` attribute has an object
|
3092
|
+
// `contentDocument` with a `null` prototype.
|
3093
|
+
getProto( elem.contentDocument ) ) {
|
3094
|
+
|
3173
3095
|
return elem.contentDocument;
|
3174
3096
|
}
|
3175
3097
|
|
@@ -3512,7 +3434,7 @@ jQuery.extend( {
|
|
3512
3434
|
var fns = arguments;
|
3513
3435
|
|
3514
3436
|
return jQuery.Deferred( function( newDefer ) {
|
3515
|
-
jQuery.each( tuples, function(
|
3437
|
+
jQuery.each( tuples, function( _i, tuple ) {
|
3516
3438
|
|
3517
3439
|
// Map tuples (progress, done, fail) to arguments (done, fail, progress)
|
3518
3440
|
var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
|
@@ -3627,7 +3549,7 @@ jQuery.extend( {
|
|
3627
3549
|
|
3628
3550
|
if ( jQuery.Deferred.exceptionHook ) {
|
3629
3551
|
jQuery.Deferred.exceptionHook( e,
|
3630
|
-
process.
|
3552
|
+
process.error );
|
3631
3553
|
}
|
3632
3554
|
|
3633
3555
|
// Support: Promises/A+ section 2.3.3.3.4.1
|
@@ -3655,10 +3577,17 @@ jQuery.extend( {
|
|
3655
3577
|
process();
|
3656
3578
|
} else {
|
3657
3579
|
|
3658
|
-
// Call an optional hook to record the
|
3580
|
+
// Call an optional hook to record the error, in case of exception
|
3659
3581
|
// since it's otherwise lost when execution goes async
|
3660
|
-
if ( jQuery.Deferred.
|
3661
|
-
process.
|
3582
|
+
if ( jQuery.Deferred.getErrorHook ) {
|
3583
|
+
process.error = jQuery.Deferred.getErrorHook();
|
3584
|
+
|
3585
|
+
// The deprecated alias of the above. While the name suggests
|
3586
|
+
// returning the stack, not an error instance, jQuery just passes
|
3587
|
+
// it directly to `console.warn` so both will work; an instance
|
3588
|
+
// just better cooperates with source maps.
|
3589
|
+
} else if ( jQuery.Deferred.getStackHook ) {
|
3590
|
+
process.error = jQuery.Deferred.getStackHook();
|
3662
3591
|
}
|
3663
3592
|
window.setTimeout( process );
|
3664
3593
|
}
|
@@ -3792,8 +3721,8 @@ jQuery.extend( {
|
|
3792
3721
|
resolveContexts = Array( i ),
|
3793
3722
|
resolveValues = slice.call( arguments ),
|
3794
3723
|
|
3795
|
-
// the
|
3796
|
-
|
3724
|
+
// the primary Deferred
|
3725
|
+
primary = jQuery.Deferred(),
|
3797
3726
|
|
3798
3727
|
// subordinate callback factory
|
3799
3728
|
updateFunc = function( i ) {
|
@@ -3801,30 +3730,30 @@ jQuery.extend( {
|
|
3801
3730
|
resolveContexts[ i ] = this;
|
3802
3731
|
resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
|
3803
3732
|
if ( !( --remaining ) ) {
|
3804
|
-
|
3733
|
+
primary.resolveWith( resolveContexts, resolveValues );
|
3805
3734
|
}
|
3806
3735
|
};
|
3807
3736
|
};
|
3808
3737
|
|
3809
3738
|
// Single- and empty arguments are adopted like Promise.resolve
|
3810
3739
|
if ( remaining <= 1 ) {
|
3811
|
-
adoptValue( singleValue,
|
3740
|
+
adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
|
3812
3741
|
!remaining );
|
3813
3742
|
|
3814
3743
|
// Use .then() to unwrap secondary thenables (cf. gh-3000)
|
3815
|
-
if (
|
3744
|
+
if ( primary.state() === "pending" ||
|
3816
3745
|
isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
|
3817
3746
|
|
3818
|
-
return
|
3747
|
+
return primary.then();
|
3819
3748
|
}
|
3820
3749
|
}
|
3821
3750
|
|
3822
3751
|
// Multiple arguments are aggregated like Promise.all array elements
|
3823
3752
|
while ( i-- ) {
|
3824
|
-
adoptValue( resolveValues[ i ], updateFunc( i ),
|
3753
|
+
adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
|
3825
3754
|
}
|
3826
3755
|
|
3827
|
-
return
|
3756
|
+
return primary.promise();
|
3828
3757
|
}
|
3829
3758
|
} );
|
3830
3759
|
|
@@ -3833,12 +3762,16 @@ jQuery.extend( {
|
|
3833
3762
|
// warn about them ASAP rather than swallowing them by default.
|
3834
3763
|
var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
|
3835
3764
|
|
3836
|
-
jQuery.Deferred.
|
3765
|
+
// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
|
3766
|
+
// captured before the async barrier to get the original error cause
|
3767
|
+
// which may otherwise be hidden.
|
3768
|
+
jQuery.Deferred.exceptionHook = function( error, asyncError ) {
|
3837
3769
|
|
3838
3770
|
// Support: IE 8 - 9 only
|
3839
3771
|
// Console exists when dev tools are open, which can happen at any time
|
3840
3772
|
if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
|
3841
|
-
window.console.warn( "jQuery.Deferred exception: " + error.message,
|
3773
|
+
window.console.warn( "jQuery.Deferred exception: " + error.message,
|
3774
|
+
error.stack, asyncError );
|
3842
3775
|
}
|
3843
3776
|
};
|
3844
3777
|
|
@@ -3878,7 +3811,7 @@ jQuery.extend( {
|
|
3878
3811
|
isReady: false,
|
3879
3812
|
|
3880
3813
|
// A counter to track how many items to wait for before
|
3881
|
-
// the ready event fires. See
|
3814
|
+
// the ready event fires. See trac-6781
|
3882
3815
|
readyWait: 1,
|
3883
3816
|
|
3884
3817
|
// Handle when the DOM is ready
|
@@ -3965,7 +3898,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|
3965
3898
|
// ...except when executing function values
|
3966
3899
|
} else {
|
3967
3900
|
bulk = fn;
|
3968
|
-
fn = function( elem,
|
3901
|
+
fn = function( elem, _key, value ) {
|
3969
3902
|
return bulk.call( jQuery( elem ), value );
|
3970
3903
|
};
|
3971
3904
|
}
|
@@ -3975,8 +3908,8 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|
3975
3908
|
for ( ; i < len; i++ ) {
|
3976
3909
|
fn(
|
3977
3910
|
elems[ i ], key, raw ?
|
3978
|
-
|
3979
|
-
|
3911
|
+
value :
|
3912
|
+
value.call( elems[ i ], i, fn( elems[ i ], key ) )
|
3980
3913
|
);
|
3981
3914
|
}
|
3982
3915
|
}
|
@@ -4000,13 +3933,13 @@ var rmsPrefix = /^-ms-/,
|
|
4000
3933
|
rdashAlpha = /-([a-z])/g;
|
4001
3934
|
|
4002
3935
|
// Used by camelCase as callback to replace()
|
4003
|
-
function fcamelCase(
|
3936
|
+
function fcamelCase( _all, letter ) {
|
4004
3937
|
return letter.toUpperCase();
|
4005
3938
|
}
|
4006
3939
|
|
4007
3940
|
// Convert dashed to camelCase; used by the css and data modules
|
4008
3941
|
// Support: IE <=9 - 11, Edge 12 - 15
|
4009
|
-
// Microsoft forgot to hump their vendor prefix (
|
3942
|
+
// Microsoft forgot to hump their vendor prefix (trac-9572)
|
4010
3943
|
function camelCase( string ) {
|
4011
3944
|
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
4012
3945
|
}
|
@@ -4042,7 +3975,7 @@ Data.prototype = {
|
|
4042
3975
|
value = {};
|
4043
3976
|
|
4044
3977
|
// We can accept data for non-element nodes in modern browsers,
|
4045
|
-
// but we should not, see
|
3978
|
+
// but we should not, see trac-8335.
|
4046
3979
|
// Always return an empty object.
|
4047
3980
|
if ( acceptData( owner ) ) {
|
4048
3981
|
|
@@ -4281,7 +4214,7 @@ jQuery.fn.extend( {
|
|
4281
4214
|
while ( i-- ) {
|
4282
4215
|
|
4283
4216
|
// Support: IE 11 only
|
4284
|
-
// The attrs elements can be null (
|
4217
|
+
// The attrs elements can be null (trac-14894)
|
4285
4218
|
if ( attrs[ i ] ) {
|
4286
4219
|
name = attrs[ i ].name;
|
4287
4220
|
if ( name.indexOf( "data-" ) === 0 ) {
|
@@ -4528,27 +4461,6 @@ var isHiddenWithinTree = function( elem, el ) {
|
|
4528
4461
|
jQuery.css( elem, "display" ) === "none";
|
4529
4462
|
};
|
4530
4463
|
|
4531
|
-
var swap = function( elem, options, callback, args ) {
|
4532
|
-
var ret, name,
|
4533
|
-
old = {};
|
4534
|
-
|
4535
|
-
// Remember the old values, and insert the new ones
|
4536
|
-
for ( name in options ) {
|
4537
|
-
old[ name ] = elem.style[ name ];
|
4538
|
-
elem.style[ name ] = options[ name ];
|
4539
|
-
}
|
4540
|
-
|
4541
|
-
ret = callback.apply( elem, args || [] );
|
4542
|
-
|
4543
|
-
// Revert the old values
|
4544
|
-
for ( name in options ) {
|
4545
|
-
elem.style[ name ] = old[ name ];
|
4546
|
-
}
|
4547
|
-
|
4548
|
-
return ret;
|
4549
|
-
};
|
4550
|
-
|
4551
|
-
|
4552
4464
|
|
4553
4465
|
|
4554
4466
|
function adjustCSS( elem, prop, valueParts, tween ) {
|
@@ -4719,11 +4631,40 @@ var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
|
|
4719
4631
|
|
4720
4632
|
|
4721
4633
|
|
4722
|
-
|
4723
|
-
var
|
4634
|
+
( function() {
|
4635
|
+
var fragment = document.createDocumentFragment(),
|
4636
|
+
div = fragment.appendChild( document.createElement( "div" ) ),
|
4637
|
+
input = document.createElement( "input" );
|
4638
|
+
|
4639
|
+
// Support: Android 4.0 - 4.3 only
|
4640
|
+
// Check state lost if the name is set (trac-11217)
|
4641
|
+
// Support: Windows Web Apps (WWA)
|
4642
|
+
// `name` and `type` must use .setAttribute for WWA (trac-14901)
|
4643
|
+
input.setAttribute( "type", "radio" );
|
4644
|
+
input.setAttribute( "checked", "checked" );
|
4645
|
+
input.setAttribute( "name", "t" );
|
4646
|
+
|
4647
|
+
div.appendChild( input );
|
4648
|
+
|
4649
|
+
// Support: Android <=4.1 only
|
4650
|
+
// Older WebKit doesn't clone checked state correctly in fragments
|
4651
|
+
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
4652
|
+
|
4653
|
+
// Support: IE <=11 only
|
4654
|
+
// Make sure textarea (and checkbox) defaultValue is properly cloned
|
4655
|
+
div.innerHTML = "<textarea>x</textarea>";
|
4656
|
+
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
|
4724
4657
|
|
4725
4658
|
// Support: IE <=9 only
|
4726
|
-
|
4659
|
+
// IE <=9 replaces <option> tags with their contents when inserted outside of
|
4660
|
+
// the select element.
|
4661
|
+
div.innerHTML = "<option></option>";
|
4662
|
+
support.option = !!div.lastChild;
|
4663
|
+
} )();
|
4664
|
+
|
4665
|
+
|
4666
|
+
// We have to close these tags to support XHTML (trac-13200)
|
4667
|
+
var wrapMap = {
|
4727
4668
|
|
4728
4669
|
// XHTML parsers do not magically insert elements in the
|
4729
4670
|
// same way that tag soup parsers do. So we cannot shorten
|
@@ -4736,17 +4677,19 @@ var wrapMap = {
|
|
4736
4677
|
_default: [ 0, "", "" ]
|
4737
4678
|
};
|
4738
4679
|
|
4739
|
-
// Support: IE <=9 only
|
4740
|
-
wrapMap.optgroup = wrapMap.option;
|
4741
|
-
|
4742
4680
|
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
4743
4681
|
wrapMap.th = wrapMap.td;
|
4744
4682
|
|
4683
|
+
// Support: IE <=9 only
|
4684
|
+
if ( !support.option ) {
|
4685
|
+
wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
|
4686
|
+
}
|
4687
|
+
|
4745
4688
|
|
4746
4689
|
function getAll( context, tag ) {
|
4747
4690
|
|
4748
4691
|
// Support: IE <=9 - 11 only
|
4749
|
-
// Use typeof to avoid zero-argument method invocation on host objects (
|
4692
|
+
// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
|
4750
4693
|
var ret;
|
4751
4694
|
|
4752
4695
|
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
@@ -4829,7 +4772,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
|
4829
4772
|
// Remember the top-level container
|
4830
4773
|
tmp = fragment.firstChild;
|
4831
4774
|
|
4832
|
-
// Ensure the created nodes are orphaned (
|
4775
|
+
// Ensure the created nodes are orphaned (trac-12392)
|
4833
4776
|
tmp.textContent = "";
|
4834
4777
|
}
|
4835
4778
|
}
|
@@ -4870,40 +4813,11 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
|
4870
4813
|
}
|
4871
4814
|
}
|
4872
4815
|
|
4873
|
-
return fragment;
|
4874
|
-
}
|
4875
|
-
|
4876
|
-
|
4877
|
-
( function() {
|
4878
|
-
var fragment = document.createDocumentFragment(),
|
4879
|
-
div = fragment.appendChild( document.createElement( "div" ) ),
|
4880
|
-
input = document.createElement( "input" );
|
4881
|
-
|
4882
|
-
// Support: Android 4.0 - 4.3 only
|
4883
|
-
// Check state lost if the name is set (#11217)
|
4884
|
-
// Support: Windows Web Apps (WWA)
|
4885
|
-
// `name` and `type` must use .setAttribute for WWA (#14901)
|
4886
|
-
input.setAttribute( "type", "radio" );
|
4887
|
-
input.setAttribute( "checked", "checked" );
|
4888
|
-
input.setAttribute( "name", "t" );
|
4889
|
-
|
4890
|
-
div.appendChild( input );
|
4891
|
-
|
4892
|
-
// Support: Android <=4.1 only
|
4893
|
-
// Older WebKit doesn't clone checked state correctly in fragments
|
4894
|
-
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
4895
|
-
|
4896
|
-
// Support: IE <=11 only
|
4897
|
-
// Make sure textarea (and checkbox) defaultValue is properly cloned
|
4898
|
-
div.innerHTML = "<textarea>x</textarea>";
|
4899
|
-
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
|
4900
|
-
} )();
|
4901
|
-
|
4816
|
+
return fragment;
|
4817
|
+
}
|
4902
4818
|
|
4903
|
-
|
4904
|
-
|
4905
|
-
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
|
4906
|
-
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
|
4819
|
+
|
4820
|
+
var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
|
4907
4821
|
|
4908
4822
|
function returnTrue() {
|
4909
4823
|
return true;
|
@@ -4913,25 +4827,6 @@ function returnFalse() {
|
|
4913
4827
|
return false;
|
4914
4828
|
}
|
4915
4829
|
|
4916
|
-
// Support: IE <=9 - 11+
|
4917
|
-
// focus() and blur() are asynchronous, except when they are no-op.
|
4918
|
-
// So expect focus to be synchronous when the element is already active,
|
4919
|
-
// and blur to be synchronous when the element is not already active.
|
4920
|
-
// (focus and blur are always synchronous in other supported browsers,
|
4921
|
-
// this just defines when we can count on it).
|
4922
|
-
function expectSync( elem, type ) {
|
4923
|
-
return ( elem === safeActiveElement() ) === ( type === "focus" );
|
4924
|
-
}
|
4925
|
-
|
4926
|
-
// Support: IE <=9 only
|
4927
|
-
// Accessing document.activeElement can throw unexpectedly
|
4928
|
-
// https://bugs.jquery.com/ticket/13393
|
4929
|
-
function safeActiveElement() {
|
4930
|
-
try {
|
4931
|
-
return document.activeElement;
|
4932
|
-
} catch ( err ) { }
|
4933
|
-
}
|
4934
|
-
|
4935
4830
|
function on( elem, types, selector, data, fn, one ) {
|
4936
4831
|
var origFn, type;
|
4937
4832
|
|
@@ -5008,8 +4903,8 @@ jQuery.event = {
|
|
5008
4903
|
special, handlers, type, namespaces, origType,
|
5009
4904
|
elemData = dataPriv.get( elem );
|
5010
4905
|
|
5011
|
-
//
|
5012
|
-
if ( !
|
4906
|
+
// Only attach events to objects that accept data
|
4907
|
+
if ( !acceptData( elem ) ) {
|
5013
4908
|
return;
|
5014
4909
|
}
|
5015
4910
|
|
@@ -5033,7 +4928,7 @@ jQuery.event = {
|
|
5033
4928
|
|
5034
4929
|
// Init the element's event structure and main handler, if this is the first
|
5035
4930
|
if ( !( events = elemData.events ) ) {
|
5036
|
-
events = elemData.events =
|
4931
|
+
events = elemData.events = Object.create( null );
|
5037
4932
|
}
|
5038
4933
|
if ( !( eventHandle = elemData.handle ) ) {
|
5039
4934
|
eventHandle = elemData.handle = function( e ) {
|
@@ -5191,12 +5086,15 @@ jQuery.event = {
|
|
5191
5086
|
|
5192
5087
|
dispatch: function( nativeEvent ) {
|
5193
5088
|
|
5194
|
-
// Make a writable jQuery.Event from the native event object
|
5195
|
-
var event = jQuery.event.fix( nativeEvent );
|
5196
|
-
|
5197
5089
|
var i, j, ret, matched, handleObj, handlerQueue,
|
5198
5090
|
args = new Array( arguments.length ),
|
5199
|
-
|
5091
|
+
|
5092
|
+
// Make a writable jQuery.Event from the native event object
|
5093
|
+
event = jQuery.event.fix( nativeEvent ),
|
5094
|
+
|
5095
|
+
handlers = (
|
5096
|
+
dataPriv.get( this, "events" ) || Object.create( null )
|
5097
|
+
)[ event.type ] || [],
|
5200
5098
|
special = jQuery.event.special[ event.type ] || {};
|
5201
5099
|
|
5202
5100
|
// Use the fix-ed jQuery.Event rather than the (read-only) native event
|
@@ -5276,15 +5174,15 @@ jQuery.event = {
|
|
5276
5174
|
|
5277
5175
|
for ( ; cur !== this; cur = cur.parentNode || this ) {
|
5278
5176
|
|
5279
|
-
// Don't check non-elements (
|
5280
|
-
// Don't process clicks on disabled elements (
|
5177
|
+
// Don't check non-elements (trac-13208)
|
5178
|
+
// Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
|
5281
5179
|
if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
|
5282
5180
|
matchedHandlers = [];
|
5283
5181
|
matchedSelectors = {};
|
5284
5182
|
for ( i = 0; i < delegateCount; i++ ) {
|
5285
5183
|
handleObj = handlers[ i ];
|
5286
5184
|
|
5287
|
-
// Don't conflict with Object.prototype properties (
|
5185
|
+
// Don't conflict with Object.prototype properties (trac-13203)
|
5288
5186
|
sel = handleObj.selector + " ";
|
5289
5187
|
|
5290
5188
|
if ( matchedSelectors[ sel ] === undefined ) {
|
@@ -5320,12 +5218,12 @@ jQuery.event = {
|
|
5320
5218
|
get: isFunction( hook ) ?
|
5321
5219
|
function() {
|
5322
5220
|
if ( this.originalEvent ) {
|
5323
|
-
|
5221
|
+
return hook( this.originalEvent );
|
5324
5222
|
}
|
5325
5223
|
} :
|
5326
5224
|
function() {
|
5327
5225
|
if ( this.originalEvent ) {
|
5328
|
-
|
5226
|
+
return this.originalEvent[ name ];
|
5329
5227
|
}
|
5330
5228
|
},
|
5331
5229
|
|
@@ -5366,7 +5264,7 @@ jQuery.event = {
|
|
5366
5264
|
el.click && nodeName( el, "input" ) ) {
|
5367
5265
|
|
5368
5266
|
// dataPriv.set( el, "click", ... )
|
5369
|
-
leverageNative( el, "click",
|
5267
|
+
leverageNative( el, "click", true );
|
5370
5268
|
}
|
5371
5269
|
|
5372
5270
|
// Return false to allow normal processing in the caller
|
@@ -5417,10 +5315,10 @@ jQuery.event = {
|
|
5417
5315
|
// synthetic events by interrupting progress until reinvoked in response to
|
5418
5316
|
// *native* events that it fires directly, ensuring that state changes have
|
5419
5317
|
// already occurred before other listeners are invoked.
|
5420
|
-
function leverageNative( el, type,
|
5318
|
+
function leverageNative( el, type, isSetup ) {
|
5421
5319
|
|
5422
|
-
// Missing
|
5423
|
-
if ( !
|
5320
|
+
// Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add
|
5321
|
+
if ( !isSetup ) {
|
5424
5322
|
if ( dataPriv.get( el, type ) === undefined ) {
|
5425
5323
|
jQuery.event.add( el, type, returnTrue );
|
5426
5324
|
}
|
@@ -5432,15 +5330,13 @@ function leverageNative( el, type, expectSync ) {
|
|
5432
5330
|
jQuery.event.add( el, type, {
|
5433
5331
|
namespace: false,
|
5434
5332
|
handler: function( event ) {
|
5435
|
-
var
|
5333
|
+
var result,
|
5436
5334
|
saved = dataPriv.get( this, type );
|
5437
5335
|
|
5438
5336
|
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
|
5439
5337
|
|
5440
5338
|
// Interrupt processing of the outer synthetic .trigger()ed event
|
5441
|
-
|
5442
|
-
// from an async native handler (gh-4350)
|
5443
|
-
if ( !saved.length ) {
|
5339
|
+
if ( !saved ) {
|
5444
5340
|
|
5445
5341
|
// Store arguments for use when handling the inner native event
|
5446
5342
|
// There will always be at least one argument (an event object), so this array
|
@@ -5449,27 +5345,22 @@ function leverageNative( el, type, expectSync ) {
|
|
5449
5345
|
dataPriv.set( this, type, saved );
|
5450
5346
|
|
5451
5347
|
// Trigger the native event and capture its result
|
5452
|
-
// Support: IE <=9 - 11+
|
5453
|
-
// focus() and blur() are asynchronous
|
5454
|
-
notAsync = expectSync( this, type );
|
5455
5348
|
this[ type ]();
|
5456
5349
|
result = dataPriv.get( this, type );
|
5457
|
-
|
5458
|
-
|
5459
|
-
} else {
|
5460
|
-
result = {};
|
5461
|
-
}
|
5350
|
+
dataPriv.set( this, type, false );
|
5351
|
+
|
5462
5352
|
if ( saved !== result ) {
|
5463
5353
|
|
5464
5354
|
// Cancel the outer synthetic event
|
5465
5355
|
event.stopImmediatePropagation();
|
5466
5356
|
event.preventDefault();
|
5467
|
-
|
5357
|
+
|
5358
|
+
return result;
|
5468
5359
|
}
|
5469
5360
|
|
5470
5361
|
// If this is an inner synthetic event for an event with a bubbling surrogate
|
5471
|
-
// (focus or blur), assume that the surrogate already propagated from triggering
|
5472
|
-
// native event and prevent that from happening again here.
|
5362
|
+
// (focus or blur), assume that the surrogate already propagated from triggering
|
5363
|
+
// the native event and prevent that from happening again here.
|
5473
5364
|
// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
|
5474
5365
|
// bubbling surrogate propagates *after* the non-bubbling base), but that seems
|
5475
5366
|
// less bad than duplication.
|
@@ -5479,22 +5370,25 @@ function leverageNative( el, type, expectSync ) {
|
|
5479
5370
|
|
5480
5371
|
// If this is a native event triggered above, everything is now in order
|
5481
5372
|
// Fire an inner synthetic event with the original arguments
|
5482
|
-
} else if ( saved
|
5373
|
+
} else if ( saved ) {
|
5483
5374
|
|
5484
5375
|
// ...and capture the result
|
5485
|
-
dataPriv.set( this, type,
|
5486
|
-
|
5487
|
-
|
5488
|
-
|
5489
|
-
|
5490
|
-
|
5491
|
-
|
5492
|
-
|
5493
|
-
|
5494
|
-
|
5495
|
-
|
5496
|
-
//
|
5497
|
-
|
5376
|
+
dataPriv.set( this, type, jQuery.event.trigger(
|
5377
|
+
saved[ 0 ],
|
5378
|
+
saved.slice( 1 ),
|
5379
|
+
this
|
5380
|
+
) );
|
5381
|
+
|
5382
|
+
// Abort handling of the native event by all jQuery handlers while allowing
|
5383
|
+
// native handlers on the same element to run. On target, this is achieved
|
5384
|
+
// by stopping immediate propagation just on the jQuery event. However,
|
5385
|
+
// the native event is re-wrapped by a jQuery one on each level of the
|
5386
|
+
// propagation so the only way to stop it for jQuery is to stop it for
|
5387
|
+
// everyone via native `stopPropagation()`. This is not a problem for
|
5388
|
+
// focus/blur which don't bubble, but it does also stop click on checkboxes
|
5389
|
+
// and radios. We accept this limitation.
|
5390
|
+
event.stopPropagation();
|
5391
|
+
event.isImmediatePropagationStopped = returnTrue;
|
5498
5392
|
}
|
5499
5393
|
}
|
5500
5394
|
} );
|
@@ -5532,7 +5426,7 @@ jQuery.Event = function( src, props ) {
|
|
5532
5426
|
|
5533
5427
|
// Create target properties
|
5534
5428
|
// Support: Safari <=6 - 7 only
|
5535
|
-
// Target should not be a text node (
|
5429
|
+
// Target should not be a text node (trac-504, trac-13143)
|
5536
5430
|
this.target = ( src.target && src.target.nodeType === 3 ) ?
|
5537
5431
|
src.target.parentNode :
|
5538
5432
|
src.target;
|
@@ -5629,49 +5523,77 @@ jQuery.each( {
|
|
5629
5523
|
targetTouches: true,
|
5630
5524
|
toElement: true,
|
5631
5525
|
touches: true,
|
5526
|
+
which: true
|
5527
|
+
}, jQuery.event.addProp );
|
5632
5528
|
|
5633
|
-
|
5634
|
-
var button = event.button;
|
5529
|
+
jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
|
5635
5530
|
|
5636
|
-
|
5637
|
-
if (
|
5638
|
-
return event.charCode != null ? event.charCode : event.keyCode;
|
5639
|
-
}
|
5531
|
+
function focusMappedHandler( nativeEvent ) {
|
5532
|
+
if ( document.documentMode ) {
|
5640
5533
|
|
5641
|
-
|
5642
|
-
|
5643
|
-
|
5644
|
-
|
5645
|
-
}
|
5534
|
+
// Support: IE 11+
|
5535
|
+
// Attach a single focusin/focusout handler on the document while someone wants
|
5536
|
+
// focus/blur. This is because the former are synchronous in IE while the latter
|
5537
|
+
// are async. In other browsers, all those handlers are invoked synchronously.
|
5646
5538
|
|
5647
|
-
|
5648
|
-
|
5649
|
-
|
5539
|
+
// `handle` from private data would already wrap the event, but we need
|
5540
|
+
// to change the `type` here.
|
5541
|
+
var handle = dataPriv.get( this, "handle" ),
|
5542
|
+
event = jQuery.event.fix( nativeEvent );
|
5543
|
+
event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
|
5544
|
+
event.isSimulated = true;
|
5545
|
+
|
5546
|
+
// First, handle focusin/focusout
|
5547
|
+
handle( nativeEvent );
|
5548
|
+
|
5549
|
+
// ...then, handle focus/blur
|
5550
|
+
//
|
5551
|
+
// focus/blur don't bubble while focusin/focusout do; simulate the former by only
|
5552
|
+
// invoking the handler at the lower level.
|
5553
|
+
if ( event.target === event.currentTarget ) {
|
5650
5554
|
|
5651
|
-
|
5652
|
-
|
5555
|
+
// The setup part calls `leverageNative`, which, in turn, calls
|
5556
|
+
// `jQuery.event.add`, so event handle will already have been set
|
5557
|
+
// by this point.
|
5558
|
+
handle( event );
|
5653
5559
|
}
|
5560
|
+
} else {
|
5654
5561
|
|
5655
|
-
|
5562
|
+
// For non-IE browsers, attach a single capturing handler on the document
|
5563
|
+
// while someone wants focusin/focusout.
|
5564
|
+
jQuery.event.simulate( delegateType, nativeEvent.target,
|
5565
|
+
jQuery.event.fix( nativeEvent ) );
|
5656
5566
|
}
|
5657
|
-
|
5658
|
-
return event.which;
|
5659
5567
|
}
|
5660
|
-
}, jQuery.event.addProp );
|
5661
5568
|
|
5662
|
-
jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
|
5663
5569
|
jQuery.event.special[ type ] = {
|
5664
5570
|
|
5665
5571
|
// Utilize native event if possible so blur/focus sequence is correct
|
5666
5572
|
setup: function() {
|
5667
5573
|
|
5574
|
+
var attaches;
|
5575
|
+
|
5668
5576
|
// Claim the first handler
|
5669
5577
|
// dataPriv.set( this, "focus", ... )
|
5670
5578
|
// dataPriv.set( this, "blur", ... )
|
5671
|
-
leverageNative( this, type,
|
5579
|
+
leverageNative( this, type, true );
|
5672
5580
|
|
5673
|
-
|
5674
|
-
|
5581
|
+
if ( document.documentMode ) {
|
5582
|
+
|
5583
|
+
// Support: IE 9 - 11+
|
5584
|
+
// We use the same native handler for focusin & focus (and focusout & blur)
|
5585
|
+
// so we need to coordinate setup & teardown parts between those events.
|
5586
|
+
// Use `delegateType` as the key as `type` is already used by `leverageNative`.
|
5587
|
+
attaches = dataPriv.get( this, delegateType );
|
5588
|
+
if ( !attaches ) {
|
5589
|
+
this.addEventListener( delegateType, focusMappedHandler );
|
5590
|
+
}
|
5591
|
+
dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );
|
5592
|
+
} else {
|
5593
|
+
|
5594
|
+
// Return false to allow normal processing in the caller
|
5595
|
+
return false;
|
5596
|
+
}
|
5675
5597
|
},
|
5676
5598
|
trigger: function() {
|
5677
5599
|
|
@@ -5682,8 +5604,84 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
|
|
5682
5604
|
return true;
|
5683
5605
|
},
|
5684
5606
|
|
5607
|
+
teardown: function() {
|
5608
|
+
var attaches;
|
5609
|
+
|
5610
|
+
if ( document.documentMode ) {
|
5611
|
+
attaches = dataPriv.get( this, delegateType ) - 1;
|
5612
|
+
if ( !attaches ) {
|
5613
|
+
this.removeEventListener( delegateType, focusMappedHandler );
|
5614
|
+
dataPriv.remove( this, delegateType );
|
5615
|
+
} else {
|
5616
|
+
dataPriv.set( this, delegateType, attaches );
|
5617
|
+
}
|
5618
|
+
} else {
|
5619
|
+
|
5620
|
+
// Return false to indicate standard teardown should be applied
|
5621
|
+
return false;
|
5622
|
+
}
|
5623
|
+
},
|
5624
|
+
|
5625
|
+
// Suppress native focus or blur if we're currently inside
|
5626
|
+
// a leveraged native-event stack
|
5627
|
+
_default: function( event ) {
|
5628
|
+
return dataPriv.get( event.target, type );
|
5629
|
+
},
|
5630
|
+
|
5685
5631
|
delegateType: delegateType
|
5686
5632
|
};
|
5633
|
+
|
5634
|
+
// Support: Firefox <=44
|
5635
|
+
// Firefox doesn't have focus(in | out) events
|
5636
|
+
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
|
5637
|
+
//
|
5638
|
+
// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
|
5639
|
+
// focus(in | out) events fire after focus & blur events,
|
5640
|
+
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
|
5641
|
+
// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
|
5642
|
+
//
|
5643
|
+
// Support: IE 9 - 11+
|
5644
|
+
// To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,
|
5645
|
+
// attach a single handler for both events in IE.
|
5646
|
+
jQuery.event.special[ delegateType ] = {
|
5647
|
+
setup: function() {
|
5648
|
+
|
5649
|
+
// Handle: regular nodes (via `this.ownerDocument`), window
|
5650
|
+
// (via `this.document`) & document (via `this`).
|
5651
|
+
var doc = this.ownerDocument || this.document || this,
|
5652
|
+
dataHolder = document.documentMode ? this : doc,
|
5653
|
+
attaches = dataPriv.get( dataHolder, delegateType );
|
5654
|
+
|
5655
|
+
// Support: IE 9 - 11+
|
5656
|
+
// We use the same native handler for focusin & focus (and focusout & blur)
|
5657
|
+
// so we need to coordinate setup & teardown parts between those events.
|
5658
|
+
// Use `delegateType` as the key as `type` is already used by `leverageNative`.
|
5659
|
+
if ( !attaches ) {
|
5660
|
+
if ( document.documentMode ) {
|
5661
|
+
this.addEventListener( delegateType, focusMappedHandler );
|
5662
|
+
} else {
|
5663
|
+
doc.addEventListener( type, focusMappedHandler, true );
|
5664
|
+
}
|
5665
|
+
}
|
5666
|
+
dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );
|
5667
|
+
},
|
5668
|
+
teardown: function() {
|
5669
|
+
var doc = this.ownerDocument || this.document || this,
|
5670
|
+
dataHolder = document.documentMode ? this : doc,
|
5671
|
+
attaches = dataPriv.get( dataHolder, delegateType ) - 1;
|
5672
|
+
|
5673
|
+
if ( !attaches ) {
|
5674
|
+
if ( document.documentMode ) {
|
5675
|
+
this.removeEventListener( delegateType, focusMappedHandler );
|
5676
|
+
} else {
|
5677
|
+
doc.removeEventListener( type, focusMappedHandler, true );
|
5678
|
+
}
|
5679
|
+
dataPriv.remove( dataHolder, delegateType );
|
5680
|
+
} else {
|
5681
|
+
dataPriv.set( dataHolder, delegateType, attaches );
|
5682
|
+
}
|
5683
|
+
}
|
5684
|
+
};
|
5687
5685
|
} );
|
5688
5686
|
|
5689
5687
|
// Create mouseenter/leave events using mouseover/out and event-time checks
|
@@ -5771,13 +5769,6 @@ jQuery.fn.extend( {
|
|
5771
5769
|
|
5772
5770
|
var
|
5773
5771
|
|
5774
|
-
/* eslint-disable max-len */
|
5775
|
-
|
5776
|
-
// See https://github.com/eslint/eslint/issues/3229
|
5777
|
-
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
|
5778
|
-
|
5779
|
-
/* eslint-enable */
|
5780
|
-
|
5781
5772
|
// Support: IE <=10 - 11, Edge 12 - 13 only
|
5782
5773
|
// In IE/Edge using regex groups here causes severe slowdowns.
|
5783
5774
|
// See https://connect.microsoft.com/IE/feedback/details/1736512/
|
@@ -5785,7 +5776,8 @@ var
|
|
5785
5776
|
|
5786
5777
|
// checked="checked" or checked
|
5787
5778
|
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
5788
|
-
|
5779
|
+
|
5780
|
+
rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
|
5789
5781
|
|
5790
5782
|
// Prefer a tbody over its parent table for containing new rows
|
5791
5783
|
function manipulationTarget( elem, content ) {
|
@@ -5814,7 +5806,7 @@ function restoreScript( elem ) {
|
|
5814
5806
|
}
|
5815
5807
|
|
5816
5808
|
function cloneCopyEvent( src, dest ) {
|
5817
|
-
var i, l, type, pdataOld,
|
5809
|
+
var i, l, type, pdataOld, udataOld, udataCur, events;
|
5818
5810
|
|
5819
5811
|
if ( dest.nodeType !== 1 ) {
|
5820
5812
|
return;
|
@@ -5822,13 +5814,11 @@ function cloneCopyEvent( src, dest ) {
|
|
5822
5814
|
|
5823
5815
|
// 1. Copy private data: events, handlers, etc.
|
5824
5816
|
if ( dataPriv.hasData( src ) ) {
|
5825
|
-
pdataOld = dataPriv.
|
5826
|
-
pdataCur = dataPriv.set( dest, pdataOld );
|
5817
|
+
pdataOld = dataPriv.get( src );
|
5827
5818
|
events = pdataOld.events;
|
5828
5819
|
|
5829
5820
|
if ( events ) {
|
5830
|
-
|
5831
|
-
pdataCur.events = {};
|
5821
|
+
dataPriv.remove( dest, "handle events" );
|
5832
5822
|
|
5833
5823
|
for ( type in events ) {
|
5834
5824
|
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
@@ -5864,7 +5854,7 @@ function fixInput( src, dest ) {
|
|
5864
5854
|
function domManip( collection, args, callback, ignored ) {
|
5865
5855
|
|
5866
5856
|
// Flatten any nested arrays
|
5867
|
-
args =
|
5857
|
+
args = flat( args );
|
5868
5858
|
|
5869
5859
|
var fragment, first, scripts, hasScripts, node, doc,
|
5870
5860
|
i = 0,
|
@@ -5901,7 +5891,7 @@ function domManip( collection, args, callback, ignored ) {
|
|
5901
5891
|
|
5902
5892
|
// Use the original fragment for the last item
|
5903
5893
|
// instead of the first because it can end up
|
5904
|
-
// being emptied incorrectly in certain situations (
|
5894
|
+
// being emptied incorrectly in certain situations (trac-8070).
|
5905
5895
|
for ( ; i < l; i++ ) {
|
5906
5896
|
node = fragment;
|
5907
5897
|
|
@@ -5939,9 +5929,15 @@ function domManip( collection, args, callback, ignored ) {
|
|
5939
5929
|
if ( jQuery._evalUrl && !node.noModule ) {
|
5940
5930
|
jQuery._evalUrl( node.src, {
|
5941
5931
|
nonce: node.nonce || node.getAttribute( "nonce" )
|
5942
|
-
} );
|
5932
|
+
}, doc );
|
5943
5933
|
}
|
5944
5934
|
} else {
|
5935
|
+
|
5936
|
+
// Unwrap a CDATA section containing script contents. This shouldn't be
|
5937
|
+
// needed as in XML documents they're already not visible when
|
5938
|
+
// inspecting element contents and in HTML documents they have no
|
5939
|
+
// meaning but we're preserving that logic for backwards compatibility.
|
5940
|
+
// This will be removed completely in 4.0. See gh-4904.
|
5945
5941
|
DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
|
5946
5942
|
}
|
5947
5943
|
}
|
@@ -5976,7 +5972,7 @@ function remove( elem, selector, keepData ) {
|
|
5976
5972
|
|
5977
5973
|
jQuery.extend( {
|
5978
5974
|
htmlPrefilter: function( html ) {
|
5979
|
-
return html
|
5975
|
+
return html;
|
5980
5976
|
},
|
5981
5977
|
|
5982
5978
|
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
@@ -5988,7 +5984,8 @@ jQuery.extend( {
|
|
5988
5984
|
if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
|
5989
5985
|
!jQuery.isXMLDoc( elem ) ) {
|
5990
5986
|
|
5991
|
-
// We eschew
|
5987
|
+
// We eschew jQuery#find here for performance reasons:
|
5988
|
+
// https://jsperf.com/getall-vs-sizzle/2
|
5992
5989
|
destElements = getAll( clone );
|
5993
5990
|
srcElements = getAll( elem );
|
5994
5991
|
|
@@ -6224,9 +6221,12 @@ jQuery.each( {
|
|
6224
6221
|
} );
|
6225
6222
|
var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
|
6226
6223
|
|
6224
|
+
var rcustomProp = /^--/;
|
6225
|
+
|
6226
|
+
|
6227
6227
|
var getStyles = function( elem ) {
|
6228
6228
|
|
6229
|
-
// Support: IE <=11 only, Firefox <=30 (
|
6229
|
+
// Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
|
6230
6230
|
// IE throws on elements created in popups
|
6231
6231
|
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
|
6232
6232
|
var view = elem.ownerDocument.defaultView;
|
@@ -6238,6 +6238,27 @@ var getStyles = function( elem ) {
|
|
6238
6238
|
return view.getComputedStyle( elem );
|
6239
6239
|
};
|
6240
6240
|
|
6241
|
+
var swap = function( elem, options, callback ) {
|
6242
|
+
var ret, name,
|
6243
|
+
old = {};
|
6244
|
+
|
6245
|
+
// Remember the old values, and insert the new ones
|
6246
|
+
for ( name in options ) {
|
6247
|
+
old[ name ] = elem.style[ name ];
|
6248
|
+
elem.style[ name ] = options[ name ];
|
6249
|
+
}
|
6250
|
+
|
6251
|
+
ret = callback.call( elem );
|
6252
|
+
|
6253
|
+
// Revert the old values
|
6254
|
+
for ( name in options ) {
|
6255
|
+
elem.style[ name ] = old[ name ];
|
6256
|
+
}
|
6257
|
+
|
6258
|
+
return ret;
|
6259
|
+
};
|
6260
|
+
|
6261
|
+
|
6241
6262
|
var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
6242
6263
|
|
6243
6264
|
|
@@ -6295,7 +6316,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
|
6295
6316
|
}
|
6296
6317
|
|
6297
6318
|
var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
|
6298
|
-
reliableMarginLeftVal,
|
6319
|
+
reliableTrDimensionsVal, reliableMarginLeftVal,
|
6299
6320
|
container = document.createElement( "div" ),
|
6300
6321
|
div = document.createElement( "div" );
|
6301
6322
|
|
@@ -6305,7 +6326,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
|
6305
6326
|
}
|
6306
6327
|
|
6307
6328
|
// Support: IE <=9 - 11 only
|
6308
|
-
// Style of cloned element affects source element cloned (
|
6329
|
+
// Style of cloned element affects source element cloned (trac-8908)
|
6309
6330
|
div.style.backgroundClip = "content-box";
|
6310
6331
|
div.cloneNode( true ).style.backgroundClip = "";
|
6311
6332
|
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
@@ -6330,6 +6351,54 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
|
6330
6351
|
scrollboxSize: function() {
|
6331
6352
|
computeStyleTests();
|
6332
6353
|
return scrollboxSizeVal;
|
6354
|
+
},
|
6355
|
+
|
6356
|
+
// Support: IE 9 - 11+, Edge 15 - 18+
|
6357
|
+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
|
6358
|
+
// set in CSS while `offset*` properties report correct values.
|
6359
|
+
// Behavior in IE 9 is more subtle than in newer versions & it passes
|
6360
|
+
// some versions of this test; make sure not to make it pass there!
|
6361
|
+
//
|
6362
|
+
// Support: Firefox 70+
|
6363
|
+
// Only Firefox includes border widths
|
6364
|
+
// in computed dimensions. (gh-4529)
|
6365
|
+
reliableTrDimensions: function() {
|
6366
|
+
var table, tr, trChild, trStyle;
|
6367
|
+
if ( reliableTrDimensionsVal == null ) {
|
6368
|
+
table = document.createElement( "table" );
|
6369
|
+
tr = document.createElement( "tr" );
|
6370
|
+
trChild = document.createElement( "div" );
|
6371
|
+
|
6372
|
+
table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
|
6373
|
+
tr.style.cssText = "border:1px solid";
|
6374
|
+
|
6375
|
+
// Support: Chrome 86+
|
6376
|
+
// Height set through cssText does not get applied.
|
6377
|
+
// Computed height then comes back as 0.
|
6378
|
+
tr.style.height = "1px";
|
6379
|
+
trChild.style.height = "9px";
|
6380
|
+
|
6381
|
+
// Support: Android 8 Chrome 86+
|
6382
|
+
// In our bodyBackground.html iframe,
|
6383
|
+
// display for all div elements is set to "inline",
|
6384
|
+
// which causes a problem only in Android 8 Chrome 86.
|
6385
|
+
// Ensuring the div is display: block
|
6386
|
+
// gets around this issue.
|
6387
|
+
trChild.style.display = "block";
|
6388
|
+
|
6389
|
+
documentElement
|
6390
|
+
.appendChild( table )
|
6391
|
+
.appendChild( tr )
|
6392
|
+
.appendChild( trChild );
|
6393
|
+
|
6394
|
+
trStyle = window.getComputedStyle( tr );
|
6395
|
+
reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
|
6396
|
+
parseInt( trStyle.borderTopWidth, 10 ) +
|
6397
|
+
parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
|
6398
|
+
|
6399
|
+
documentElement.removeChild( table );
|
6400
|
+
}
|
6401
|
+
return reliableTrDimensionsVal;
|
6333
6402
|
}
|
6334
6403
|
} );
|
6335
6404
|
} )();
|
@@ -6337,6 +6406,7 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
|
6337
6406
|
|
6338
6407
|
function curCSS( elem, name, computed ) {
|
6339
6408
|
var width, minWidth, maxWidth, ret,
|
6409
|
+
isCustomProp = rcustomProp.test( name ),
|
6340
6410
|
|
6341
6411
|
// Support: Firefox 51+
|
6342
6412
|
// Retrieving style before computed somehow
|
@@ -6347,11 +6417,42 @@ function curCSS( elem, name, computed ) {
|
|
6347
6417
|
computed = computed || getStyles( elem );
|
6348
6418
|
|
6349
6419
|
// getPropertyValue is needed for:
|
6350
|
-
// .css('filter') (IE 9 only,
|
6351
|
-
// .css('--customProperty) (
|
6420
|
+
// .css('filter') (IE 9 only, trac-12537)
|
6421
|
+
// .css('--customProperty) (gh-3144)
|
6352
6422
|
if ( computed ) {
|
6423
|
+
|
6424
|
+
// Support: IE <=9 - 11+
|
6425
|
+
// IE only supports `"float"` in `getPropertyValue`; in computed styles
|
6426
|
+
// it's only available as `"cssFloat"`. We no longer modify properties
|
6427
|
+
// sent to `.css()` apart from camelCasing, so we need to check both.
|
6428
|
+
// Normally, this would create difference in behavior: if
|
6429
|
+
// `getPropertyValue` returns an empty string, the value returned
|
6430
|
+
// by `.css()` would be `undefined`. This is usually the case for
|
6431
|
+
// disconnected elements. However, in IE even disconnected elements
|
6432
|
+
// with no styles return `"none"` for `getPropertyValue( "float" )`
|
6353
6433
|
ret = computed.getPropertyValue( name ) || computed[ name ];
|
6354
6434
|
|
6435
|
+
if ( isCustomProp && ret ) {
|
6436
|
+
|
6437
|
+
// Support: Firefox 105+, Chrome <=105+
|
6438
|
+
// Spec requires trimming whitespace for custom properties (gh-4926).
|
6439
|
+
// Firefox only trims leading whitespace. Chrome just collapses
|
6440
|
+
// both leading & trailing whitespace to a single space.
|
6441
|
+
//
|
6442
|
+
// Fall back to `undefined` if empty string returned.
|
6443
|
+
// This collapses a missing definition with property defined
|
6444
|
+
// and set to an empty string but there's no standard API
|
6445
|
+
// allowing us to differentiate them without a performance penalty
|
6446
|
+
// and returning `undefined` aligns with older jQuery.
|
6447
|
+
//
|
6448
|
+
// rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
|
6449
|
+
// as whitespace while CSS does not, but this is not a problem
|
6450
|
+
// because CSS preprocessing replaces them with U+000A LINE FEED
|
6451
|
+
// (which *is* CSS whitespace)
|
6452
|
+
// https://www.w3.org/TR/css-syntax-3/#input-preprocessing
|
6453
|
+
ret = ret.replace( rtrimCSS, "$1" ) || undefined;
|
6454
|
+
}
|
6455
|
+
|
6355
6456
|
if ( ret === "" && !isAttached( elem ) ) {
|
6356
6457
|
ret = jQuery.style( elem, name );
|
6357
6458
|
}
|
@@ -6447,14 +6548,13 @@ var
|
|
6447
6548
|
// except "table", "table-cell", or "table-caption"
|
6448
6549
|
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
6449
6550
|
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
6450
|
-
rcustomProp = /^--/,
|
6451
6551
|
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
6452
6552
|
cssNormalTransform = {
|
6453
6553
|
letterSpacing: "0",
|
6454
6554
|
fontWeight: "400"
|
6455
6555
|
};
|
6456
6556
|
|
6457
|
-
function setPositiveNumber(
|
6557
|
+
function setPositiveNumber( _elem, value, subtract ) {
|
6458
6558
|
|
6459
6559
|
// Any relative (+/-) values have already been
|
6460
6560
|
// normalized at this point
|
@@ -6469,7 +6569,8 @@ function setPositiveNumber( elem, value, subtract ) {
|
|
6469
6569
|
function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
|
6470
6570
|
var i = dimension === "width" ? 1 : 0,
|
6471
6571
|
extra = 0,
|
6472
|
-
delta = 0
|
6572
|
+
delta = 0,
|
6573
|
+
marginDelta = 0;
|
6473
6574
|
|
6474
6575
|
// Adjustment may not be necessary
|
6475
6576
|
if ( box === ( isBorderBox ? "border" : "content" ) ) {
|
@@ -6479,8 +6580,10 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed
|
|
6479
6580
|
for ( ; i < 4; i += 2 ) {
|
6480
6581
|
|
6481
6582
|
// Both box models exclude margin
|
6583
|
+
// Count margin delta separately to only add it after scroll gutter adjustment.
|
6584
|
+
// This is needed to make negative margins work with `outerHeight( true )` (gh-3982).
|
6482
6585
|
if ( box === "margin" ) {
|
6483
|
-
|
6586
|
+
marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
|
6484
6587
|
}
|
6485
6588
|
|
6486
6589
|
// If we get here with a content-box, we're seeking "padding" or "border" or "margin"
|
@@ -6531,7 +6634,7 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed
|
|
6531
6634
|
) ) || 0;
|
6532
6635
|
}
|
6533
6636
|
|
6534
|
-
return delta;
|
6637
|
+
return delta + marginDelta;
|
6535
6638
|
}
|
6536
6639
|
|
6537
6640
|
function getWidthOrHeight( elem, dimension, extra ) {
|
@@ -6559,17 +6662,26 @@ function getWidthOrHeight( elem, dimension, extra ) {
|
|
6559
6662
|
}
|
6560
6663
|
|
6561
6664
|
|
6562
|
-
//
|
6563
|
-
//
|
6564
|
-
//
|
6565
|
-
// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
|
6566
|
-
// Support: IE 9-11 only
|
6567
|
-
// Also use offsetWidth/offsetHeight for when box sizing is unreliable
|
6568
|
-
// We use getClientRects() to check for hidden/disconnected.
|
6569
|
-
// In those cases, the computed value can be trusted to be border-box
|
6665
|
+
// Support: IE 9 - 11 only
|
6666
|
+
// Use offsetWidth/offsetHeight for when box sizing is unreliable.
|
6667
|
+
// In those cases, the computed value can be trusted to be border-box.
|
6570
6668
|
if ( ( !support.boxSizingReliable() && isBorderBox ||
|
6669
|
+
|
6670
|
+
// Support: IE 10 - 11+, Edge 15 - 18+
|
6671
|
+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
|
6672
|
+
// set in CSS while `offset*` properties report correct values.
|
6673
|
+
// Interestingly, in some cases IE 9 doesn't suffer from this issue.
|
6674
|
+
!support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
|
6675
|
+
|
6676
|
+
// Fall back to offsetWidth/offsetHeight when value is "auto"
|
6677
|
+
// This happens for inline elements with no explicit setting (gh-3571)
|
6571
6678
|
val === "auto" ||
|
6679
|
+
|
6680
|
+
// Support: Android <=4.1 - 4.3 only
|
6681
|
+
// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
|
6572
6682
|
!parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
|
6683
|
+
|
6684
|
+
// Make sure the element is visible & connected
|
6573
6685
|
elem.getClientRects().length ) {
|
6574
6686
|
|
6575
6687
|
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
@@ -6620,26 +6732,35 @@ jQuery.extend( {
|
|
6620
6732
|
|
6621
6733
|
// Don't automatically add "px" to these possibly-unitless properties
|
6622
6734
|
cssNumber: {
|
6623
|
-
|
6624
|
-
|
6625
|
-
|
6626
|
-
|
6627
|
-
|
6628
|
-
|
6629
|
-
|
6630
|
-
|
6631
|
-
|
6632
|
-
|
6633
|
-
|
6634
|
-
|
6635
|
-
|
6636
|
-
|
6637
|
-
|
6638
|
-
|
6639
|
-
|
6640
|
-
|
6641
|
-
|
6642
|
-
|
6735
|
+
animationIterationCount: true,
|
6736
|
+
aspectRatio: true,
|
6737
|
+
borderImageSlice: true,
|
6738
|
+
columnCount: true,
|
6739
|
+
flexGrow: true,
|
6740
|
+
flexShrink: true,
|
6741
|
+
fontWeight: true,
|
6742
|
+
gridArea: true,
|
6743
|
+
gridColumn: true,
|
6744
|
+
gridColumnEnd: true,
|
6745
|
+
gridColumnStart: true,
|
6746
|
+
gridRow: true,
|
6747
|
+
gridRowEnd: true,
|
6748
|
+
gridRowStart: true,
|
6749
|
+
lineHeight: true,
|
6750
|
+
opacity: true,
|
6751
|
+
order: true,
|
6752
|
+
orphans: true,
|
6753
|
+
scale: true,
|
6754
|
+
widows: true,
|
6755
|
+
zIndex: true,
|
6756
|
+
zoom: true,
|
6757
|
+
|
6758
|
+
// SVG-related
|
6759
|
+
fillOpacity: true,
|
6760
|
+
floodOpacity: true,
|
6761
|
+
stopOpacity: true,
|
6762
|
+
strokeMiterlimit: true,
|
6763
|
+
strokeOpacity: true
|
6643
6764
|
},
|
6644
6765
|
|
6645
6766
|
// Add in properties whose names you wish to fix before
|
@@ -6674,15 +6795,15 @@ jQuery.extend( {
|
|
6674
6795
|
if ( value !== undefined ) {
|
6675
6796
|
type = typeof value;
|
6676
6797
|
|
6677
|
-
// Convert "+=" or "-=" to relative numbers (
|
6798
|
+
// Convert "+=" or "-=" to relative numbers (trac-7345)
|
6678
6799
|
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
|
6679
6800
|
value = adjustCSS( elem, name, ret );
|
6680
6801
|
|
6681
|
-
// Fixes bug
|
6802
|
+
// Fixes bug trac-9237
|
6682
6803
|
type = "number";
|
6683
6804
|
}
|
6684
6805
|
|
6685
|
-
// Make sure that null and NaN values aren't set (
|
6806
|
+
// Make sure that null and NaN values aren't set (trac-7116)
|
6686
6807
|
if ( value == null || value !== value ) {
|
6687
6808
|
return;
|
6688
6809
|
}
|
@@ -6764,7 +6885,7 @@ jQuery.extend( {
|
|
6764
6885
|
}
|
6765
6886
|
} );
|
6766
6887
|
|
6767
|
-
jQuery.each( [ "height", "width" ], function(
|
6888
|
+
jQuery.each( [ "height", "width" ], function( _i, dimension ) {
|
6768
6889
|
jQuery.cssHooks[ dimension ] = {
|
6769
6890
|
get: function( elem, computed, extra ) {
|
6770
6891
|
if ( computed ) {
|
@@ -6780,10 +6901,10 @@ jQuery.each( [ "height", "width" ], function( i, dimension ) {
|
|
6780
6901
|
// Running getBoundingClientRect on a disconnected node
|
6781
6902
|
// in IE throws an error.
|
6782
6903
|
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
|
6783
|
-
|
6784
|
-
|
6785
|
-
|
6786
|
-
|
6904
|
+
swap( elem, cssShow, function() {
|
6905
|
+
return getWidthOrHeight( elem, dimension, extra );
|
6906
|
+
} ) :
|
6907
|
+
getWidthOrHeight( elem, dimension, extra );
|
6787
6908
|
}
|
6788
6909
|
},
|
6789
6910
|
|
@@ -6842,7 +6963,7 @@ jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
|
|
6842
6963
|
swap( elem, { marginLeft: 0 }, function() {
|
6843
6964
|
return elem.getBoundingClientRect().left;
|
6844
6965
|
} )
|
6845
|
-
|
6966
|
+
) + "px";
|
6846
6967
|
}
|
6847
6968
|
}
|
6848
6969
|
);
|
@@ -6981,7 +7102,7 @@ Tween.propHooks = {
|
|
6981
7102
|
if ( jQuery.fx.step[ tween.prop ] ) {
|
6982
7103
|
jQuery.fx.step[ tween.prop ]( tween );
|
6983
7104
|
} else if ( tween.elem.nodeType === 1 && (
|
6984
|
-
|
7105
|
+
jQuery.cssHooks[ tween.prop ] ||
|
6985
7106
|
tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
|
6986
7107
|
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
|
6987
7108
|
} else {
|
@@ -7226,7 +7347,7 @@ function defaultPrefilter( elem, props, opts ) {
|
|
7226
7347
|
|
7227
7348
|
anim.done( function() {
|
7228
7349
|
|
7229
|
-
|
7350
|
+
/* eslint-enable no-loop-func */
|
7230
7351
|
|
7231
7352
|
// The final step of a "hide" animation is actually hiding the element
|
7232
7353
|
if ( !hidden ) {
|
@@ -7306,7 +7427,7 @@ function Animation( elem, properties, options ) {
|
|
7306
7427
|
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
|
7307
7428
|
|
7308
7429
|
// Support: Android 2.3 only
|
7309
|
-
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (
|
7430
|
+
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
|
7310
7431
|
temp = remaining / animation.duration || 0,
|
7311
7432
|
percent = 1 - temp,
|
7312
7433
|
index = 0,
|
@@ -7346,7 +7467,7 @@ function Animation( elem, properties, options ) {
|
|
7346
7467
|
tweens: [],
|
7347
7468
|
createTween: function( prop, end ) {
|
7348
7469
|
var tween = jQuery.Tween( elem, animation.opts, prop, end,
|
7349
|
-
|
7470
|
+
animation.opts.specialEasing[ prop ] || animation.opts.easing );
|
7350
7471
|
animation.tweens.push( tween );
|
7351
7472
|
return tween;
|
7352
7473
|
},
|
@@ -7519,7 +7640,8 @@ jQuery.fn.extend( {
|
|
7519
7640
|
anim.stop( true );
|
7520
7641
|
}
|
7521
7642
|
};
|
7522
|
-
|
7643
|
+
|
7644
|
+
doAnimation.finish = doAnimation;
|
7523
7645
|
|
7524
7646
|
return empty || optall.queue === false ?
|
7525
7647
|
this.each( doAnimation ) :
|
@@ -7537,7 +7659,7 @@ jQuery.fn.extend( {
|
|
7537
7659
|
clearQueue = type;
|
7538
7660
|
type = undefined;
|
7539
7661
|
}
|
7540
|
-
if ( clearQueue
|
7662
|
+
if ( clearQueue ) {
|
7541
7663
|
this.queue( type || "fx", [] );
|
7542
7664
|
}
|
7543
7665
|
|
@@ -7620,7 +7742,7 @@ jQuery.fn.extend( {
|
|
7620
7742
|
}
|
7621
7743
|
} );
|
7622
7744
|
|
7623
|
-
jQuery.each( [ "toggle", "show", "hide" ], function(
|
7745
|
+
jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
|
7624
7746
|
var cssFn = jQuery.fn[ name ];
|
7625
7747
|
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
7626
7748
|
return speed == null || typeof speed === "boolean" ?
|
@@ -7695,7 +7817,6 @@ jQuery.fx.speeds = {
|
|
7695
7817
|
|
7696
7818
|
|
7697
7819
|
// Based off of the plugin by Clint Helfers, with permission.
|
7698
|
-
// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
|
7699
7820
|
jQuery.fn.delay = function( time, type ) {
|
7700
7821
|
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
7701
7822
|
type = type || "fx";
|
@@ -7841,7 +7962,7 @@ boolHook = {
|
|
7841
7962
|
}
|
7842
7963
|
};
|
7843
7964
|
|
7844
|
-
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function(
|
7965
|
+
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
|
7845
7966
|
var getter = attrHandle[ name ] || jQuery.find.attr;
|
7846
7967
|
|
7847
7968
|
attrHandle[ name ] = function( elem, name, isXML ) {
|
@@ -7920,8 +8041,7 @@ jQuery.extend( {
|
|
7920
8041
|
// Support: IE <=9 - 11 only
|
7921
8042
|
// elem.tabIndex doesn't always return the
|
7922
8043
|
// correct value when it hasn't been explicitly set
|
7923
|
-
//
|
7924
|
-
// Use proper attribute retrieval(#12072)
|
8044
|
+
// Use proper attribute retrieval (trac-12072)
|
7925
8045
|
var tabindex = jQuery.find.attr( elem, "tabindex" );
|
7926
8046
|
|
7927
8047
|
if ( tabindex ) {
|
@@ -8025,8 +8145,7 @@ function classesToArray( value ) {
|
|
8025
8145
|
|
8026
8146
|
jQuery.fn.extend( {
|
8027
8147
|
addClass: function( value ) {
|
8028
|
-
var
|
8029
|
-
i = 0;
|
8148
|
+
var classNames, cur, curValue, className, i, finalValue;
|
8030
8149
|
|
8031
8150
|
if ( isFunction( value ) ) {
|
8032
8151
|
return this.each( function( j ) {
|
@@ -8034,36 +8153,35 @@ jQuery.fn.extend( {
|
|
8034
8153
|
} );
|
8035
8154
|
}
|
8036
8155
|
|
8037
|
-
|
8156
|
+
classNames = classesToArray( value );
|
8038
8157
|
|
8039
|
-
if (
|
8040
|
-
|
8041
|
-
curValue = getClass(
|
8042
|
-
cur =
|
8158
|
+
if ( classNames.length ) {
|
8159
|
+
return this.each( function() {
|
8160
|
+
curValue = getClass( this );
|
8161
|
+
cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
8043
8162
|
|
8044
8163
|
if ( cur ) {
|
8045
|
-
|
8046
|
-
|
8047
|
-
if ( cur.indexOf( " " +
|
8048
|
-
cur +=
|
8164
|
+
for ( i = 0; i < classNames.length; i++ ) {
|
8165
|
+
className = classNames[ i ];
|
8166
|
+
if ( cur.indexOf( " " + className + " " ) < 0 ) {
|
8167
|
+
cur += className + " ";
|
8049
8168
|
}
|
8050
8169
|
}
|
8051
8170
|
|
8052
8171
|
// Only assign if different to avoid unneeded rendering.
|
8053
8172
|
finalValue = stripAndCollapse( cur );
|
8054
8173
|
if ( curValue !== finalValue ) {
|
8055
|
-
|
8174
|
+
this.setAttribute( "class", finalValue );
|
8056
8175
|
}
|
8057
8176
|
}
|
8058
|
-
}
|
8177
|
+
} );
|
8059
8178
|
}
|
8060
8179
|
|
8061
8180
|
return this;
|
8062
8181
|
},
|
8063
8182
|
|
8064
8183
|
removeClass: function( value ) {
|
8065
|
-
var
|
8066
|
-
i = 0;
|
8184
|
+
var classNames, cur, curValue, className, i, finalValue;
|
8067
8185
|
|
8068
8186
|
if ( isFunction( value ) ) {
|
8069
8187
|
return this.each( function( j ) {
|
@@ -8075,45 +8193,42 @@ jQuery.fn.extend( {
|
|
8075
8193
|
return this.attr( "class", "" );
|
8076
8194
|
}
|
8077
8195
|
|
8078
|
-
|
8196
|
+
classNames = classesToArray( value );
|
8079
8197
|
|
8080
|
-
if (
|
8081
|
-
|
8082
|
-
curValue = getClass(
|
8198
|
+
if ( classNames.length ) {
|
8199
|
+
return this.each( function() {
|
8200
|
+
curValue = getClass( this );
|
8083
8201
|
|
8084
8202
|
// This expression is here for better compressibility (see addClass)
|
8085
|
-
cur =
|
8203
|
+
cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
8086
8204
|
|
8087
8205
|
if ( cur ) {
|
8088
|
-
|
8089
|
-
|
8206
|
+
for ( i = 0; i < classNames.length; i++ ) {
|
8207
|
+
className = classNames[ i ];
|
8090
8208
|
|
8091
8209
|
// Remove *all* instances
|
8092
|
-
while ( cur.indexOf( " " +
|
8093
|
-
cur = cur.replace( " " +
|
8210
|
+
while ( cur.indexOf( " " + className + " " ) > -1 ) {
|
8211
|
+
cur = cur.replace( " " + className + " ", " " );
|
8094
8212
|
}
|
8095
8213
|
}
|
8096
8214
|
|
8097
8215
|
// Only assign if different to avoid unneeded rendering.
|
8098
8216
|
finalValue = stripAndCollapse( cur );
|
8099
8217
|
if ( curValue !== finalValue ) {
|
8100
|
-
|
8218
|
+
this.setAttribute( "class", finalValue );
|
8101
8219
|
}
|
8102
8220
|
}
|
8103
|
-
}
|
8221
|
+
} );
|
8104
8222
|
}
|
8105
8223
|
|
8106
8224
|
return this;
|
8107
8225
|
},
|
8108
8226
|
|
8109
8227
|
toggleClass: function( value, stateVal ) {
|
8110
|
-
var
|
8228
|
+
var classNames, className, i, self,
|
8229
|
+
type = typeof value,
|
8111
8230
|
isValidValue = type === "string" || Array.isArray( value );
|
8112
8231
|
|
8113
|
-
if ( typeof stateVal === "boolean" && isValidValue ) {
|
8114
|
-
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
8115
|
-
}
|
8116
|
-
|
8117
8232
|
if ( isFunction( value ) ) {
|
8118
8233
|
return this.each( function( i ) {
|
8119
8234
|
jQuery( this ).toggleClass(
|
@@ -8123,17 +8238,20 @@ jQuery.fn.extend( {
|
|
8123
8238
|
} );
|
8124
8239
|
}
|
8125
8240
|
|
8126
|
-
|
8127
|
-
|
8241
|
+
if ( typeof stateVal === "boolean" && isValidValue ) {
|
8242
|
+
return stateVal ? this.addClass( value ) : this.removeClass( value );
|
8243
|
+
}
|
8244
|
+
|
8245
|
+
classNames = classesToArray( value );
|
8128
8246
|
|
8247
|
+
return this.each( function() {
|
8129
8248
|
if ( isValidValue ) {
|
8130
8249
|
|
8131
8250
|
// Toggle individual class names
|
8132
|
-
i = 0;
|
8133
8251
|
self = jQuery( this );
|
8134
|
-
classNames = classesToArray( value );
|
8135
8252
|
|
8136
|
-
|
8253
|
+
for ( i = 0; i < classNames.length; i++ ) {
|
8254
|
+
className = classNames[ i ];
|
8137
8255
|
|
8138
8256
|
// Check each className given, space separated list
|
8139
8257
|
if ( self.hasClass( className ) ) {
|
@@ -8159,8 +8277,8 @@ jQuery.fn.extend( {
|
|
8159
8277
|
if ( this.setAttribute ) {
|
8160
8278
|
this.setAttribute( "class",
|
8161
8279
|
className || value === false ?
|
8162
|
-
|
8163
|
-
|
8280
|
+
"" :
|
8281
|
+
dataPriv.get( this, "__className__" ) || ""
|
8164
8282
|
);
|
8165
8283
|
}
|
8166
8284
|
}
|
@@ -8175,7 +8293,7 @@ jQuery.fn.extend( {
|
|
8175
8293
|
while ( ( elem = this[ i++ ] ) ) {
|
8176
8294
|
if ( elem.nodeType === 1 &&
|
8177
8295
|
( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
|
8178
|
-
|
8296
|
+
return true;
|
8179
8297
|
}
|
8180
8298
|
}
|
8181
8299
|
|
@@ -8267,7 +8385,7 @@ jQuery.extend( {
|
|
8267
8385
|
val :
|
8268
8386
|
|
8269
8387
|
// Support: IE <=10 - 11 only
|
8270
|
-
// option.text throws exceptions (
|
8388
|
+
// option.text throws exceptions (trac-14686, trac-14858)
|
8271
8389
|
// Strip and collapse whitespace
|
8272
8390
|
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
|
8273
8391
|
stripAndCollapse( jQuery.text( elem ) );
|
@@ -8294,7 +8412,7 @@ jQuery.extend( {
|
|
8294
8412
|
option = options[ i ];
|
8295
8413
|
|
8296
8414
|
// Support: IE <=9 only
|
8297
|
-
// IE8-9 doesn't update selected after form reset (
|
8415
|
+
// IE8-9 doesn't update selected after form reset (trac-2551)
|
8298
8416
|
if ( ( option.selected || i === index ) &&
|
8299
8417
|
|
8300
8418
|
// Don't return options that are disabled or in a disabled optgroup
|
@@ -8368,9 +8486,39 @@ jQuery.each( [ "radio", "checkbox" ], function() {
|
|
8368
8486
|
|
8369
8487
|
|
8370
8488
|
// Return jQuery for attributes-only inclusion
|
8489
|
+
var location = window.location;
|
8490
|
+
|
8491
|
+
var nonce = { guid: Date.now() };
|
8492
|
+
|
8493
|
+
var rquery = ( /\?/ );
|
8494
|
+
|
8495
|
+
|
8496
|
+
|
8497
|
+
// Cross-browser xml parsing
|
8498
|
+
jQuery.parseXML = function( data ) {
|
8499
|
+
var xml, parserErrorElem;
|
8500
|
+
if ( !data || typeof data !== "string" ) {
|
8501
|
+
return null;
|
8502
|
+
}
|
8371
8503
|
|
8504
|
+
// Support: IE 9 - 11 only
|
8505
|
+
// IE throws on parseFromString with invalid input.
|
8506
|
+
try {
|
8507
|
+
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
|
8508
|
+
} catch ( e ) {}
|
8372
8509
|
|
8373
|
-
|
8510
|
+
parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
|
8511
|
+
if ( !xml || parserErrorElem ) {
|
8512
|
+
jQuery.error( "Invalid XML: " + (
|
8513
|
+
parserErrorElem ?
|
8514
|
+
jQuery.map( parserErrorElem.childNodes, function( el ) {
|
8515
|
+
return el.textContent;
|
8516
|
+
} ).join( "\n" ) :
|
8517
|
+
data
|
8518
|
+
) );
|
8519
|
+
}
|
8520
|
+
return xml;
|
8521
|
+
};
|
8374
8522
|
|
8375
8523
|
|
8376
8524
|
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
@@ -8437,8 +8585,8 @@ jQuery.extend( jQuery.event, {
|
|
8437
8585
|
return;
|
8438
8586
|
}
|
8439
8587
|
|
8440
|
-
// Determine event propagation path in advance, per W3C events spec (
|
8441
|
-
// Bubble up to document, then to window; watch for a global ownerDocument var (
|
8588
|
+
// Determine event propagation path in advance, per W3C events spec (trac-9951)
|
8589
|
+
// Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
|
8442
8590
|
if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
|
8443
8591
|
|
8444
8592
|
bubbleType = special.delegateType || type;
|
@@ -8465,7 +8613,7 @@ jQuery.extend( jQuery.event, {
|
|
8465
8613
|
special.bindType || type;
|
8466
8614
|
|
8467
8615
|
// jQuery handler
|
8468
|
-
handle = ( dataPriv.get( cur, "events" ) ||
|
8616
|
+
handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
|
8469
8617
|
dataPriv.get( cur, "handle" );
|
8470
8618
|
if ( handle ) {
|
8471
8619
|
handle.apply( cur, data );
|
@@ -8490,7 +8638,7 @@ jQuery.extend( jQuery.event, {
|
|
8490
8638
|
acceptData( elem ) ) {
|
8491
8639
|
|
8492
8640
|
// Call a native DOM method on the target with the same name as the event.
|
8493
|
-
// Don't do default actions on window, that's where global variables be (
|
8641
|
+
// Don't do default actions on window, that's where global variables be (trac-6170)
|
8494
8642
|
if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
|
8495
8643
|
|
8496
8644
|
// Don't re-trigger an onFOO event when we call its FOO() method
|
@@ -8558,77 +8706,6 @@ jQuery.fn.extend( {
|
|
8558
8706
|
} );
|
8559
8707
|
|
8560
8708
|
|
8561
|
-
// Support: Firefox <=44
|
8562
|
-
// Firefox doesn't have focus(in | out) events
|
8563
|
-
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
|
8564
|
-
//
|
8565
|
-
// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
|
8566
|
-
// focus(in | out) events fire after focus & blur events,
|
8567
|
-
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
|
8568
|
-
// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
|
8569
|
-
if ( !support.focusin ) {
|
8570
|
-
jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
8571
|
-
|
8572
|
-
// Attach a single capturing handler on the document while someone wants focusin/focusout
|
8573
|
-
var handler = function( event ) {
|
8574
|
-
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
|
8575
|
-
};
|
8576
|
-
|
8577
|
-
jQuery.event.special[ fix ] = {
|
8578
|
-
setup: function() {
|
8579
|
-
var doc = this.ownerDocument || this,
|
8580
|
-
attaches = dataPriv.access( doc, fix );
|
8581
|
-
|
8582
|
-
if ( !attaches ) {
|
8583
|
-
doc.addEventListener( orig, handler, true );
|
8584
|
-
}
|
8585
|
-
dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
|
8586
|
-
},
|
8587
|
-
teardown: function() {
|
8588
|
-
var doc = this.ownerDocument || this,
|
8589
|
-
attaches = dataPriv.access( doc, fix ) - 1;
|
8590
|
-
|
8591
|
-
if ( !attaches ) {
|
8592
|
-
doc.removeEventListener( orig, handler, true );
|
8593
|
-
dataPriv.remove( doc, fix );
|
8594
|
-
|
8595
|
-
} else {
|
8596
|
-
dataPriv.access( doc, fix, attaches );
|
8597
|
-
}
|
8598
|
-
}
|
8599
|
-
};
|
8600
|
-
} );
|
8601
|
-
}
|
8602
|
-
var location = window.location;
|
8603
|
-
|
8604
|
-
var nonce = Date.now();
|
8605
|
-
|
8606
|
-
var rquery = ( /\?/ );
|
8607
|
-
|
8608
|
-
|
8609
|
-
|
8610
|
-
// Cross-browser xml parsing
|
8611
|
-
jQuery.parseXML = function( data ) {
|
8612
|
-
var xml;
|
8613
|
-
if ( !data || typeof data !== "string" ) {
|
8614
|
-
return null;
|
8615
|
-
}
|
8616
|
-
|
8617
|
-
// Support: IE 9 - 11 only
|
8618
|
-
// IE throws on parseFromString with invalid input.
|
8619
|
-
try {
|
8620
|
-
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
|
8621
|
-
} catch ( e ) {
|
8622
|
-
xml = undefined;
|
8623
|
-
}
|
8624
|
-
|
8625
|
-
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
|
8626
|
-
jQuery.error( "Invalid XML: " + data );
|
8627
|
-
}
|
8628
|
-
return xml;
|
8629
|
-
};
|
8630
|
-
|
8631
|
-
|
8632
8709
|
var
|
8633
8710
|
rbracket = /\[\]$/,
|
8634
8711
|
rCRLF = /\r?\n/g,
|
@@ -8724,16 +8801,14 @@ jQuery.fn.extend( {
|
|
8724
8801
|
// Can add propHook for "elements" to filter or add form elements
|
8725
8802
|
var elements = jQuery.prop( this, "elements" );
|
8726
8803
|
return elements ? jQuery.makeArray( elements ) : this;
|
8727
|
-
} )
|
8728
|
-
.filter( function() {
|
8804
|
+
} ).filter( function() {
|
8729
8805
|
var type = this.type;
|
8730
8806
|
|
8731
8807
|
// Use .is( ":disabled" ) so that fieldset[disabled] works
|
8732
8808
|
return this.name && !jQuery( this ).is( ":disabled" ) &&
|
8733
8809
|
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
|
8734
8810
|
( this.checked || !rcheckableType.test( type ) );
|
8735
|
-
} )
|
8736
|
-
.map( function( i, elem ) {
|
8811
|
+
} ).map( function( _i, elem ) {
|
8737
8812
|
var val = jQuery( this ).val();
|
8738
8813
|
|
8739
8814
|
if ( val == null ) {
|
@@ -8758,7 +8833,7 @@ var
|
|
8758
8833
|
rantiCache = /([?&])_=[^&]*/,
|
8759
8834
|
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
|
8760
8835
|
|
8761
|
-
//
|
8836
|
+
// trac-7653, trac-8125, trac-8152: local protocol detection
|
8762
8837
|
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
|
8763
8838
|
rnoContent = /^(?:GET|HEAD)$/,
|
8764
8839
|
rprotocol = /^\/\//,
|
@@ -8781,12 +8856,13 @@ var
|
|
8781
8856
|
*/
|
8782
8857
|
transports = {},
|
8783
8858
|
|
8784
|
-
// Avoid comment-prolog char sequence (
|
8859
|
+
// Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
|
8785
8860
|
allTypes = "*/".concat( "*" ),
|
8786
8861
|
|
8787
8862
|
// Anchor tag for parsing the document origin
|
8788
8863
|
originAnchor = document.createElement( "a" );
|
8789
|
-
|
8864
|
+
|
8865
|
+
originAnchor.href = location.href;
|
8790
8866
|
|
8791
8867
|
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
8792
8868
|
function addToPrefiltersOrTransports( structure ) {
|
@@ -8851,7 +8927,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
|
|
8851
8927
|
|
8852
8928
|
// A special extend for ajax options
|
8853
8929
|
// that takes "flat" options (not to be deep extended)
|
8854
|
-
// Fixes
|
8930
|
+
// Fixes trac-9887
|
8855
8931
|
function ajaxExtend( target, src ) {
|
8856
8932
|
var key, deep,
|
8857
8933
|
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
@@ -9167,8 +9243,8 @@ jQuery.extend( {
|
|
9167
9243
|
// Context for global events is callbackContext if it is a DOM node or jQuery collection
|
9168
9244
|
globalEventContext = s.context &&
|
9169
9245
|
( callbackContext.nodeType || callbackContext.jquery ) ?
|
9170
|
-
|
9171
|
-
|
9246
|
+
jQuery( callbackContext ) :
|
9247
|
+
jQuery.event,
|
9172
9248
|
|
9173
9249
|
// Deferreds
|
9174
9250
|
deferred = jQuery.Deferred(),
|
@@ -9262,12 +9338,12 @@ jQuery.extend( {
|
|
9262
9338
|
deferred.promise( jqXHR );
|
9263
9339
|
|
9264
9340
|
// Add protocol if not provided (prefilters might expect it)
|
9265
|
-
// Handle falsy url in the settings object (
|
9341
|
+
// Handle falsy url in the settings object (trac-10093: consistency with old signature)
|
9266
9342
|
// We also use the url parameter if available
|
9267
9343
|
s.url = ( ( url || s.url || location.href ) + "" )
|
9268
9344
|
.replace( rprotocol, location.protocol + "//" );
|
9269
9345
|
|
9270
|
-
// Alias method option to type as per ticket
|
9346
|
+
// Alias method option to type as per ticket trac-12004
|
9271
9347
|
s.type = options.method || options.type || s.method || s.type;
|
9272
9348
|
|
9273
9349
|
// Extract dataTypes list
|
@@ -9310,7 +9386,7 @@ jQuery.extend( {
|
|
9310
9386
|
}
|
9311
9387
|
|
9312
9388
|
// We can fire global events as of now if asked to
|
9313
|
-
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (
|
9389
|
+
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
|
9314
9390
|
fireGlobals = jQuery.event && s.global;
|
9315
9391
|
|
9316
9392
|
// Watch for a new set of requests
|
@@ -9339,14 +9415,15 @@ jQuery.extend( {
|
|
9339
9415
|
if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
|
9340
9416
|
cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
|
9341
9417
|
|
9342
|
-
//
|
9418
|
+
// trac-9682: remove data so that it's not used in an eventual retry
|
9343
9419
|
delete s.data;
|
9344
9420
|
}
|
9345
9421
|
|
9346
9422
|
// Add or update anti-cache param if needed
|
9347
9423
|
if ( s.cache === false ) {
|
9348
9424
|
cacheURL = cacheURL.replace( rantiCache, "$1" );
|
9349
|
-
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) +
|
9425
|
+
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
|
9426
|
+
uncached;
|
9350
9427
|
}
|
9351
9428
|
|
9352
9429
|
// Put hash and anti-cache on the URL that will be requested (gh-1732)
|
@@ -9479,6 +9556,13 @@ jQuery.extend( {
|
|
9479
9556
|
response = ajaxHandleResponses( s, jqXHR, responses );
|
9480
9557
|
}
|
9481
9558
|
|
9559
|
+
// Use a noop converter for missing script but not if jsonp
|
9560
|
+
if ( !isSuccess &&
|
9561
|
+
jQuery.inArray( "script", s.dataTypes ) > -1 &&
|
9562
|
+
jQuery.inArray( "json", s.dataTypes ) < 0 ) {
|
9563
|
+
s.converters[ "text script" ] = function() {};
|
9564
|
+
}
|
9565
|
+
|
9482
9566
|
// Convert no matter what (that way responseXXX fields are always set)
|
9483
9567
|
response = ajaxConvert( s, response, jqXHR, isSuccess );
|
9484
9568
|
|
@@ -9569,7 +9653,7 @@ jQuery.extend( {
|
|
9569
9653
|
}
|
9570
9654
|
} );
|
9571
9655
|
|
9572
|
-
jQuery.each( [ "get", "post" ], function(
|
9656
|
+
jQuery.each( [ "get", "post" ], function( _i, method ) {
|
9573
9657
|
jQuery[ method ] = function( url, data, callback, type ) {
|
9574
9658
|
|
9575
9659
|
// Shift arguments if data argument was omitted
|
@@ -9590,12 +9674,21 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
|
|
9590
9674
|
};
|
9591
9675
|
} );
|
9592
9676
|
|
9677
|
+
jQuery.ajaxPrefilter( function( s ) {
|
9678
|
+
var i;
|
9679
|
+
for ( i in s.headers ) {
|
9680
|
+
if ( i.toLowerCase() === "content-type" ) {
|
9681
|
+
s.contentType = s.headers[ i ] || "";
|
9682
|
+
}
|
9683
|
+
}
|
9684
|
+
} );
|
9685
|
+
|
9593
9686
|
|
9594
|
-
jQuery._evalUrl = function( url, options ) {
|
9687
|
+
jQuery._evalUrl = function( url, options, doc ) {
|
9595
9688
|
return jQuery.ajax( {
|
9596
9689
|
url: url,
|
9597
9690
|
|
9598
|
-
// Make this explicit, since user can override this through ajaxSetup (
|
9691
|
+
// Make this explicit, since user can override this through ajaxSetup (trac-11264)
|
9599
9692
|
type: "GET",
|
9600
9693
|
dataType: "script",
|
9601
9694
|
cache: true,
|
@@ -9609,7 +9702,7 @@ jQuery._evalUrl = function( url, options ) {
|
|
9609
9702
|
"text script": function() {}
|
9610
9703
|
},
|
9611
9704
|
dataFilter: function( response ) {
|
9612
|
-
jQuery.globalEval( response, options );
|
9705
|
+
jQuery.globalEval( response, options, doc );
|
9613
9706
|
}
|
9614
9707
|
} );
|
9615
9708
|
};
|
@@ -9704,7 +9797,7 @@ var xhrSuccessStatus = {
|
|
9704
9797
|
0: 200,
|
9705
9798
|
|
9706
9799
|
// Support: IE <=9 only
|
9707
|
-
//
|
9800
|
+
// trac-1450: sometimes IE returns 1223 when it should be 204
|
9708
9801
|
1223: 204
|
9709
9802
|
},
|
9710
9803
|
xhrSupported = jQuery.ajaxSettings.xhr();
|
@@ -9776,7 +9869,7 @@ jQuery.ajaxTransport( function( options ) {
|
|
9776
9869
|
} else {
|
9777
9870
|
complete(
|
9778
9871
|
|
9779
|
-
// File: protocol always yields status 0; see
|
9872
|
+
// File: protocol always yields status 0; see trac-8605, trac-14207
|
9780
9873
|
xhr.status,
|
9781
9874
|
xhr.statusText
|
9782
9875
|
);
|
@@ -9837,7 +9930,7 @@ jQuery.ajaxTransport( function( options ) {
|
|
9837
9930
|
xhr.send( options.hasContent && options.data || null );
|
9838
9931
|
} catch ( e ) {
|
9839
9932
|
|
9840
|
-
//
|
9933
|
+
// trac-14683: Only rethrow if this hasn't been notified as an error yet
|
9841
9934
|
if ( callback ) {
|
9842
9935
|
throw e;
|
9843
9936
|
}
|
@@ -9931,7 +10024,7 @@ var oldCallbacks = [],
|
|
9931
10024
|
jQuery.ajaxSetup( {
|
9932
10025
|
jsonp: "callback",
|
9933
10026
|
jsonpCallback: function() {
|
9934
|
-
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
|
10027
|
+
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
|
9935
10028
|
this[ callback ] = true;
|
9936
10029
|
return callback;
|
9937
10030
|
}
|
@@ -10148,23 +10241,6 @@ jQuery.fn.load = function( url, params, callback ) {
|
|
10148
10241
|
|
10149
10242
|
|
10150
10243
|
|
10151
|
-
// Attach a bunch of functions for handling common AJAX events
|
10152
|
-
jQuery.each( [
|
10153
|
-
"ajaxStart",
|
10154
|
-
"ajaxStop",
|
10155
|
-
"ajaxComplete",
|
10156
|
-
"ajaxError",
|
10157
|
-
"ajaxSuccess",
|
10158
|
-
"ajaxSend"
|
10159
|
-
], function( i, type ) {
|
10160
|
-
jQuery.fn[ type ] = function( fn ) {
|
10161
|
-
return this.on( type, fn );
|
10162
|
-
};
|
10163
|
-
} );
|
10164
|
-
|
10165
|
-
|
10166
|
-
|
10167
|
-
|
10168
10244
|
jQuery.expr.pseudos.animated = function( elem ) {
|
10169
10245
|
return jQuery.grep( jQuery.timers, function( fn ) {
|
10170
10246
|
return elem === fn.elem;
|
@@ -10371,7 +10447,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
|
|
10371
10447
|
// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
|
10372
10448
|
// getComputedStyle returns percent when specified for top/left/bottom/right;
|
10373
10449
|
// rather than make the css module depend on the offset module, just check for it here
|
10374
|
-
jQuery.each( [ "top", "left" ], function(
|
10450
|
+
jQuery.each( [ "top", "left" ], function( _i, prop ) {
|
10375
10451
|
jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
|
10376
10452
|
function( elem, computed ) {
|
10377
10453
|
if ( computed ) {
|
@@ -10389,8 +10465,11 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
|
|
10389
10465
|
|
10390
10466
|
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
|
10391
10467
|
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
10392
|
-
jQuery.each( {
|
10393
|
-
|
10468
|
+
jQuery.each( {
|
10469
|
+
padding: "inner" + name,
|
10470
|
+
content: type,
|
10471
|
+
"": "outer" + name
|
10472
|
+
}, function( defaultExtra, funcName ) {
|
10394
10473
|
|
10395
10474
|
// Margin is only for outerHeight, outerWidth
|
10396
10475
|
jQuery.fn[ funcName ] = function( margin, value ) {
|
@@ -10434,25 +10513,19 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
|
10434
10513
|
} );
|
10435
10514
|
|
10436
10515
|
|
10437
|
-
jQuery.each(
|
10438
|
-
"
|
10439
|
-
"
|
10440
|
-
|
10441
|
-
|
10442
|
-
|
10443
|
-
|
10444
|
-
|
10445
|
-
|
10446
|
-
|
10516
|
+
jQuery.each( [
|
10517
|
+
"ajaxStart",
|
10518
|
+
"ajaxStop",
|
10519
|
+
"ajaxComplete",
|
10520
|
+
"ajaxError",
|
10521
|
+
"ajaxSuccess",
|
10522
|
+
"ajaxSend"
|
10523
|
+
], function( _i, type ) {
|
10524
|
+
jQuery.fn[ type ] = function( fn ) {
|
10525
|
+
return this.on( type, fn );
|
10447
10526
|
};
|
10448
10527
|
} );
|
10449
10528
|
|
10450
|
-
jQuery.fn.extend( {
|
10451
|
-
hover: function( fnOver, fnOut ) {
|
10452
|
-
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
10453
|
-
}
|
10454
|
-
} );
|
10455
|
-
|
10456
10529
|
|
10457
10530
|
|
10458
10531
|
|
@@ -10474,9 +10547,37 @@ jQuery.fn.extend( {
|
|
10474
10547
|
return arguments.length === 1 ?
|
10475
10548
|
this.off( selector, "**" ) :
|
10476
10549
|
this.off( types, selector || "**", fn );
|
10550
|
+
},
|
10551
|
+
|
10552
|
+
hover: function( fnOver, fnOut ) {
|
10553
|
+
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
10477
10554
|
}
|
10478
10555
|
} );
|
10479
10556
|
|
10557
|
+
jQuery.each(
|
10558
|
+
( "blur focus focusin focusout resize scroll click dblclick " +
|
10559
|
+
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
10560
|
+
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
|
10561
|
+
function( _i, name ) {
|
10562
|
+
|
10563
|
+
// Handle event binding
|
10564
|
+
jQuery.fn[ name ] = function( data, fn ) {
|
10565
|
+
return arguments.length > 0 ?
|
10566
|
+
this.on( name, null, data, fn ) :
|
10567
|
+
this.trigger( name );
|
10568
|
+
};
|
10569
|
+
}
|
10570
|
+
);
|
10571
|
+
|
10572
|
+
|
10573
|
+
|
10574
|
+
|
10575
|
+
// Support: Android <=4.0 only
|
10576
|
+
// Make sure we trim BOM and NBSP
|
10577
|
+
// Require that the "whitespace run" starts from a non-whitespace
|
10578
|
+
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
|
10579
|
+
var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
|
10580
|
+
|
10480
10581
|
// Bind a function to a context, optionally partially applying any
|
10481
10582
|
// arguments.
|
10482
10583
|
// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
|
@@ -10539,6 +10640,11 @@ jQuery.isNumeric = function( obj ) {
|
|
10539
10640
|
!isNaN( obj - parseFloat( obj ) );
|
10540
10641
|
};
|
10541
10642
|
|
10643
|
+
jQuery.trim = function( text ) {
|
10644
|
+
return text == null ?
|
10645
|
+
"" :
|
10646
|
+
( text + "" ).replace( rtrim, "$1" );
|
10647
|
+
};
|
10542
10648
|
|
10543
10649
|
|
10544
10650
|
|
@@ -10585,9 +10691,9 @@ jQuery.noConflict = function( deep ) {
|
|
10585
10691
|
};
|
10586
10692
|
|
10587
10693
|
// Expose jQuery and $ identifiers, even in AMD
|
10588
|
-
// (
|
10589
|
-
// and CommonJS for browser emulators (
|
10590
|
-
if (
|
10694
|
+
// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
|
10695
|
+
// and CommonJS for browser emulators (trac-13566)
|
10696
|
+
if ( typeof noGlobal === "undefined" ) {
|
10591
10697
|
window.jQuery = window.$ = jQuery;
|
10592
10698
|
}
|
10593
10699
|
|