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"
},
// Match: [@value='test'], [@foo]
/^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
+ // DEPRECATED
// Match: [div], [div p]
/^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,
return cur;
},
- /**
- * @name $.find
- * @type Array<Element>
- * @private
- * @cat Core
- */
find: function( t, context ) {
// Quickly handle non-string expressions
if ( typeof t != "string" )
// 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;
var r = [];
last = t;
+ // DEPRECATED
t = jQuery.trim(t).replace( /^\/\//, "" );
var foundToken = false;
if ( t.indexOf(" ") == 0 ) continue;
foundToken = true;
} else {
+ // (.. and /) DEPRECATED
re = /^((\/?\.\.)|([>\/+~]))\s*(\w*)/i;
if ( (m = re.exec(t)) != null ) {
if ( m == "+" ) break;
}
+ // DEPRECATED
} else
r.push( ret[j].parentNode );
// 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 <object>s
if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
return { r: r, t: t };
},
- /**
- * All ancestors of a given element.
- *
- * @private
- * @name $.parents
- * @type Array<Element>
- * @param Element elem The element to find the ancestors of.
- * @cat DOM/Traversing
- */
parents: function( elem ){
var matched = [];
var cur = elem.parentNode;
return matched;
},
- /**
- * A handy, and fast, way to traverse in a particular direction and find
- * a specific element.
- *
- * @private
- * @name $.nth
- * @type DOMElement
- * @param DOMElement cur The element to search from.
- * @param String|Number num The Nth result to match. Can be a number or a string (like 'even' or 'odd').
- * @param String dir The direction to move in (pass in something like 'previousSibling' or 'nextSibling').
- * @cat DOM/Traversing
- */
nth: function(cur,result,dir,elem){
result = result || 1;
var num = 0;
return cur;
},
- /**
- * All elements on a specified axis.
- *
- * @private
- * @name $.sibling
- * @type Array
- * @param Element elem The element to find all the siblings of (including itself).
- * @cat DOM/Traversing
- */
sibling: function( n, elem ) {
var r = [];