dom-deprecated-debug.js revision 43d14a760e0c8e57931be96b58b85e1e9fda778c
YUI.add('dom-deprecated', function(Y) {
Y.mix(Y.DOM, {
// @deprecated
children: function(node, tag) {
var ret = [];
if (node) {
tag = tag || '*';
ret = Y.Selector.query('> ' + tag, node);
}
return ret;
},
// @deprecated
firstByTag: function(tag, root) {
var ret;
root = root || Y.config.doc;
if (tag && root.getElementsByTagName) {
ret = root.getElementsByTagName(tag)[0];
}
return ret || null;
},
/*
* Finds the previous sibling of the element.
* @method previous
* @deprecated Use elementByAxis
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current DOM node being tested as its only argument.
* If no function is given, the first sibling is returned.
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
* @return {HTMLElement | null} The matching DOM node or null if none found.
*/
previous: function(element, fn, all) {
return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);
},
/*
* Finds the next sibling of the element.
* @method next
* @deprecated Use elementByAxis
* @param {HTMLElement} element The html element.
* @param {Function} fn optional An optional boolean test to apply.
* The optional function is passed the current DOM node being tested as its only argument.
* If no function is given, the first sibling is returned.
* @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
* @return {HTMLElement | null} The matching DOM node or null if none found.
*/
next: function(element, fn, all) {
return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);
}
});
}, '@VERSION@' ,{requires:['dom-base']});