X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fselector.js;h=fb332465df18eb235a85b7f4920171f2ac1c805b;hb=d1285504fb636a077ae5b1e53e35959cc7faebc7;hp=1f3ceb5c1fb32ca78b4432bbd53cccd91e9042f1;hpb=bbf3334db107abf72cbb3247b68b7e40d9f2cdfe;p=jquery.git diff --git a/src/selector.js b/src/selector.js index 1f3ceb5..fb33246 100644 --- a/src/selector.js +++ b/src/selector.js @@ -332,7 +332,7 @@ var Expr = Sizzle.selectors = { "": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; - if ( !part.match(/\W/) ) { + if ( !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } @@ -342,7 +342,7 @@ var Expr = Sizzle.selectors = { "~": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; - if ( typeof part === "string" && !part.match(/\W/) ) { + if ( typeof part === "string" && !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } @@ -435,7 +435,7 @@ var Expr = Sizzle.selectors = { PSEUDO: function(match, curLoop, inplace, result, not){ if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one - if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) { + if ( chunker.exec(match[3]).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); @@ -661,7 +661,7 @@ for ( var type in Expr.match ) { } 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 ); @@ -674,7 +674,7 @@ var makeArray = function(array, results) { // 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){ @@ -978,7 +978,7 @@ jQuery.expr[":"] = jQuery.expr.filters; Sizzle.selectors.filters.hidden = function(elem){ var width = elem.offsetWidth, height = elem.offsetHeight, - force = /^tr$/i.test( elem.tagName ); // ticket #4512 + force = /^tr$/i.test( elem.nodeName ); // ticket #4512 return ( width === 0 && height === 0 && !force ) ? true : ( width !== 0 && height !== 0 && !force ) ?