diff --git a/src/modules/rangy-selectionsaverestore.js b/src/modules/rangy-selectionsaverestore.js index 9343daec..dcfa02bc 100644 --- a/src/modules/rangy-selectionsaverestore.js +++ b/src/modules/rangy-selectionsaverestore.js @@ -217,10 +217,10 @@ rangy.createModule("SaveRestore", ["WrappedSelection"], function(api, module) { for (var i = 0, len = rangeInfos.length, rangeInfo; i < len; ++i) { rangeInfo = rangeInfos[i]; if (rangeInfo.collapsed) { - removeMarkerElement(savedSelection.doc, rangeInfo.markerId); + removeMarkerElement(rangeInfo.document, rangeInfo.markerId); } else { - removeMarkerElement(savedSelection.doc, rangeInfo.startMarkerId); - removeMarkerElement(savedSelection.doc, rangeInfo.endMarkerId); + removeMarkerElement(rangeInfo.document, rangeInfo.startMarkerId); + removeMarkerElement(rangeInfo.document, rangeInfo.endMarkerId); } } }