Set selection before focusing document

Otherwise the selection is momentarily reset and the
page scrolls to the top.

Bug: 68589
Bug: 68708
Change-Id: I7151c00a90312fb127ebf2120383c19b771ef6c7
Merge "Set selection before focusing document"