Selector: Update Sizzle to 1.10.19

Fixes #14901
Fixes #14793
This commit is contained in:
Richard Gibson 2014-04-18 17:17:51 -04:00
parent def4841cfa
commit 90b43de212
4 changed files with 38 additions and 28 deletions

View File

@ -14,7 +14,7 @@
"package.json" "package.json"
], ],
"devDependencies": { "devDependencies": {
"sizzle": "1.10.18", "sizzle": "1.10.19",
"requirejs": "2.1.10", "requirejs": "2.1.10",
"qunit": "1.14.0", "qunit": "1.14.0",
"sinon": "1.8.1" "sinon": "1.8.1"

View File

@ -1,12 +1,12 @@
/*! /*!
* Sizzle CSS Selector Engine v1.10.18 * Sizzle CSS Selector Engine v1.10.19
* http://sizzlejs.com/ * http://sizzlejs.com/
* *
* Copyright 2013 jQuery Foundation, Inc. and other contributors * Copyright 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license * Released under the MIT license
* http://jquery.org/license * http://jquery.org/license
* *
* Date: 2014-02-05 * Date: 2014-04-18
*/ */
(function( window ) { (function( window ) {
@ -15,6 +15,7 @@ var i,
Expr, Expr,
getText, getText,
isXML, isXML,
tokenize,
compile, compile,
select, select,
outermostContext, outermostContext,
@ -83,17 +84,23 @@ var i,
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = characterEncoding.replace( "w", "w#" ), identifier = characterEncoding.replace( "w", "w#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
"*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Operator (capture 2)
"*([*^$|!~]?=)" + whitespace +
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
"*\\]",
// Prefer arguments quoted, pseudos = ":(" + characterEncoding + ")(?:\\((" +
// then not containing pseudos/brackets, // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
// then attribute selectors/non-parenthetical expressions, // 1. quoted (capture 3; capture 4 or capture 5)
// then anything else "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
// These preferences are here to reduce the number of selectors // 2. simple (capture 6)
// needing tokenize in the PSEUDO preFilter "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // 3. anything else (capture 2)
".*" +
")\\)|)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
@ -614,11 +621,13 @@ setDocument = Sizzle.setDocument = function( node ) {
// setting a boolean content attribute, // setting a boolean content attribute,
// since its presence should be enough // since its presence should be enough
// http://bugs.jquery.com/ticket/12359 // http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select t=''><option selected=''></option></select>"; div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
// Support: IE8, Opera 10-12 // Support: IE8, Opera 11-12.16
// Nothing should be selected when empty strings follow ^= or $= or *= // Nothing should be selected when empty strings follow ^= or $= or *=
if ( div.querySelectorAll("[t^='']").length ) { // The test attribute must be unknown in Opera but "safe" for WinRT
// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
if ( div.querySelectorAll("[msallowclip^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
} }
@ -661,7 +670,8 @@ setDocument = Sizzle.setDocument = function( node ) {
}); });
} }
if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
docElem.webkitMatchesSelector ||
docElem.mozMatchesSelector || docElem.mozMatchesSelector ||
docElem.oMatchesSelector || docElem.oMatchesSelector ||
docElem.msMatchesSelector) )) ) { docElem.msMatchesSelector) )) ) {
@ -971,7 +981,7 @@ Expr = Sizzle.selectors = {
match[1] = match[1].replace( runescape, funescape ); match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted // Move the given value to match[3] whether quoted or unquoted
match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
if ( match[2] === "~=" ) { if ( match[2] === "~=" ) {
match[3] = " " + match[3] + " "; match[3] = " " + match[3] + " ";
@ -1014,15 +1024,15 @@ Expr = Sizzle.selectors = {
"PSEUDO": function( match ) { "PSEUDO": function( match ) {
var excess, var excess,
unquoted = !match[5] && match[2]; unquoted = !match[6] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) { if ( matchExpr["CHILD"].test( match[0] ) ) {
return null; return null;
} }
// Accept quoted arguments as-is // Accept quoted arguments as-is
if ( match[3] && match[4] !== undefined ) { if ( match[3] ) {
match[2] = match[4]; match[2] = match[4] || match[5] || "";
// Strip excess characters from unquoted arguments // Strip excess characters from unquoted arguments
} else if ( unquoted && rpseudo.test( unquoted ) && } else if ( unquoted && rpseudo.test( unquoted ) &&
@ -1427,7 +1437,7 @@ function setFilters() {}
setFilters.prototype = Expr.filters = Expr.pseudos; setFilters.prototype = Expr.filters = Expr.pseudos;
Expr.setFilters = new setFilters(); Expr.setFilters = new setFilters();
function tokenize( selector, parseOnly ) { tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
var matched, match, tokens, type, var matched, match, tokens, type,
soFar, groups, preFilters, soFar, groups, preFilters,
cached = tokenCache[ selector + " " ]; cached = tokenCache[ selector + " " ];
@ -1492,7 +1502,7 @@ function tokenize( selector, parseOnly ) {
Sizzle.error( selector ) : Sizzle.error( selector ) :
// Cache the tokens // Cache the tokens
tokenCache( selector, groups ).slice( 0 ); tokenCache( selector, groups ).slice( 0 );
} };
function toSelector( tokens ) { function toSelector( tokens ) {
var i = 0, var i = 0,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long