Build: Update Sizzle from 2.3.3 to 2.3.4

Fixes gh-1756
Fixes gh-4170
Fixes gh-4249
Closes gh-4345
This commit is contained in:
Michał Gołębiowski-Owczarek 2019-04-09 09:50:45 +02:00 committed by GitHub
parent 00a9c2e5f4
commit 0b2c36adb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 46 deletions

View File

@ -1,4 +1,4 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/ Copyright JS Foundation and other contributors, https://js.foundation/
This software consists of voluntary contributions made by many This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history individuals. For exact contribution history, see the revision history

View File

@ -1,12 +1,12 @@
/*! /*!
* Sizzle CSS Selector Engine v2.3.3 * Sizzle CSS Selector Engine v2.3.4
* https://sizzlejs.com/ * https://sizzlejs.com/
* *
* Copyright jQuery Foundation and other contributors * Copyright JS Foundation and other contributors
* Released under the MIT license * Released under the MIT license
* http://jquery.org/license * https://js.foundation/
* *
* Date: 2016-08-08 * Date: 2019-04-08
*/ */
(function( window ) { (function( window ) {
@ -40,6 +40,7 @@ var i,
classCache = createCache(), classCache = createCache(),
tokenCache = createCache(), tokenCache = createCache(),
compilerCache = createCache(), compilerCache = createCache(),
nonnativeSelectorCache = createCache(),
sortOrder = function( a, b ) { sortOrder = function( a, b ) {
if ( a === b ) { if ( a === b ) {
hasDuplicate = true; hasDuplicate = true;
@ -101,8 +102,7 @@ var i,
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
rdescend = new RegExp( whitespace + "|>" ),
rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
rpseudo = new RegExp( pseudos ), rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ), ridentifier = new RegExp( "^" + identifier + "$" ),
@ -123,6 +123,7 @@ var i,
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
}, },
rhtml = /HTML$/i,
rinputs = /^(?:input|select|textarea|button)$/i, rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i, rheader = /^h\d$/i,
@ -177,9 +178,9 @@ var i,
setDocument(); setDocument();
}, },
disabledAncestor = addCombinator( inDisabledFieldset = addCombinator(
function( elem ) { function( elem ) {
return elem.disabled === true && ("form" in elem || "label" in elem); return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
}, },
{ dir: "parentNode", next: "legend" } { dir: "parentNode", next: "legend" }
); );
@ -292,18 +293,22 @@ function Sizzle( selector, context, results, seed ) {
// Take advantage of querySelectorAll // Take advantage of querySelectorAll
if ( support.qsa && if ( support.qsa &&
!compilerCache[ selector + " " ] && !nonnativeSelectorCache[ selector + " " ] &&
(!rbuggyQSA || !rbuggyQSA.test( selector )) ) { (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
if ( nodeType !== 1 ) { // Support: IE 8 only
newContext = context;
newSelector = selector;
// qSA looks outside Element context, which is not what we want
// Thanks to Andrew Dupont for this workaround technique
// Support: IE <=8
// Exclude object elements // Exclude object elements
} else if ( context.nodeName.toLowerCase() !== "object" ) { (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
newSelector = selector;
newContext = context;
// qSA considers elements outside a scoping root when evaluating child or
// descendant combinators, which is not what we want.
// In such cases, we work around the behavior by prefixing every selector in the
// list with an ID selector referencing the scope context.
// Thanks to Andrew Dupont for this technique.
if ( nodeType === 1 && rdescend.test( selector ) ) {
// Capture the context ID, setting it first if necessary // Capture the context ID, setting it first if necessary
if ( (nid = context.getAttribute( "id" )) ) { if ( (nid = context.getAttribute( "id" )) ) {
@ -325,13 +330,13 @@ function Sizzle( selector, context, results, seed ) {
context; context;
} }
if ( newSelector ) {
try { try {
push.apply( results, push.apply( results,
newContext.querySelectorAll( newSelector ) newContext.querySelectorAll( newSelector )
); );
return results; return results;
} catch ( qsaError ) { } catch ( qsaError ) {
nonnativeSelectorCache( selector, true );
} finally { } finally {
if ( nid === expando ) { if ( nid === expando ) {
context.removeAttribute( "id" ); context.removeAttribute( "id" );
@ -340,7 +345,6 @@ function Sizzle( selector, context, results, seed ) {
} }
} }
} }
}
// All others // All others
return select( selector.replace( rtrim, "$1" ), context, results, seed ); return select( selector.replace( rtrim, "$1" ), context, results, seed );
@ -499,7 +503,7 @@ function createDisabledPseudo( disabled ) {
// Where there is no isDisabled, check manually // Where there is no isDisabled, check manually
/* jshint -W018 */ /* jshint -W018 */
elem.isDisabled !== !disabled && elem.isDisabled !== !disabled &&
disabledAncestor( elem ) === disabled; inDisabledFieldset( elem ) === disabled;
} }
return elem.disabled === disabled; return elem.disabled === disabled;
@ -556,10 +560,13 @@ support = Sizzle.support = {};
* @returns {Boolean} True iff elem is a non-HTML XML node * @returns {Boolean} True iff elem is a non-HTML XML node
*/ */
isXML = Sizzle.isXML = function( elem ) { isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist var namespace = elem.namespaceURI,
// (such as loading iframes in IE - #4833) docElem = (elem.ownerDocument || elem).documentElement;
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false; // Support: IE <=8
// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
// https://bugs.jquery.com/ticket/4833
return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
}; };
/** /**
@ -981,11 +988,8 @@ Sizzle.matchesSelector = function( elem, expr ) {
setDocument( elem ); setDocument( elem );
} }
// Make sure that attribute selectors are quoted
expr = expr.replace( rattributeQuotes, "='$1']" );
if ( support.matchesSelector && documentIsHTML && if ( support.matchesSelector && documentIsHTML &&
!compilerCache[ expr + " " ] && !nonnativeSelectorCache[ expr + " " ] &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
@ -999,7 +1003,9 @@ Sizzle.matchesSelector = function( elem, expr ) {
elem.document && elem.document.nodeType !== 11 ) { elem.document && elem.document.nodeType !== 11 ) {
return ret; return ret;
} }
} catch (e) {} } catch (e) {
nonnativeSelectorCache( expr, true );
}
} }
return Sizzle( expr, document, null, [ elem ] ).length > 0; return Sizzle( expr, document, null, [ elem ] ).length > 0;
@ -1458,7 +1464,7 @@ Expr = Sizzle.selectors = {
"contains": markFunction(function( text ) { "contains": markFunction(function( text ) {
text = text.replace( runescape, funescape ); text = text.replace( runescape, funescape );
return function( elem ) { return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
}; };
}), }),
@ -1597,7 +1603,11 @@ Expr = Sizzle.selectors = {
}), }),
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) { "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument; var i = argument < 0 ?
argument + length :
argument > length ?
length :
argument;
for ( ; --i >= 0; ) { for ( ; --i >= 0; ) {
matchIndexes.push( i ); matchIndexes.push( i );
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -61,7 +61,7 @@
"raw-body": "2.3.3", "raw-body": "2.3.3",
"requirejs": "2.3.6", "requirejs": "2.3.6",
"sinon": "7.3.1", "sinon": "7.3.1",
"sizzle": "2.3.3", "sizzle": "2.3.4",
"strip-json-comments": "2.0.1", "strip-json-comments": "2.0.1",
"testswarm": "1.1.0", "testswarm": "1.1.0",
"uglify-js": "3.4.7" "uglify-js": "3.4.7"