code: function History(container, maxDepth, commitDelay, editor) {
    this.container = container;
    this.maxDepth = maxDepth; this.commitDelay = commitDelay;
    this.editor = editor; this.parent = editor.parent;
    // This line object represents the initial, empty editor.
    var initial = {text: "", from: null, to: null};
    // As the borders between lines are represented by BR elements, the
    // start of the first line and the end of the last one are
    // represented by null. Since you can not store any properties
    // (links to line objects) in null, these properties are used in
    // those cases.
    this.first = initial; this.last = initial;
    // Similarly, a 'historyTouched' property is added to the BR in
    // front of lines that have already been touched, and 'firstTouched'
    // is used for the first line.
    this.firstTouched = false;
    // History is the set of committed changes, touched is the set of
    // nodes touched since the last commit.
    this.history = []; this.redoHistory = []; this.touched = [];
  }
docs: A history object needs to know about the DOM container holding the document, the maximum amount of undo levels it should store, the delay (of no input) after which it commits a set of changes, and, unfortunately, the 'parent' window -- a window that is not in designMode, and on which setTimeout works in every browser.