Re: [csswg-drafts] [css-scoping] :host and descendant combinators.

The Blink and WebKit behavior is expected. Note that selectors like "div:host" will never match anything. Neither will "body :host > span". :host will only ever match anything if these hold:

1. :host appears in the leftmost compound selector.
2. :host is the only simple selector in that compound.

Section 3.2.2. of the current draft looks pretty clear to me:

"For the purpose of Selectors, a shadow host also appears in its shadow tree, with the contents of the shadow tree treated as its children. (In other words, the shadow host is treated as replacing the shadow root node.)

When considered within its own shadow trees, the shadow host is featureless. Only the :host, :host(), and :host-context() pseudo-classes are allowed to match it."


-- 
GitHub Notification of comment by lilles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2423#issuecomment-371463760 using your GitHub account

Received on Thursday, 8 March 2018 11:42:25 UTC