W3C home > Mailing lists > Public > www-style@w3.org > July 2014

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 24 Jul 2014 23:46:09 -0700
Message-ID: <CAAWBYDDGG75TBokyTCado5BCF+A7Zf6DpYNKfY5UbWvk_Hqn1Q@mail.gmail.com>
To: Takayoshi Kochi (河内 隆仁) <kochi@google.com>
Cc: www-style list <www-style@w3.org>, Elliott Sprehn <esprehn@google.com>, Steve Orvell <sorvell@google.com>, Hayato Ito <hayato@google.com>
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.

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:35 UTC