Showing with 74 additions and 47 deletions.
  1. +1 −1 bower.json
  2. +29 −16 dist/sizzle.js
  3. +2 −2 dist/sizzle.min.js
  4. +1 −1 dist/sizzle.min.map
  5. +1 −1 package.json
  6. +27 −14 src/sizzle.js
  7. +13 −12 test/unit/selector.js
@@ -1,6 +1,6 @@
{
"name": "sizzle",
"version": "2.0.1-pre",
"version": "2.1.1-pre",
"main": "./dist/sizzle.js",
"license": "MIT",
"ignore": [
@@ -1,12 +1,12 @@
/*!
* Sizzle CSS Selector Engine v2.1.0-pre
* Sizzle CSS Selector Engine v2.1.1-pre
* http://sizzlejs.com/
*
* Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-12-01
* Date: 2014-12-12
*/
(function( window ) {

@@ -151,6 +151,14 @@ var i,
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
},

// Used for iframes
// See setDocument()
// Removing the function wrapper causes a "Permission Denied"
// error in IE
unloadHandler = function() {
setDocument();
};

// Optimize for push.apply( _, NodeList )
@@ -193,15 +201,16 @@ function Sizzle( selector, context, results, seed ) {

context = context || document;
results = results || [];
nodeType = context.nodeType;

if ( typeof selector !== "string" || !selector ||
nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {

if ( !selector || typeof selector !== "string" ) {
return results;
}

if ( !seed && documentIsHTML ) {
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 && nodeType !== 11 ) {
return [];
}

if ( documentIsHTML && !seed ) {

// Try to shortcut find operations when possible (e.g., not under DocumentFragment)
if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
@@ -477,13 +486,9 @@ setDocument = Sizzle.setDocument = function( node ) {
if ( parent && parent !== parent.top ) {
// IE11 does not have attachEvent, so all must suffer
if ( parent.addEventListener ) {
parent.addEventListener( "unload", function() {
setDocument();
}, false );
parent.addEventListener( "unload", unloadHandler, false );
} else if ( parent.attachEvent ) {
parent.attachEvent( "onunload", function() {
setDocument();
});
parent.attachEvent( "onunload", unloadHandler );
}
}

@@ -616,8 +621,9 @@ setDocument = Sizzle.setDocument = function( node ) {
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select msallowcapture=''>" +
"<option id='d\f]' selected=''></option></select>";
docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
"<select id='" + expando + "-\f]' msallowcapture=''>" +
"<option selected=''></option></select>";

// Support: IE8, Opera 11-12.16
// Nothing should be selected when empty strings follow ^= or $= or *=
@@ -634,7 +640,7 @@ setDocument = Sizzle.setDocument = function( node ) {
}

// Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
if ( !div.querySelectorAll("[id~=d]").length ) {
if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
rbuggyQSA.push("~=");
}

@@ -644,6 +650,13 @@ setDocument = Sizzle.setDocument = function( node ) {
if ( !div.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked");
}

// Support: Safari 8+, iOS 8+
// https://bugs.webkit.org/show_bug.cgi?id=136851
// In-page `selector#id sibing-combinator selector` fails
if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
rbuggyQSA.push(".#.+[+~]");
}
});

assert(function( div ) {