Ensure there is always a selection.

Many functions rely on there being a selection; if the browser doesn't return
one, make one up (collapsed, at beginning of document).