X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fselector%2Fselector.js;h=04b68d3e20466a2a25f6c66ce684ac3e1a1d0e19;hb=38d74fe9122a0474221388084368ebbdd8c6f938;hp=e6d2d0697708677c271921601e6db3aa13fc7bdb;hpb=7b9d8258909a626f3f380c763ed81150570bbad5;p=jquery.git diff --git a/src/selector/selector.js b/src/selector/selector.js index e6d2d06..04b68d3 100644 --- a/src/selector/selector.js +++ b/src/selector/selector.js @@ -53,7 +53,7 @@ jQuery.extend({ // The regular expressions that power the parsing engine parse: [ // Match: [@value='test'], [@foo] - /^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/, + /^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, // Match: [div], [div p] /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/, @@ -63,7 +63,7 @@ jQuery.extend({ // Match: :even, :last-chlid, #id, .class new RegExp("^([:.#]*)(" + - ( jQuery.chars = "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)" ) + "+)") + ( jQuery.chars = jQuery.browser.safari && jQuery.browser.version < "3.0.0" ? "\\w" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)" ) + "+)") ], multiFilter: function( expr, elems, not ) { @@ -340,14 +340,14 @@ jQuery.extend({ var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ]; if ( z == null || /href|src/.test(m[2]) ) - z = jQuery.attr(a,m[2]); + z = jQuery.attr(a,m[2]) || ''; if ( (type == "" && !!z || type == "=" && z == m[5] || type == "!=" && z != m[5] || type == "^=" && z && !z.indexOf(m[5]) || type == "$=" && z.substr(z.length - m[5].length) == m[5] || - type == "*=" && z.indexOf(m[5]) >= 0) ^ not ) + (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not ) tmp.push( a ); } @@ -377,7 +377,7 @@ jQuery.extend({ var add = false; if ( first == 1 ) { - if ( node.nodeIndex == last ) + if ( last == 0 || node.nodeIndex == last ) add = true; } else if ( (node.nodeIndex + last) % first == 0 ) add = true;