Re: :host pseudo-class

On Mon, Apr 27, 2015 at 5:56 AM, L. David Baron <dbaron@dbaron.org> wrote:
> For :host it's less interesting, but I thought a major use of
> :host() and :host-context() is to be able to write selectors that
> have combinators to the right of :host() or :host-context().

Would they match against elements in the host's tree or the shadow
tree? I don't see anything in the specification about this.


> And I tend to think :host, :host(), and :host-context() should
> probably agree on whether to be pseudo-classes or pseudo-elements.

Agreed.


Another reason why I think it should be a pseudo-element is that :host
would make for a suitable pseudo-class to select host elements in a
tree (elements that have an associated shadow root). That is, :host
makes sense within the light tree, and ::host makes sense within the
shadow tree. And given that a shadow tree can also be simultaneously a
light tree due to nesting, we don't want to conflate the two.


-- 
https://annevankesteren.nl/

Received on Monday, 27 April 2015 04:23:17 UTC