docs: function(method, restoreScrollPosition) {
        var win = this.doc.defaultView || this.doc.parentWindow,
            sel = rangy.saveSelection(win);
  
        if (!sel) {
          method();
        } else {
          try {
            method();
          } catch(e) {
            setTimeout(function() { throw e; }, 0);
          }
        }
        rangy.restoreSelection(sel);
      }