W3C home > Mailing lists > Public > www-style@w3.org > April 2013

Re: ::distributed and relative selectors (Was Re: [shadowdom]: Using :root to specify the insertion point in ::distributed)

From: Hayato Ito <hayato@google.com>
Date: Fri, 26 Apr 2013 10:59:39 +0900
Message-ID: <CAFpjS_0j4jd0_KgLrqQcsUQyf7FFd1TzUTm5LyNvT7xD0Avp-g@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Dimitri Glazkov <dglazkov@google.com>, fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
I am wondering that we can resolve this ':scope' issue for
'::distributed' pseudo element by updating a relative selector spec
somehow, though I am not sure how we should update the spec yet.
>From the view point of the syntax,

  A) ::distributed(> .hello)
  B) ::distributed(.hello:root)

 I still prefer A to B since A is more intuitive for developers, I think.

On Mon, Apr 22, 2013 at 3:36 PM, Hayato Ito <hayato@google.com> wrote:
> On Fri, Apr 19, 2013 at 10:40 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> On Thu, Apr 18, 2013 at 5:27 PM, Hayato Ito <hayato@google.com> wrote:
>>> On Fri, Apr 19, 2013 at 2:44 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>>> I think that, for the purpose of ::distributed, the scope element
>>>> should be an abstract container, not the actual <content> element.
>>>> This container would act as an element for the purposes of selectors,
>>>> but it has no tagname or any other quality to select on.  So, #1, #2,
>>>> and #3 would match, but #4 and #5 wouldn't, because the scoping
>>>> element isn't named "content".
>>>
>>> I noticed that we don't need 4) and 5) to prove contradiction. See the
>>> following example, introducing 4':
>>>
>>> 1). content::distributed(> .hello)               ->  Please assume this matches.
>>> 2). content::distributed(:scope > .hello)        -> Matches. (1 and 2
>>> should be equivalent according to the defintion of relative
>>> selectors).
>>> 3). content::distributed(*:scope > .hello)       -> Matches.
>>> 4'). content::distributed(* > .hello)       -> Should not match.
>>>
>>> 3) matches, but 4') should not match.
>>>
>>> I think it is hard to justify using :scope in this context. I am
>>> afraid that we should handle ':scope' in this context very *tricky* in
>>> implementing this. Maybe the spec is wrong.
>>> My proposal is using ':root' as suggested in the original thread.
>> I don't understand how :root could help.  If :scope is problematic,
>> presumably :root would have the same problems?
>
> No, ':root' does not have a problem I mentioned. See the following example:
>
> root-3). content::distributed(.hello:root)       -> Matches.
> root-4'). content::distributed(.hello)       -> Matches
>
> We don't have an inconsistency between root-3 and root-4' as seen in 3 and 4'.
>
>> I don't have a problem with 4' matching, actually.  The virtual
>> element must not show up in the selector's results, but that's all
>> (and it can only appear if you use a selector like ":scope" or "*").
>>
>> ~TJ
>
> Hmm. On the hat of implementors, 3 and 4') break the basic rule of
> selectors. We need to have an extra hidden rule, virtual elements, to
> explain its correctness both in the spec and implementations.
> I am afraid that would make implementations unnecessary complex. If we
> can have alternative way, like ':root', I'd prefer it to ':scope'.
>
>
>
> --
> Hayato



-- 
Hayato
Received on Friday, 26 April 2013 02:00:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:10 UTC