Complete overhaul of the Ajax test suite, it's now passing in all browsers. In order...
[jquery.git] / src / selector / selector.js
index b574fa9..34aaf61 100644 (file)
@@ -99,7 +99,7 @@ jQuery.extend({
 
                // Handle the common XPath // expression
                if ( !t.indexOf("//") ) {
-                       context = context.documentElement;
+                       //context = context.documentElement;
                        t = t.substr(2,t.length);
 
                // And the / root expression
@@ -213,7 +213,7 @@ jQuery.extend({
                                        var elem = ret[ret.length-1];
 
                                        // Try to do a global search by ID, where we can
-                                       if ( m[1] == "#" && elem && elem.getElementById ) {
+                                       if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
                                                // Optimization for HTML document case
                                                var oid = elem.getElementById(m[2]);
                                                
@@ -339,7 +339,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/.test(m[2]) )
+                                       if ( z == null || /href|src|selected/.test(m[2]) )
                                                z = jQuery.attr(a,m[2]) || '';
 
                                        if ( (type == "" && !!z ||