This page demos detecting the selection range within a shadow root, for Safari, which does not yet support ShadowRoot.getSelection.
(It still works in Chrome, it just uses the native version.)
Open the console to see output—the blue outline is the first root, and the red is the inner root.
TODOs
Dragging right onto non-text nodes sometimes selects both, see the images below.
We should select the furthest possible parent when we select the extent of l/r on text nodes.
In Chrome, selecting just entire 2nd root shows a selection in the 1st root just over that subnode. We could support this for Safari, but it'd be fairly ugly.
We include all whitespace found at the l/r of nodes in the Range, but Chrome does not.