Skip to content

Commit

Permalink
Build: Update Sizzle from 2.3.3 to 2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mgol committed Apr 9, 2019
1 parent 00a9c2e commit 489c8b1
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 46 deletions.
2 changes: 1 addition & 1 deletion external/sizzle/LICENSE.txt
@@ -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
Expand Down
92 changes: 51 additions & 41 deletions external/sizzle/dist/sizzle.js
@@ -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 ) {

Expand Down Expand Up @@ -40,6 +40,7 @@ var i,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
nonnativeSelectorCache = createCache(),
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
Expand Down Expand Up @@ -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 + "$" ),
Expand All @@ -123,6 +123,7 @@ var i,
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},

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

Expand Down Expand Up @@ -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" }
);
Expand Down Expand Up @@ -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" )) ) {
Expand All @@ -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" );
}
}
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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" );
};

/**
Expand Down Expand Up @@ -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 ) ) ) {

Expand All @@ -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;
Expand Down Expand Up @@ -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;
};
}),

Expand Down Expand Up @@ -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 );
}
Expand Down

0 comments on commit 489c8b1

Please sign in to comment.