InputEvent.getTargetRanges()
This returns a list of ranges that would be affected by a change to the DOM if the input event is not cancelled.