X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fselector%2Fselector.js;h=5fc3e0ed9e7caee87577bac81174f459bd433794;hb=127c0b8a5d9ab35f9f0b91688a8ff7df45244977;hp=cf231111e81c61b159f49bff6fd7c79c79563ec6;hpb=46e770352a9d68fe72a2cf59fc2d18fe61669730;p=jquery.git diff --git a/src/selector/selector.js b/src/selector/selector.js index cf23111..5fc3e0e 100644 --- a/src/selector/selector.js +++ b/src/selector/selector.js @@ -58,6 +58,7 @@ jQuery.extend({ // :has() has: "jQuery.find(m[3],a).length" }, + // DEPRECATED "[": "jQuery.find(m[2],a).length" }, @@ -66,6 +67,7 @@ jQuery.extend({ // Match: [@value='test'], [@foo] /^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, + // DEPRECATED // Match: [div], [div p] /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/, @@ -107,11 +109,13 @@ jQuery.extend({ // Set the correct context (if none is provided) context = context || document; + // DEPRECATED // Handle the common XPath // expression if ( !t.indexOf("//") ) { //context = context.documentElement; t = t.substr(2,t.length); + // DEPRECATED // And the / root expression } else if ( !t.indexOf("/") && !context.ownerDocument ) { context = context.documentElement; @@ -129,6 +133,7 @@ jQuery.extend({ var r = []; last = t; + // DEPRECATED t = jQuery.trim(t).replace( /^\/\//, "" ); var foundToken = false; @@ -152,6 +157,7 @@ jQuery.extend({ if ( t.indexOf(" ") == 0 ) continue; foundToken = true; } else { + // (.. and /) DEPRECATED re = /^((\/?\.\.)|([>\/+~]))\s*(\w*)/i; if ( (m = re.exec(t)) != null ) { @@ -174,6 +180,7 @@ jQuery.extend({ if ( m == "+" ) break; } + // DEPRECATED } else r.push( ret[j].parentNode ); @@ -240,7 +247,7 @@ jQuery.extend({ // We need to find all descendant elements for ( var i = 0; ret[i]; i++ ) { // Grab the tag name being searched for - var tag = m[1] != "" || m[0] == "" ? "*" : m[2]; + var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2]; // Handle IE7 being really dumb about s if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" ) @@ -405,7 +412,7 @@ jQuery.extend({ f = jQuery.expr[m[1]][m[2]]; // Build a custom macro to enclose it - eval("f = function(a,i){return " + f + "}"); + f = eval("false||function(a,i){return " + f + "}"); // Execute it against the current filter r = jQuery.grep( r, f, not );