Detect document focus properly and allow null selection in model

The document is considered to be focused when it or its pasteTarget
has a native range. When it doesn't, the DM selection should be null.

Bug: 59868
Change-Id: I130dd0790fe07d47ffe92c1451c43ff92415b2e3
Merge "Detect document focus properly and allow null selection in model"