Merge branch 'MDL-32509' of git://github.com/danpoltawski/moodle
[moodle.git] / lib / yui / 3.5.0 / build / dom-deprecated / dom-deprecated-debug.js
blob6d55307952950375926b5906a66c5cfa63e9fc79
1 /*
2 YUI 3.5.0 (build 5089)
3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
7 YUI.add('dom-deprecated', function(Y) {
10 Y.mix(Y.DOM, {
11     // @deprecated
12     children: function(node, tag) {
13         var ret = [];
14         if (node) {
15             tag = tag || '*';
16             ret = Y.Selector.query('> ' + tag, node); 
17         }
18         return ret;
19     },
21     // @deprecated
22     firstByTag: function(tag, root) {
23         var ret;
24         root = root || Y.config.doc;
26         if (tag && root.getElementsByTagName) {
27             ret = root.getElementsByTagName(tag)[0];
28         }
30         return ret || null;
31     },
33     /*
34      * Finds the previous sibling of the element.
35      * @method previous
36      * @deprecated Use elementByAxis
37      * @param {HTMLElement} element The html element.
38      * @param {Function} fn optional An optional boolean test to apply.
39      * The optional function is passed the current DOM node being tested as its only argument.
40      * If no function is given, the first sibling is returned.
41      * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
42      * @return {HTMLElement | null} The matching DOM node or null if none found. 
43      */
44     previous: function(element, fn, all) {
45         return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);
46     },
48     /*
49      * Finds the next sibling of the element.
50      * @method next
51      * @deprecated Use elementByAxis
52      * @param {HTMLElement} element The html element.
53      * @param {Function} fn optional An optional boolean test to apply.
54      * The optional function is passed the current DOM node being tested as its only argument.
55      * If no function is given, the first sibling is returned.
56      * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes.
57      * @return {HTMLElement | null} The matching DOM node or null if none found. 
58      */
59     next: function(element, fn, all) {
60         return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);
61     }
63 });
67 }, '3.5.0' ,{requires:['dom-base']});