function _mapDocumentToSource(source) {
        var node = exports.root;
        DOMHelpers.eachNode(source, function each(payload) {
            if (!node) {
                return true;
            }
            if (payload.closing) {
                var parent = node.findParentForNextNodeMatchingPayload(payload);
                if (!parent) {
                    return console.warn("Matching Parent not at " + payload.sourceOffset + " (" + payload.nodeName + ")");
                }
                parent.closeLocation = payload.sourceOffset;
                parent.closeLength = payload.sourceLength;
            } else {
                var next = node.findNextNodeMatchingPayload(payload);
                if (!next) {
                    return console.warn("Skipping Source Node at " + payload.sourceOffset);
                }
                node = next;
                node.location = payload.sourceOffset;
                node.length = payload.sourceLength;
                if (payload.closed) {
                    node.closed = payload.closed;
                }
            }
        });
    }
function _mapDocumentToSource(source) {
        var node = exports.root;
        DOMHelpers.eachNode(source, function each(payload) {
            if (!node) {
                return true;
            }
            if (payload.closing) {
                var parent = node.findParentForNextNodeMatchingPayload(payload);
                if (!parent) {
                    return console.warn("Matching Parent not at " + payload.sourceOffset + " (" + payload.nodeName + ")");
                }
                parent.closeLocation = payload.sourceOffset;
                parent.closeLength = payload.sourceLength;
            } else {
                var next = node.findNextNodeMatchingPayload(payload);
                if (!next) {
                    return console.warn("Skipping Source Node at " + payload.sourceOffset);
                }
                node = next;
                node.location = payload.sourceOffset;
                node.length = payload.sourceLength;
                if (payload.closed) {
                    node.closed = payload.closed;
                }
            }
        });
    }
function _mapDocumentToSource ( source ) { var node = exports . root ; DOMHelpers . eachNode ( source , function each ( payload ) { if ( ! node ) { return true ; } if ( payload . closing ) { var parent = node . findParentForNextNodeMatchingPayload ( payload ) ; if ( ! parent ) { return console . warn ( "Matching Parent not at " + payload . sourceOffset + " (" + payload . nodeName + ")" ) ; } parent . closeLocation = payload . sourceOffset ; parent . closeLength = payload . sourceLength ; } else { var next = node . findNextNodeMatchingPayload ( payload ) ; if ( ! next ) { return console . warn ( "Skipping Source Node at " + payload . sourceOffset ) ; } node = next ; node . location = payload . sourceOffset ; node . length = payload . sourceLength ; if ( payload . closed ) { node . closed = payload . closed ; } } } ) ; }
Map the DOM document to the source text
@param {string} source
Map the DOM document to the source text
map document to source