Fix some getSelectionRects edge cases

getSelectionBoundingRect wasn't using the focusNode fallback
from getSelectionRects so factor that out and use in both.

Fix the fallback to work when the focusNode is a text node (traverse
up to the nearest element node).

Change-Id: I4b14f4a20a6eb13748f1ba874065b8fc2623d870
Merge "Fix some getSelectionRects edge cases"