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

RE: Parentheses-free pseudo-elements

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 16 Jul 2013 01:14:20 -0500
Message-ID: <CAAWBYDDqkmRHbzEpptCxwpPRTxAOrNsvyVXgNtpq7ePG5r-hFw@mail.gmail.com>
To: François REMY <francois.remy.dev@outlook.com>
Cc: www-style list <www-style@w3.org>
On Jul 16, 2013 1:06 AM, "François REMY" <francois.remy.dev@outlook.com>
> ± The Shadow DOM pseudos have already switched to this (the spec may not
> ± have caught up to it, yet), and Alan was planning to switch ::region as
well, as
> ± soon as Shadow DOM's switch was confirmed and sure.
> Ok, good to know. Was any anouncement made for this?


> ± > PS: By the way, did someone beside Tab had a look at the {so-called}
> ± ":host(selector) pseudo-class" {previously known as the ":context()"
> ± class}? It seems really crazy to me and not functionally belonging to
> ± "pseudo-class family". If not, please have a look here:
> ± >
> ± >     https://www.w3.org/Bugs/Public/show_bug.cgi?id=22390
> ± >
> ± > and start a new thread if you feel the same as me
> ±
> ± How is it possibly not a pseudo-class?  It's an additional filter
applied to the
> ± host element, based on information not obtainable via normal selectors.
> The problem is that, if I understood it correctly, selectors like
":host(...) *" and "*" may select completely different stuff, in a
completely different part of the DOM tree, across several shadow dom
entries. I don't think it should be possible to style ancestors of the the
shadow dom host, and it seems what this stuff is aimed at.
> What's the reason why we would like to allow to style parents of the
shadow dom host from inside, by the way?
> Or did I miss the point?

You've missed the point. ^_^

:host() is a proper pseudo class - it just filters elements you can already
select normally. Specifically, it matches the host element only if, in the
composed ancestor list, the selector argument matches something. It doesn't
let you actually select those elements above the host, just match based on

":host() *" is definitely different from "*", because the appropriate thing
to compare it to is "* *", obviously; as proper, it selects a subset of
what is matched by that more general selector within a shadow tree. It
doesn't let you style outside of the shadow tree, except for the host
element itself.

Received on Tuesday, 16 July 2013 06:14:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC