Skip to content
Permalink
Browse files

Build: Update Sizzle from 2.3.3 to 2.3.4

(cherry-picked from 0b2c36a)

Fixes gh-1756
Fixes gh-4170
Fixes gh-4249
Closes gh-4345
  • Loading branch information...
mgol committed Apr 9, 2019
1 parent 9b9fca4 commit d940bc063cd5ae09bf52067bbe046fda88f1f687
@@ -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
individuals. For exact contribution history, see the revision history
@@ -1,12 +1,12 @@
/*!
* Sizzle CSS Selector Engine v2.3.3
* Sizzle CSS Selector Engine v2.3.4
* https://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Copyright JS Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
* https://js.foundation/
*
* Date: 2016-08-08
* Date: 2019-04-08
*/
(function( window ) {

@@ -40,6 +40,7 @@ var i,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
nonnativeSelectorCache = createCache(),
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
@@ -101,8 +102,7 @@ var i,

rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),

rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
rdescend = new RegExp( whitespace + "|>" ),

rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
@@ -123,6 +123,7 @@ var i,
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},

rhtml = /HTML$/i,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,

@@ -177,9 +178,9 @@ var i,
setDocument();
},

disabledAncestor = addCombinator(
inDisabledFieldset = addCombinator(
function( elem ) {
return elem.disabled === true && ("form" in elem || "label" in elem);
return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
},
{ dir: "parentNode", next: "legend" }
);
@@ -292,18 +293,22 @@ function Sizzle( selector, context, results, seed ) {

// Take advantage of querySelectorAll
if ( support.qsa &&
!compilerCache[ selector + " " ] &&
(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {

if ( nodeType !== 1 ) {
newContext = context;
newSelector = selector;
!nonnativeSelectorCache[ selector + " " ] &&
(!rbuggyQSA || !rbuggyQSA.test( selector )) &&

// qSA looks outside Element context, which is not what we want
// Thanks to Andrew Dupont for this workaround technique
// Support: IE <=8
// Support: IE 8 only
// 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
if ( (nid = context.getAttribute( "id" )) ) {
@@ -325,17 +330,16 @@ function Sizzle( selector, context, results, seed ) {
context;
}

if ( newSelector ) {
try {
push.apply( results,
newContext.querySelectorAll( newSelector )
);
return results;
} catch ( qsaError ) {
} finally {
if ( nid === expando ) {
context.removeAttribute( "id" );
}
try {
push.apply( results,
newContext.querySelectorAll( newSelector )
);
return results;
} catch ( qsaError ) {
nonnativeSelectorCache( selector, true );
} finally {
if ( nid === expando ) {
context.removeAttribute( "id" );
}
}
}
@@ -499,7 +503,7 @@ function createDisabledPseudo( disabled ) {
// Where there is no isDisabled, check manually
/* jshint -W018 */
elem.isDisabled !== !disabled &&
disabledAncestor( elem ) === disabled;
inDisabledFieldset( elem ) === disabled;
}

return elem.disabled === disabled;
@@ -556,10 +560,13 @@ support = Sizzle.support = {};
* @returns {Boolean} True iff elem is a non-HTML XML node
*/
isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
var namespace = elem.namespaceURI,
docElem = (elem.ownerDocument || elem).documentElement;

// 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 );
}

// Make sure that attribute selectors are quoted
expr = expr.replace( rattributeQuotes, "='$1']" );

if ( support.matchesSelector && documentIsHTML &&
!compilerCache[ expr + " " ] &&
!nonnativeSelectorCache[ expr + " " ] &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {

@@ -999,7 +1003,9 @@ Sizzle.matchesSelector = function( elem, expr ) {
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch (e) {}
} catch (e) {
nonnativeSelectorCache( expr, true );
}
}

return Sizzle( expr, document, null, [ elem ] ).length > 0;
@@ -1458,7 +1464,7 @@ Expr = Sizzle.selectors = {
"contains": markFunction(function( text ) {
text = text.replace( runescape, funescape );
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 ) {
var i = argument < 0 ? argument + length : argument;
var i = argument < 0 ?
argument + length :
argument > length ?
length :
argument;
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
Oops, something went wrong.

0 comments on commit d940bc0

Please sign in to comment.
You can’t perform that action at this time.