Skip to content

Commit 90b43de

Browse files
committed
Selector: Update Sizzle to 1.10.19
Fixes #14901 Fixes #14793
1 parent def4841 commit 90b43de

File tree

4 files changed

+39
-29
lines changed

4 files changed

+39
-29
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"package.json"
1515
],
1616
"devDependencies": {
17-
"sizzle": "1.10.18",
17+
"sizzle": "1.10.19",
1818
"requirejs": "2.1.10",
1919
"qunit": "1.14.0",
2020
"sinon": "1.8.1"

src/sizzle/dist/sizzle.js

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*!
2-
* Sizzle CSS Selector Engine v1.10.18
2+
* Sizzle CSS Selector Engine v1.10.19
33
* http://sizzlejs.com/
44
*
55
* Copyright 2013 jQuery Foundation, Inc. and other contributors
66
* Released under the MIT license
77
* http://jquery.org/license
88
*
9-
* Date: 2014-02-05
9+
* Date: 2014-04-18
1010
*/
1111
(function( window ) {
1212

@@ -15,6 +15,7 @@ var i,
1515
Expr,
1616
getText,
1717
isXML,
18+
tokenize,
1819
compile,
1920
select,
2021
outermostContext,
@@ -83,17 +84,23 @@ var i,
8384
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
8485
identifier = characterEncoding.replace( "w", "w#" ),
8586

86-
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
87-
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
88-
"*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
89-
90-
// Prefer arguments quoted,
91-
// then not containing pseudos/brackets,
92-
// then attribute selectors/non-parenthetical expressions,
93-
// then anything else
94-
// These preferences are here to reduce the number of selectors
95-
// needing tokenize in the PSEUDO preFilter
96-
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
87+
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
88+
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
89+
// Operator (capture 2)
90+
"*([*^$|!~]?=)" + whitespace +
91+
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
92+
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
93+
"*\\]",
94+
95+
pseudos = ":(" + characterEncoding + ")(?:\\((" +
96+
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
97+
// 1. quoted (capture 3; capture 4 or capture 5)
98+
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
99+
// 2. simple (capture 6)
100+
"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
101+
// 3. anything else (capture 2)
102+
".*" +
103+
")\\)|)",
97104

98105
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
99106
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
@@ -534,7 +541,7 @@ setDocument = Sizzle.setDocument = function( node ) {
534541
var m = context.getElementById( id );
535542
// Check parentNode to catch when Blackberry 4.6 returns
536543
// nodes that are no longer in the document #6963
537-
return m && m.parentNode ? [m] : [];
544+
return m && m.parentNode ? [ m ] : [];
538545
}
539546
};
540547
Expr.filter["ID"] = function( id ) {
@@ -614,11 +621,13 @@ setDocument = Sizzle.setDocument = function( node ) {
614621
// setting a boolean content attribute,
615622
// since its presence should be enough
616623
// http://bugs.jquery.com/ticket/12359
617-
div.innerHTML = "<select t=''><option selected=''></option></select>";
624+
div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
618625

619-
// Support: IE8, Opera 10-12
626+
// Support: IE8, Opera 11-12.16
620627
// Nothing should be selected when empty strings follow ^= or $= or *=
621-
if ( div.querySelectorAll("[t^='']").length ) {
628+
// The test attribute must be unknown in Opera but "safe" for WinRT
629+
// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
630+
if ( div.querySelectorAll("[msallowclip^='']").length ) {
622631
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
623632
}
624633

@@ -661,7 +670,8 @@ setDocument = Sizzle.setDocument = function( node ) {
661670
});
662671
}
663672

664-
if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
673+
if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
674+
docElem.webkitMatchesSelector ||
665675
docElem.mozMatchesSelector ||
666676
docElem.oMatchesSelector ||
667677
docElem.msMatchesSelector) )) ) {
@@ -842,7 +852,7 @@ Sizzle.matchesSelector = function( elem, expr ) {
842852
} catch(e) {}
843853
}
844854

845-
return Sizzle( expr, document, null, [elem] ).length > 0;
855+
return Sizzle( expr, document, null, [ elem ] ).length > 0;
846856
};
847857

848858
Sizzle.contains = function( context, elem ) {
@@ -971,7 +981,7 @@ Expr = Sizzle.selectors = {
971981
match[1] = match[1].replace( runescape, funescape );
972982

973983
// Move the given value to match[3] whether quoted or unquoted
974-
match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
984+
match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
975985

976986
if ( match[2] === "~=" ) {
977987
match[3] = " " + match[3] + " ";
@@ -1014,15 +1024,15 @@ Expr = Sizzle.selectors = {
10141024

10151025
"PSEUDO": function( match ) {
10161026
var excess,
1017-
unquoted = !match[5] && match[2];
1027+
unquoted = !match[6] && match[2];
10181028

10191029
if ( matchExpr["CHILD"].test( match[0] ) ) {
10201030
return null;
10211031
}
10221032

10231033
// Accept quoted arguments as-is
1024-
if ( match[3] && match[4] !== undefined ) {
1025-
match[2] = match[4];
1034+
if ( match[3] ) {
1035+
match[2] = match[4] || match[5] || "";
10261036

10271037
// Strip excess characters from unquoted arguments
10281038
} else if ( unquoted && rpseudo.test( unquoted ) &&
@@ -1427,7 +1437,7 @@ function setFilters() {}
14271437
setFilters.prototype = Expr.filters = Expr.pseudos;
14281438
Expr.setFilters = new setFilters();
14291439

1430-
function tokenize( selector, parseOnly ) {
1440+
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
14311441
var matched, match, tokens, type,
14321442
soFar, groups, preFilters,
14331443
cached = tokenCache[ selector + " " ];
@@ -1492,7 +1502,7 @@ function tokenize( selector, parseOnly ) {
14921502
Sizzle.error( selector ) :
14931503
// Cache the tokens
14941504
tokenCache( selector, groups ).slice( 0 );
1495-
}
1505+
};
14961506

14971507
function toSelector( tokens ) {
14981508
var i = 0,

0 commit comments

Comments
 (0)