Selector: update Sizzle to 2.3.0

This commit is contained in:
Timmy Willison 2016-01-11 11:25:36 -05:00
parent fb9472c7fb
commit 5c4be05d3b
4 changed files with 158 additions and 84 deletions

View File

@ -1,12 +1,12 @@
/*! /*!
* Sizzle CSS Selector Engine v2.2.1 * Sizzle CSS Selector Engine v2.3.0
* http://sizzlejs.com/ * https://sizzlejs.com/
* *
* Copyright jQuery Foundation and other contributors * Copyright jQuery Foundation and other contributors
* Released under the MIT license * Released under the MIT license
* http://jquery.org/license * http://jquery.org/license
* *
* Date: 2015-10-17 * Date: 2016-01-04
*/ */
(function( window ) { (function( window ) {
@ -47,9 +47,6 @@ var i,
return 0; return 0;
}, },
// General-purpose constants
MAX_NEGATIVE = 1 << 31,
// Instance methods // Instance methods
hasOwn = ({}).hasOwnProperty, hasOwn = ({}).hasOwnProperty,
arr = [], arr = [],
@ -58,7 +55,7 @@ var i,
push = arr.push, push = arr.push,
slice = arr.slice, slice = arr.slice,
// Use a stripped-down indexOf as it's faster than native // Use a stripped-down indexOf as it's faster than native
// http://jsperf.com/thor-indexof-vs-for/5 // https://jsperf.com/thor-indexof-vs-for/5
indexOf = function( list, elem ) { indexOf = function( list, elem ) {
var i = 0, var i = 0,
len = list.length; len = list.length;
@ -78,7 +75,7 @@ var i,
whitespace = "[\\x20\\t\\r\\n\\f]", whitespace = "[\\x20\\t\\r\\n\\f]",
// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
@ -135,9 +132,9 @@ var i,
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rsibling = /[+~]/, rsibling = /[+~]/,
rescape = /'|\\/g,
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters // CSS escapes
// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
funescape = function( _, escaped, escapedWhitespace ) { funescape = function( _, escaped, escapedWhitespace ) {
var high = "0x" + escaped - 0x10000; var high = "0x" + escaped - 0x10000;
@ -153,13 +150,39 @@ var i,
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
}, },
// CSS string/identifier serialization
// https://drafts.csswg.org/cssom/#common-serializing-idioms
rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,
fcssescape = function( ch, asCodePoint ) {
if ( asCodePoint ) {
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
if ( ch === "\0" ) {
return "\uFFFD";
}
// Control characters and (dependent upon position) numbers get escaped as code points
return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
}
// Other potentially-special ASCII characters get backslash-escaped
return "\\" + ch;
},
// Used for iframes // Used for iframes
// See setDocument() // See setDocument()
// Removing the function wrapper causes a "Permission Denied" // Removing the function wrapper causes a "Permission Denied"
// error in IE // error in IE
unloadHandler = function() { unloadHandler = function() {
setDocument(); setDocument();
}; },
disabledAncestor = addCombinator(
function( elem ) {
return elem.disabled === true;
},
{ dir: "parentNode", next: "legend" }
);
// Optimize for push.apply( _, NodeList ) // Optimize for push.apply( _, NodeList )
try { try {
@ -191,7 +214,7 @@ try {
} }
function Sizzle( selector, context, results, seed ) { function Sizzle( selector, context, results, seed ) {
var m, i, elem, nid, nidselect, match, groups, newSelector, var m, i, elem, nid, match, groups, newSelector,
newContext = context && context.ownerDocument, newContext = context && context.ownerDocument,
// nodeType defaults to 9, since context defaults to document // nodeType defaults to 9, since context defaults to document
@ -284,7 +307,7 @@ function Sizzle( selector, context, results, seed ) {
// 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" )) ) {
nid = nid.replace( rescape, "\\$&" ); nid = nid.replace( rcssescape, fcssescape );
} else { } else {
context.setAttribute( "id", (nid = expando) ); context.setAttribute( "id", (nid = expando) );
} }
@ -292,9 +315,8 @@ function Sizzle( selector, context, results, seed ) {
// Prefix every selector in the list // Prefix every selector in the list
groups = tokenize( selector ); groups = tokenize( selector );
i = groups.length; i = groups.length;
nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
while ( i-- ) { while ( i-- ) {
groups[i] = nidselect + " " + toSelector( groups[i] ); groups[i] = "#" + nid + " " + toSelector( groups[i] );
} }
newSelector = groups.join( "," ); newSelector = groups.join( "," );
@ -355,22 +377,22 @@ function markFunction( fn ) {
/** /**
* Support testing using an element * Support testing using an element
* @param {Function} fn Passed the created div and expects a boolean result * @param {Function} fn Passed the created element and returns a boolean result
*/ */
function assert( fn ) { function assert( fn ) {
var div = document.createElement("div"); var el = document.createElement("fieldset");
try { try {
return !!fn( div ); return !!fn( el );
} catch (e) { } catch (e) {
return false; return false;
} finally { } finally {
// Remove from its parent by default // Remove from its parent by default
if ( div.parentNode ) { if ( el.parentNode ) {
div.parentNode.removeChild( div ); el.parentNode.removeChild( el );
} }
// release memory in IE // release memory in IE
div = null; el = null;
} }
} }
@ -397,8 +419,7 @@ function addHandle( attrs, handler ) {
function siblingCheck( a, b ) { function siblingCheck( a, b ) {
var cur = b && a, var cur = b && a,
diff = cur && a.nodeType === 1 && b.nodeType === 1 && diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
( ~b.sourceIndex || MAX_NEGATIVE ) - a.sourceIndex - b.sourceIndex;
( ~a.sourceIndex || MAX_NEGATIVE );
// Use IE sourceIndex if available on both nodes // Use IE sourceIndex if available on both nodes
if ( diff ) { if ( diff ) {
@ -439,6 +460,34 @@ function createButtonPseudo( type ) {
}; };
} }
/**
* Returns a function to use in pseudos for :enabled/:disabled
* @param {Boolean} disabled true for :disabled; false for :enabled
*/
function createDisabledPseudo( disabled ) {
// Known :disabled false positives:
// IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset)
// not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
return function( elem ) {
// Check form elements and option elements for explicit disabling
return "label" in elem && elem.disabled === disabled ||
"form" in elem && elem.disabled === disabled ||
// Check non-disabled form elements for fieldset[disabled] ancestors
"form" in elem && elem.disabled === false && (
// Support: IE6-11+
// Ancestry is covered for us
elem.isDisabled === disabled ||
// Otherwise, assume any non-<option> under fieldset[disabled] is disabled
/* jshint -W018 */
elem.isDisabled !== !disabled &&
("label" in elem || !disabledAncestor( elem )) !== disabled
);
};
}
/** /**
* Returns a function to use in pseudos for positionals * Returns a function to use in pseudos for positionals
* @param {Function} fn * @param {Function} fn
@ -491,7 +540,7 @@ isXML = Sizzle.isXML = function( elem ) {
* @returns {Object} Returns the current document * @returns {Object} Returns the current document
*/ */
setDocument = Sizzle.setDocument = function( node ) { setDocument = Sizzle.setDocument = function( node ) {
var hasCompare, parent, var hasCompare, subWindow,
doc = node ? node.ownerDocument || node : preferredDoc; doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected // Return early if doc is invalid or already selected
@ -506,14 +555,16 @@ setDocument = Sizzle.setDocument = function( node ) {
// Support: IE 9-11, Edge // Support: IE 9-11, Edge
// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
if ( (parent = document.defaultView) && parent.top !== parent ) { if ( preferredDoc !== document &&
// Support: IE 11 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
if ( parent.addEventListener ) {
parent.addEventListener( "unload", unloadHandler, false ); // Support: IE 11, Edge
if ( subWindow.addEventListener ) {
subWindow.addEventListener( "unload", unloadHandler, false );
// Support: IE 9 - 10 only // Support: IE 9 - 10 only
} else if ( parent.attachEvent ) { } else if ( subWindow.attachEvent ) {
parent.attachEvent( "onunload", unloadHandler ); subWindow.attachEvent( "onunload", unloadHandler );
} }
} }
@ -523,18 +574,18 @@ setDocument = Sizzle.setDocument = function( node ) {
// Support: IE<8 // Support: IE<8
// Verify that getAttribute really returns attributes and not properties // Verify that getAttribute really returns attributes and not properties
// (excepting IE8 booleans) // (excepting IE8 booleans)
support.attributes = assert(function( div ) { support.attributes = assert(function( el ) {
div.className = "i"; el.className = "i";
return !div.getAttribute("className"); return !el.getAttribute("className");
}); });
/* getElement(s)By* /* getElement(s)By*
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
// Check if getElementsByTagName("*") returns only elements // Check if getElementsByTagName("*") returns only elements
support.getElementsByTagName = assert(function( div ) { support.getElementsByTagName = assert(function( el ) {
div.appendChild( document.createComment("") ); el.appendChild( document.createComment("") );
return !div.getElementsByTagName("*").length; return !el.getElementsByTagName("*").length;
}); });
// Support: IE<9 // Support: IE<9
@ -542,10 +593,10 @@ setDocument = Sizzle.setDocument = function( node ) {
// Support: IE<10 // Support: IE<10
// Check if getElementById returns elements by name // Check if getElementById returns elements by name
// The broken getElementById methods don't pick up programatically-set names, // The broken getElementById methods don't pick up programmatically-set names,
// so use a roundabout getElementsByName test // so use a roundabout getElementsByName test
support.getById = assert(function( div ) { support.getById = assert(function( el ) {
docElem.appendChild( div ).id = expando; docElem.appendChild( el ).id = expando;
return !document.getElementsByName || !document.getElementsByName( expando ).length; return !document.getElementsByName || !document.getElementsByName( expando ).length;
}); });
@ -629,77 +680,87 @@ setDocument = Sizzle.setDocument = function( node ) {
// We allow this because of a bug in IE8/9 that throws an error // We allow this because of a bug in IE8/9 that throws an error
// whenever `document.activeElement` is accessed on an iframe // whenever `document.activeElement` is accessed on an iframe
// So, we allow :focus to pass through QSA all the time to avoid the IE error // So, we allow :focus to pass through QSA all the time to avoid the IE error
// See http://bugs.jquery.com/ticket/13378 // See https://bugs.jquery.com/ticket/13378
rbuggyQSA = []; rbuggyQSA = [];
if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
// Build QSA regex // Build QSA regex
// Regex strategy adopted from Diego Perini // Regex strategy adopted from Diego Perini
assert(function( div ) { assert(function( el ) {
// Select is set to empty string on purpose // Select is set to empty string on purpose
// This is to test IE's treatment of not explicitly // This is to test IE's treatment of not explicitly
// 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 // https://bugs.jquery.com/ticket/12359
docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
"<select id='" + expando + "-\r\\' msallowcapture=''>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" +
"<option selected=''></option></select>"; "<option selected=''></option></select>";
// Support: IE8, Opera 11-12.16 // 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 *=
// The test attribute must be unknown in Opera but "safe" for WinRT // The test attribute must be unknown in Opera but "safe" for WinRT
// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
if ( div.querySelectorAll("[msallowcapture^='']").length ) { if ( el.querySelectorAll("[msallowcapture^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
} }
// Support: IE8 // Support: IE8
// Boolean attributes and "value" are not treated correctly // Boolean attributes and "value" are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) { if ( !el.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
} }
// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
rbuggyQSA.push("~="); rbuggyQSA.push("~=");
} }
// Webkit/Opera - :checked should return selected option elements // Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests // IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":checked").length ) { if ( !el.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked"); rbuggyQSA.push(":checked");
} }
// Support: Safari 8+, iOS 8+ // Support: Safari 8+, iOS 8+
// https://bugs.webkit.org/show_bug.cgi?id=136851 // https://bugs.webkit.org/show_bug.cgi?id=136851
// In-page `selector#id sibing-combinator selector` fails // In-page `selector#id sibling-combinator selector` fails
if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
rbuggyQSA.push(".#.+[+~]"); rbuggyQSA.push(".#.+[+~]");
} }
}); });
assert(function( div ) { assert(function( el ) {
el.innerHTML = "<a href='' disabled='disabled'></a>" +
"<select disabled='disabled'><option/></select>";
// Support: Windows 8 Native Apps // Support: Windows 8 Native Apps
// The type and name attributes are restricted during .innerHTML assignment // The type and name attributes are restricted during .innerHTML assignment
var input = document.createElement("input"); var input = document.createElement("input");
input.setAttribute( "type", "hidden" ); input.setAttribute( "type", "hidden" );
div.appendChild( input ).setAttribute( "name", "D" ); el.appendChild( input ).setAttribute( "name", "D" );
// Support: IE8 // Support: IE8
// Enforce case-sensitivity of name attribute // Enforce case-sensitivity of name attribute
if ( div.querySelectorAll("[name=d]").length ) { if ( el.querySelectorAll("[name=d]").length ) {
rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
} }
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests // IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":enabled").length ) { if ( el.querySelectorAll(":enabled").length !== 2 ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Support: IE9-11+
// IE's :disabled selector does not pick up the children of disabled fieldsets
docElem.appendChild( el ).disabled = true;
if ( el.querySelectorAll(":disabled").length !== 2 ) {
rbuggyQSA.push( ":enabled", ":disabled" ); rbuggyQSA.push( ":enabled", ":disabled" );
} }
// Opera 10-11 does not throw on post-comma invalid pseudos // Opera 10-11 does not throw on post-comma invalid pseudos
div.querySelectorAll("*,:x"); el.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:"); rbuggyQSA.push(",.*:");
}); });
} }
@ -710,14 +771,14 @@ setDocument = Sizzle.setDocument = function( node ) {
docElem.oMatchesSelector || docElem.oMatchesSelector ||
docElem.msMatchesSelector) )) ) { docElem.msMatchesSelector) )) ) {
assert(function( div ) { assert(function( el ) {
// Check to see if it's possible to do matchesSelector // Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9) // on a disconnected node (IE 9)
support.disconnectedMatch = matches.call( div, "div" ); support.disconnectedMatch = matches.call( el, "*" );
// This should fail with an exception // This should fail with an exception
// Gecko does not error, returns false instead // Gecko does not error, returns false instead
matches.call( div, "[s!='']:x" ); matches.call( el, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos ); rbuggyMatches.push( "!=", pseudos );
}); });
} }
@ -919,6 +980,10 @@ Sizzle.attr = function( elem, name ) {
null; null;
}; };
Sizzle.escape = function( sel ) {
return (sel + "").replace( rcssescape, fcssescape );
};
Sizzle.error = function( msg ) { Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg ); throw new Error( "Syntax error, unrecognized expression: " + msg );
}; };
@ -1386,13 +1451,8 @@ Expr = Sizzle.selectors = {
}, },
// Boolean properties // Boolean properties
"enabled": function( elem ) { "enabled": createDisabledPseudo( false ),
return elem.disabled === false; "disabled": createDisabledPseudo( true ),
},
"disabled": function( elem ) {
return elem.disabled === true;
},
"checked": function( elem ) { "checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements // In CSS3, :checked should return both checked and selected elements
@ -1594,7 +1654,9 @@ function toSelector( tokens ) {
function addCombinator( matcher, combinator, base ) { function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir, var dir = combinator.dir,
checkNonElements = base && dir === "parentNode", skip = combinator.next,
key = skip || dir,
checkNonElements = base && key === "parentNode",
doneName = done++; doneName = done++;
return combinator.first ? return combinator.first ?
@ -1630,14 +1692,16 @@ function addCombinator( matcher, combinator, base ) {
// Defend against cloned attroperties (jQuery gh-1709) // Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
if ( (oldCache = uniqueCache[ dir ]) && if ( skip && skip === elem.nodeName.toLowerCase() ) {
elem = elem[ dir ] || elem;
} else if ( (oldCache = uniqueCache[ key ]) &&
oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
// Assign to newCache so results back-propagate to previous elements // Assign to newCache so results back-propagate to previous elements
return (newCache[ 2 ] = oldCache[ 2 ]); return (newCache[ 2 ] = oldCache[ 2 ]);
} else { } else {
// Reuse newcache so results back-propagate to previous elements // Reuse newcache so results back-propagate to previous elements
uniqueCache[ dir ] = newCache; uniqueCache[ key ] = newCache;
// A match means we're done; a fail means we have to keep checking // A match means we're done; a fail means we have to keep checking
if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
@ -2080,17 +2144,17 @@ setDocument();
// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
// Detached nodes confoundingly follow *each other* // Detached nodes confoundingly follow *each other*
support.sortDetached = assert(function( div1 ) { support.sortDetached = assert(function( el ) {
// Should return 1, but returns 4 (following) // Should return 1, but returns 4 (following)
return div1.compareDocumentPosition( document.createElement("div") ) & 1; return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
}); });
// Support: IE<8 // Support: IE<8
// Prevent attribute/property "interpolation" // Prevent attribute/property "interpolation"
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !assert(function( div ) { if ( !assert(function( el ) {
div.innerHTML = "<a href='#'></a>"; el.innerHTML = "<a href='#'></a>";
return div.firstChild.getAttribute("href") === "#" ; return el.firstChild.getAttribute("href") === "#" ;
}) ) { }) ) {
addHandle( "type|href|height|width", function( elem, name, isXML ) { addHandle( "type|href|height|width", function( elem, name, isXML ) {
if ( !isXML ) { if ( !isXML ) {
@ -2101,10 +2165,10 @@ if ( !assert(function( div ) {
// Support: IE<9 // Support: IE<9
// Use defaultValue in place of getAttribute("value") // Use defaultValue in place of getAttribute("value")
if ( !support.attributes || !assert(function( div ) { if ( !support.attributes || !assert(function( el ) {
div.innerHTML = "<input/>"; el.innerHTML = "<input/>";
div.firstChild.setAttribute( "value", "" ); el.firstChild.setAttribute( "value", "" );
return div.firstChild.getAttribute( "value" ) === ""; return el.firstChild.getAttribute( "value" ) === "";
}) ) { }) ) {
addHandle( "value", function( elem, name, isXML ) { addHandle( "value", function( elem, name, isXML ) {
if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
@ -2115,8 +2179,8 @@ if ( !support.attributes || !assert(function( div ) {
// Support: IE<9 // Support: IE<9
// Use getAttributeNode to fetch booleans when getAttribute lies // Use getAttributeNode to fetch booleans when getAttribute lies
if ( !assert(function( div ) { if ( !assert(function( el ) {
return div.getAttribute("disabled") == null; return el.getAttribute("disabled") == null;
}) ) { }) ) {
addHandle( booleans, function( elem, name, isXML ) { addHandle( booleans, function( elem, name, isXML ) {
var val; var val;
@ -2130,6 +2194,16 @@ if ( !assert(function( div ) {
} }
// EXPOSE // EXPOSE
var _sizzle = window.Sizzle;
Sizzle.noConflict = function() {
if ( window.Sizzle === Sizzle ) {
window.Sizzle = _sizzle;
}
return Sizzle;
};
if ( typeof define === "function" && define.amd ) { if ( typeof define === "function" && define.amd ) {
define(function() { return Sizzle; }); define(function() { return Sizzle; });
// Sizzle requires that there be a global window in Common-JS like environments // Sizzle requires that there be a global window in Common-JS like environments

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,7 @@
"qunit-assert-step": "1.0.3", "qunit-assert-step": "1.0.3",
"requirejs": "2.1.17", "requirejs": "2.1.17",
"sinon": "1.10.3", "sinon": "1.10.3",
"sizzle": "2.2.1", "sizzle": "2.3.0",
"strip-json-comments": "1.0.3", "strip-json-comments": "1.0.3",
"testswarm": "1.1.0", "testswarm": "1.1.0",
"win-spawn": "2.0.0" "win-spawn": "2.0.0"