}
}
}
+
+ return results;
};
Sizzle.matches = function(expr, set){
} else if ( name === "not" ) {
var not = match[3];
- for ( i = 0, l = not.length; i < l; i++ ) {
+ for ( var i = 0, l = not.length; i < l; i++ ) {
if ( not[i] === elem ) {
return false;
}
}
var makeArray = function(array, results) {
- array = Array.prototype.slice.call( array );
+ array = Array.prototype.slice.call( array, 0 );
if ( results ) {
results.push.apply( results, array );
// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
try {
- Array.prototype.slice.call( document.documentElement.childNodes );
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
// Provide a fallback method if it does not work
} catch(e){
if ( document.documentElement.compareDocumentPosition ) {
sortOrder = function( a, b ) {
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ }
+
var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
if ( ret === 0 ) {
hasDuplicate = true;
};
} else if ( "sourceIndex" in document.documentElement ) {
sortOrder = function( a, b ) {
+ if ( !a.sourceIndex || !b.sourceIndex ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ }
+
var ret = a.sourceIndex - b.sourceIndex;
if ( ret === 0 ) {
hasDuplicate = true;
};
} else if ( document.createRange ) {
sortOrder = function( a, b ) {
+ if ( !a.ownerDocument || !b.ownerDocument ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ }
+
var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
aRange.selectNode(a);
aRange.collapse(true);
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
-
-Sizzle.selectors.filters.hidden = function(elem){
- var width = elem.offsetWidth, height = elem.offsetHeight,
- force = /^tr$/i.test( elem.nodeName ); // ticket #4512
- return ( width === 0 && height === 0 && !force ) ?
- true :
- ( width !== 0 && height !== 0 && !force ) ?
- false :
- !!( jQuery.curCSS(elem, "display") === "none" );
-};
-
-Sizzle.selectors.filters.visible = function(elem){
- return !Sizzle.selectors.filters.hidden(elem);
-};
-
-Sizzle.selectors.filters.animated = function(elem){
- return jQuery.grep(jQuery.timers, function(fn){
- return elem === fn.elem;
- }).length;
-};
-
-jQuery.filter = jQuery.multiFilter = function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return Sizzle.matches(expr, elems);
-};
-
-jQuery.dir = function( elem, dir ){
- var matched = [], cur = elem[dir];
- while ( cur && cur != document ) {
- if ( cur.nodeType == 1 )
- matched.push( cur );
- cur = cur[dir];
- }
- return matched;
-};
-
-jQuery.nth = function(cur, result, dir, elem){
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] )
- if ( cur.nodeType == 1 && ++num == result )
- break;
-
- return cur;
-};
-
-jQuery.sibling = function(n, elem){
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType == 1 && n != elem )
- r.push( n );
- }
-
- return r;
-};
+jQuery.unique = Sizzle.uniqueSort;
return;