Update for src and href attribute selectors fix
[jquery.git] / src / selector / selector.js
index b8f0cb3..a6597f4 100644 (file)
@@ -59,7 +59,7 @@ jQuery.extend({
                        _resort: function(m){
                                return ["", m[1], m[3], m[2], m[5]];
                        },
-                       _prefix: "z=a[m[3]]||jQuery.attr(a,m[3]);"
+                       _prefix: "z=a[m[3]];if(!z||/href|src/.test(m[3]))z=jQuery.attr(a,m[3]);"
                },
                "[": "jQuery.find(m[2],a).length"
        },
@@ -85,7 +85,7 @@ jQuery.extend({
                /^(\+)/, "jQuery.nth(a,2,'nextSibling')",
                /^(~)/, function(a){
                        var s = jQuery.sibling(a.parentNode.firstChild);
-                       return s.slice(0, jQuery.inArray(a,s));
+                       return s.slice(jQuery.inArray(a,s) + 1);
                }
        ],