// Match: :even, :last-chlid, #id, .class
new RegExp("^([:.#]*)(" +
- ( jQuery.chars = jQuery.browser.safari && jQuery.browser.version < 416.12 ? "(?:[\\w*_-]|\\\\.)" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)" ) + "+)")
+ ( jQuery.chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ? "(?:[\\w*_-]|\\\\.)" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)" ) + "+)")
],
multiFilter: function( expr, elems, not ) {
// Handle the common XPath // expression
if ( !t.indexOf("//") ) {
- context = context.documentElement;
+ //context = context.documentElement;
t = t.substr(2,t.length);
// And the / root expression
if ( t.indexOf(" ") == 0 ) continue;
foundToken = true;
} else {
- re = /^((\/?\.\.)|([>\/+~]))\s*([a-z]*)/i;
+ re = /^((\/?\.\.)|([>\/+~]))\s*(\w*)/i;
if ( (m = re.exec(t)) != null ) {
r = [];
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]);
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 ||