function clearSelectionAndRestoreSaved(parent, saved) {
  Range.clearSelection();
  assertFalse(Range.hasSelection(window));
  const range = saved.restore();
  assertTrue(Range.hasSelection(window));
  return range;
}
Clear the selection by re-parsing the DOM. Then restore the saved
selection.
@param {Node} parent The node containing the current selection.
@param {dom.SavedRange} saved The saved range.
@return {dom.AbstractRange} Restored range.