X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fselector%2Fselector.js;h=f75bae3c4756fe80d0d8c98ecd17269bc098a576;hb=346ceacce3fb6f83701d742ce0835d4db0ba98aa;hp=bd8c7912d9ab0f8cb0d6a1791e81189173fe5caa;hpb=f2f399dcd552e73f68c9e8adfe26ef7995724cb3;p=jquery.git diff --git a/src/selector/selector.js b/src/selector/selector.js index bd8c791..f75bae3 100644 --- a/src/selector/selector.js +++ b/src/selector/selector.js @@ -56,8 +56,12 @@ jQuery.extend({ input: "/input|select|textarea|button/i.test(a.nodeName)", // :has() - has: "jQuery.find(m[3],a).length" + has: "jQuery.find(m[3],a).length", + + // :header + header: "/h\\d/i.test(a.nodeName)" }, + // DEPRECATED "[": "jQuery.find(m[2],a).length" }, @@ -66,6 +70,7 @@ jQuery.extend({ // Match: [@value='test'], [@foo] /^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, + // DEPRECATED // Match: [div], [div p] /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/, @@ -107,11 +112,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 +136,7 @@ jQuery.extend({ var r = []; last = t; + // DEPRECATED t = jQuery.trim(t).replace( /^\/\//, "" ); var foundToken = false; @@ -152,6 +160,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 +183,7 @@ jQuery.extend({ if ( m == "+" ) break; } + // DEPRECATED } else r.push( ret[j].parentNode ); @@ -240,7 +250,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" )