Re: Shadow DOM and Fallback contents for images

On Thu, Oct 17, 2013 at 5:01 PM, Ryosuke Niwa <rniwa@apple.com> wrote:

> On Oct 16, 2013, at 9:47 PM, Hajime Morrita <morrita@google.com> wrote:
>
> D. "H[ello Shado]w World" - selection spans outside to inside.
>
>
> Suppose we allowed this selection. Then how does one go about pasting this
> content elsewhere?
>
> Most likely, whatever other content editable area, mail client, or some
> random app (e.g. MS Word) into which the user is going to paste wouldn’t
> support shadow DOM and most certainly wouldn’t have the component the
> original page happened to have.
>

We have to define how Range.cloneContents() or extractContents() works
against shadow-selecting range, assuming selection is built on top of DOM
Range. This doesn't seem that complicated. As cloned element drops its
shadow, these range-generated nodes won't have shadow either.


>
> Or are you suggesting to copy/serialize the composed “DOM" tree?
>
>

No, it's same as copying on document tree we have today. Only difference is
that its tree scope is ShadowRoot instead of Document. I don't think this
difference is significant.

Actually, <textarea> can be (and is) implemented on top of UA shadow DOM.
What we need is a way to explain this.


> What unclear for me is:
>
> - For case of C, should we consider "Shadow" being selected? Naively
> thinking yes, but the implication isn't that clear.
>
> - Should we have a way to forbid B to ensure the selection atomicity?
> Probably yes, but I don't think we have one. The spec could clarify this
> point. My feeling is that this is tangential to Shadow DOM and is more
> about generic "selection atomicity" concept. It could be covered by a CSS
> property for example.
>
>
> Doesn't -moz-user-select/-ms-user-select: element do that already?
>

Oh right. This is exactly what I wanted. Thanks for pointing this out!


>
> On Oct 16, 2013, at 9:25 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>
> On Oct 16, 2013 8:04 PM, "Ryosuke Niwa" <rniwa@apple.com> wrote:
> > In that case, the entire "Note" will be selected as an atomic unit.  Is
> there a use case in which you want to select a part of "Note" and a part of
> "Text here"?
>
> What if the text "Note" was longer? Is there ever a use case for selecting
> part of a word? If not, why does all browsers allow it?
>
> Then the user can select a part of “Long Note Title”.
>
> - R. Niwa
>
>


-- 
morrita

Received on Thursday, 17 October 2013 08:56:12 UTC