Re: [shadowdom]: Using :root to specify the insertion point in ::distributed

On Thu, Mar 28, 2013 at 12:25 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Mar 26, 2013 at 8:55 PM, Hayato Ito <hayato@google.com> wrote:
>> I have one concern for the naming of ':root'.
>>
>> I am afraid that It might be misleading that ':root' matches
>> 'top-level elements in the distributed set' rather than 'insertion
>> point' itself.
>> There are multiple such roots. That's not intuitive for me. ':root' is
>> likely to imply 'insertion point' itself because it's *root* of such
>> elements.
>>
>> So instead of reusing ':root' in this context, how about having a more
>> intuitive name, like ':child-of-shadow-host' or something?
>
> The issue with that is that we run into the exact same problem with
> ::shadow() - if you want to select only the top-level elements inside
> of a shadow root, what selector do you use?  Do we invent *another*
> pseudoclass that's identical except for the name?

That's good point.

I agree that we should avoid such a situation, inventing another
pseudoclass, if we can reuse existing pseudoclass without any
ambiguity of the meaning.
As for ':root' pseudo class which is used in the parameter of
'::distributed', there is no ambiguity. A '<html>' element never
appears in the elements which '::distributed(..)' may match.


> I'm personally okay with :root meaning "an element without a parent in
> this view of the tree".

That is helpful to my mental model of ':root'. Thank you!

>
> ~TJ



--
Hayato

Received on Thursday, 28 March 2013 02:21:50 UTC