Rename getRelativeOffset to getBoundingRect and use in getSelectionRect

By return top/left/right/bottom we can simplify the calculations
in the one current use case.

It can also be used trivially in getSelectionRect.

Change-Id: Ia58afc145fecd5fb2bb07e2dd958eb1b7be112ea
Fallback to node position when getting selection rectangle

Another common case on get(Start|End)DocumentPos failing is when
you are inside an empty paragraph. If focusNode is an element, just
use the left/right border of the element bounding rectangle as the
cursor position (depending on directionality).

Bug: 69122
Change-Id: I3c5087dff981868a8c5919b580990d8ae899e3c3