function _populateTreeFromDom( dom, parentNode, callback ) {
      var children = dom.children;
      var child;
      for ( var i = 0, len = children.length; i < len; i++ ) {
        var newParentNode = parentNode;
        child = children[i];
        newParentNode = callback.call( this, child, newParentNode );
        _populateTreeFromDom( child, newParentNode, callback );
      }
    }
/**
     * Perform a recursive depth-first search of the DOM
     * and call a function for each node.
     * @param {HTMLNode} dom - A DOM element to search from.
     * @param {TreeNode} parentNode
     *   Node in a tree from which to attach new nodes.
     * @param {Function} callback - Function to call on each node.
     *   Must return a TreeNode.
     */
Perform a recursive depth-first search of the DOM
and call a function for each node.
@param {HTMLNode} dom - A DOM element to search from.
@param {TreeNode} parentNode
Node in a tree from which to attach new nodes.
@param {Function} callback - Function to call on each node.
Must return a TreeNode.
Perform a recursive depth - first search of the DOM and call a function for each node . @param { HTMLNode } dom - A DOM element to search from . @param { TreeNode } parentNode Node in a tree from which to attach new nodes . @param { Function } callback - Function to call on each node . Must return a TreeNode .
function _populateTreeFromDom( dom, parentNode, callback ) {
      var children = dom.children;
      var child;
      for ( var i = 0, len = children.length; i < len; i++ ) {
        var newParentNode = parentNode;
        child = children[i];
        newParentNode = callback.call( this, child, newParentNode );
        _populateTreeFromDom( child, newParentNode, callback );
      }
    }
function _populateTreeFromDom ( dom , parentNode , callback ) { var children = dom . children ; var child ; for ( var i = 0 , len = children . length ; i < len ; i ++ ) { var newParentNode = parentNode ; child = children [ i ] ; newParentNode = callback . call ( this , child , newParentNode ) ; _populateTreeFromDom ( child , newParentNode , callback ) ; } }
Perform a recursive depth-first search of the DOM
 and call a function for each node.
Perform a recursive depth - first search of the DOM and call a function for each node .