If the anchor and focus nodes are not within the same document, we can't use them for a selection range. Found by Domato. (cherry picked from commit 416c4788763baa778465d1d004080d322462c0bf)