X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fselector.js;h=607fa619ae28848e10216faa0ddb255a3855b735;hb=ab551c2b14ac6b0511cf3da10ca224ce461a0f10;hp=7840442da31a75f9dc35be5c9d60b0f7195768c4;hpb=3f5ff3097c315456fe92c9b1e4578590e1eb8648;p=jquery.git diff --git a/src/selector.js b/src/selector.js index 7840442..607fa61 100644 --- a/src/selector.js +++ b/src/selector.js @@ -68,7 +68,7 @@ jQuery.extend({ // The regular expressions that power the parsing engine parse: [ // Match: [@value='test'], [@foo] - /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, + /^(\[) *@?([\w:-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, // Match: :contains('foo') /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, @@ -92,7 +92,7 @@ jQuery.extend({ find: function( t, context ) { // Quickly handle non-string expressions - if ( typeof t != "string" ) + if ( typeof t !== "string" ) return [ t ]; // check to make sure context is a DOM element or a document @@ -214,7 +214,7 @@ jQuery.extend({ // Do a quick check for the existence of the actual ID attribute // to avoid selecting by the name attribute in IE // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form - if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] ) + if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id === "string" && oid.id != m[2] ) oid = jQuery('[@id="'+m[2]+'"]', elem)[0]; // Do a quick check for node name (where applicable) so @@ -336,7 +336,7 @@ jQuery.extend({ for ( var i = 0, rl = r.length; i < rl; i++ ) { var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ]; - if ( z == null || /href|src|selected/.test(m[2]) ) + if ( z == null || /style|href|src|selected/.test(m[2]) ) z = jQuery.attr(a,m[2]) || ''; if ( (type == "" && !!z || @@ -391,10 +391,10 @@ jQuery.extend({ // Otherwise, find the expression to execute } else { var fn = jQuery.expr[ m[1] ]; - if ( typeof fn == "object" ) + if ( typeof fn === "object" ) fn = fn[ m[2] ]; - if ( typeof fn == "string" ) + if ( typeof fn === "string" ) fn = eval("false||function(a,i){return " + fn + ";}"); // Execute it against the current filter