Check that the surface has a selection after focus

This happens in Chrome when the document starts with a figure,
although at the moment this is always masked by slugs.

Change-Id: I375c6de87a0795217e5e1348700ebad294c0bcda