RE: Parentheses-free pseudo-elements

On Jul 16, 2013 1:06 AM, "François REMY" <francois.remy.dev@outlook.com>
wrote:
>
> ± 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?

Dunno!

> ± > PS: By the way, did someone beside Tab had a look at the {so-called}
> ± ":host(selector) pseudo-class" {previously known as the ":context()"
pseudo-
> ± class}? It seems really crazy to me and not functionally belonging to
the
> ± "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
them.

":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.

~TJ

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