2010-05-03 Abhishek Arya <inferno@chromium.org>
[WebKit-https.git] / LayoutTests / inspector / elements-tests.js
1 // Frontend functions.
2
3 function frontend_expandDOMSubtree(node)
4 {
5     function processChildren(children)
6     {
7        for (var i = 0; children && i < children.length; ++i)
8            frontend_expandDOMSubtree(children[i]);
9     }
10     WebInspector.domAgent.getChildNodesAsync(node, processChildren);
11 }
12
13 function frontend_nodeForId(idValue)
14 {
15     var innerMapping = WebInspector.domAgent._idToDOMNode;
16     for (var nodeId in innerMapping) {
17         var node = innerMapping[nodeId];
18         if (node.getAttribute("id") === idValue)
19             return node;
20     }
21     return null;
22 }