Re: [css-scoping] Clarification about :host and pseudo-class combination usage

On Thu, Jul 24, 2014 at 11:16 PM, Takayoshi Kochi (河内 隆仁)
<kochi@google.com> wrote:
> Hi,
>
> Recently we had a discussion about how
>
> (A) :host(::before) { ... }
> (B) :host::before { ... }
>
> should match.
>
> Our local conclusion was that a pseudo-class (like ::before) works like a
> combinator
> and (A) should be rejected at CSS parser level as :host() can only contain
> a compound selector, while (B) should match, like :host::shadow which is
> already
> in the spec (http://dev.w3.org/csswg/css-scoping/ , example 6).
>
> However, we were not sure in which a pseudo element like ::before is
> categorized,
> as http://dev.w3.org/csswg/selectors4/, section 3.1 Structure and
> Terminology, says
> nothing about "pseudo element" (in contrast, pseudo class is a simple
> selector).
>
> Let us know your thoughts about (A) and (B) above.
>
> Relevant Chromium bugs:
> https://code.google.com/p/chromium/issues/detail?id=393490
> https://code.google.com/p/chromium/issues/detail?id=393509

You're right on both counts. (A) is syntactically invalid, while (B)
is valid and works fine.

I've been trying to decide how much of pseudo-elements belongs in
Selectors, and how much belongs in the theoretical Pseudo-Elements
spec we haven't written yet.  I should probably just put the syntax
and theoretical part into Selectors properly, to help make issues like
this clearer.

~TJ

Received on Friday, 25 July 2014 06:46:56 UTC