Re: Shadow DOM and Fallback contents for images

On Wed, Oct 16, 2013 at 9:47 PM, Hajime Morrita <morrita@google.com> wrote:
> This is not allowed:
>
> D. "H[ello Shado]w World" - selection spans outside to inside.

This is not acceptable to me. Users should not be affected by the fact
that a piece of UI is implemented using shadow DOM rather than using
just "normal" DOM.

That doesn't mean that we need to have a single DOMRange object which
starts in the text Node in the Document and ends in the text Node in
the shadow DOM.

But it does mean that the user should be able to press down the mouse
button at the 'e', drag to the 'o' and see a selection as described
above. And when the user presses "Ctrl + C" (or UI action is used for
'copy'), the indicated text should end up in the clipboard.

Gecko already supports the ability to have a selection which uses
multiple DOM Ranges. I'm not sure if this is something that other
browsers are willing to implement?

Another approach would be to explicitly in somewhere in the selection
API enable getting DOM ranges in shadow DOM that are selected. But
code that isn't aware of shadow DOM just sees the text in the main
Document that is selected.

/ Jonas

Received on Thursday, 17 October 2013 18:52:55 UTC