1
1
/*!
2
- * Sizzle CSS Selector Engine v1.10.19
2
+ * Sizzle CSS Selector Engine v1.11.1
3
3
* http://sizzlejs.com/
4
4
*
5
5
* Copyright 2013 jQuery Foundation, Inc. and other contributors
6
6
* Released under the MIT license
7
7
* http://jquery.org/license
8
8
*
9
- * Date: 2014-04-18
9
+ * Date: 2014-06-25
10
10
*/
11
11
( function ( window ) {
12
12
@@ -74,25 +74,21 @@ var i,
74
74
75
75
// Regular expressions
76
76
77
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
77
+ // http://www.w3.org/TR/css3-selectors/#whitespace
78
78
whitespace = "[\\x20\\t\\r\\n\\f]" ,
79
- // http://www.w3.org/TR/css3-syntax/#characters
80
- characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+" ,
81
79
82
- // Loosely modeled on CSS identifier characters
83
- // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
84
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
85
- identifier = characterEncoding . replace ( "w" , "w#" ) ,
80
+ // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
81
+ identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+" ,
86
82
87
83
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
88
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
84
+ attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
89
85
// Operator (capture 2)
90
86
"*([*^$|!~]?=)" + whitespace +
91
87
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
92
88
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
93
89
"*\\]" ,
94
90
95
- pseudos = ":(" + characterEncoding + ")(?:\\((" +
91
+ pseudos = ":(" + identifier + ")(?:\\((" +
96
92
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
97
93
// 1. quoted (capture 3; capture 4 or capture 5)
98
94
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
@@ -114,9 +110,9 @@ var i,
114
110
ridentifier = new RegExp ( "^" + identifier + "$" ) ,
115
111
116
112
matchExpr = {
117
- "ID" : new RegExp ( "^#(" + characterEncoding + ")" ) ,
118
- "CLASS" : new RegExp ( "^\\.(" + characterEncoding + ")" ) ,
119
- "TAG" : new RegExp ( "^(" + characterEncoding . replace ( "w" , "w*" ) + ")" ) ,
113
+ "ID" : new RegExp ( "^#(" + identifier + ")" ) ,
114
+ "CLASS" : new RegExp ( "^\\.(" + identifier + ")" ) ,
115
+ "TAG" : new RegExp ( "^(" + identifier + "|[*] )" ) ,
120
116
"ATTR" : new RegExp ( "^" + attributes ) ,
121
117
"PSEUDO" : new RegExp ( "^" + pseudos ) ,
122
118
"CHILD" : new RegExp ( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
@@ -240,7 +236,7 @@ function Sizzle( selector, context, results, seed ) {
240
236
return results ;
241
237
242
238
// Speed-up: Sizzle(".CLASS")
243
- } else if ( ( m = match [ 3 ] ) && support . getElementsByClassName && context . getElementsByClassName ) {
239
+ } else if ( ( m = match [ 3 ] ) && support . getElementsByClassName ) {
244
240
push . apply ( results , context . getElementsByClassName ( m ) ) ;
245
241
return results ;
246
242
}
@@ -513,17 +509,8 @@ setDocument = Sizzle.setDocument = function( node ) {
513
509
return ! div . getElementsByTagName ( "*" ) . length ;
514
510
} ) ;
515
511
516
- // Check if getElementsByClassName can be trusted
517
- support . getElementsByClassName = rnative . test ( doc . getElementsByClassName ) && assert ( function ( div ) {
518
- div . innerHTML = "<div class='a'></div><div class='a i'></div>" ;
519
-
520
- // Support: Safari<4
521
- // Catch class over-caching
522
- div . firstChild . className = "i" ;
523
- // Support: Opera<10
524
- // Catch gEBCN failure to find non-leading classes
525
- return div . getElementsByClassName ( "i" ) . length === 2 ;
526
- } ) ;
512
+ // Support: IE<9
513
+ support . getElementsByClassName = rnative . test ( doc . getElementsByClassName ) ;
527
514
528
515
// Support: IE<10
529
516
// Check if getElementById returns elements by name
@@ -592,7 +579,7 @@ setDocument = Sizzle.setDocument = function( node ) {
592
579
593
580
// Class
594
581
Expr . find [ "CLASS" ] = support . getElementsByClassName && function ( className , context ) {
595
- if ( typeof context . getElementsByClassName !== strundefined && documentIsHTML ) {
582
+ if ( documentIsHTML ) {
596
583
return context . getElementsByClassName ( className ) ;
597
584
}
598
585
} ;
@@ -621,13 +608,13 @@ setDocument = Sizzle.setDocument = function( node ) {
621
608
// setting a boolean content attribute,
622
609
// since its presence should be enough
623
610
// http://bugs.jquery.com/ticket/12359
624
- div . innerHTML = "<select msallowclip =''><option selected=''></option></select>" ;
611
+ div . innerHTML = "<select msallowcapture =''><option selected=''></option></select>" ;
625
612
626
613
// Support: IE8, Opera 11-12.16
627
614
// Nothing should be selected when empty strings follow ^= or $= or *=
628
615
// The test attribute must be unknown in Opera but "safe" for WinRT
629
616
// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
630
- if ( div . querySelectorAll ( "[msallowclip ^='']" ) . length ) {
617
+ if ( div . querySelectorAll ( "[msallowcapture ^='']" ) . length ) {
631
618
rbuggyQSA . push ( "[*^$]=" + whitespace + "*(?:''|\"\")" ) ;
632
619
}
633
620
@@ -1260,6 +1247,7 @@ Expr = Sizzle.selectors = {
1260
1247
} ) ,
1261
1248
1262
1249
"contains" : markFunction ( function ( text ) {
1250
+ text = text . replace ( runescape , funescape ) ;
1263
1251
return function ( elem ) {
1264
1252
return ( elem . textContent || elem . innerText || getText ( elem ) ) . indexOf ( text ) > - 1 ;
1265
1253
} ;
@@ -1972,7 +1960,7 @@ select = Sizzle.select = function( selector, context, results, seed ) {
1972
1960
// Sort stability
1973
1961
support . sortStable = expando . split ( "" ) . sort ( sortOrder ) . join ( "" ) === expando ;
1974
1962
1975
- // Support: Chrome<14
1963
+ // Support: Chrome 14-35+
1976
1964
// Always assume duplicates if they aren't passed to the comparison function
1977
1965
support . detectDuplicates = ! ! hasDuplicate ;
1978
1966
0 commit comments