function walk(node) {
            if (node.tagID) {
                nodeMap[node.tagID] = node;
            }
            if (node.isElement()) {
                node.children.forEach(walk);
            }
        }
@private
Creates a map from tagIDs to nodes in the given HTMLSimpleDOM subtree and
stores it on the root.
@param {Object} root The root of an HTMLSimpleDOM tree.