2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
8 YUI.add('dom-deprecated', function(Y) {
13 children: function(node, tag) {
17 ret = Y.Selector.query('> ' + tag, node);
23 firstByTag: function(tag, root) {
25 root = root || Y.config.doc;
27 if (tag && root.getElementsByTagName) {
28 ret = root.getElementsByTagName(tag)[0];
35 * Finds the previous sibling of the element.
37 * @deprecated Use elementByAxis
38 * @param {HTMLElement} element The html element.
39 * @param {Function} fn optional An optional boolean test to apply.
40 * The optional function is passed the current DOM node being tested as its only argument.
41 * If no function is given, the first sibling is returned.
42 * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
43 * @return {HTMLElement | null} The matching DOM node or null if none found.
45 previous: function(element, fn, all) {
46 return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);
50 * Finds the next sibling of the element.
52 * @deprecated Use elementByAxis
53 * @param {HTMLElement} element The html element.
54 * @param {Function} fn optional An optional boolean test to apply.
55 * The optional function is passed the current DOM node being tested as its only argument.
56 * If no function is given, the first sibling is returned.
57 * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
58 * @return {HTMLElement | null} The matching DOM node or null if none found.
60 next: function(element, fn, all) {
61 return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);
68 }, '3.3.0' ,{requires:['dom-base']});