Re: [csswg-drafts] [css-scoping-1] Clarify exactly what :host(<sel>) can use as argument (#7953)

> If I correctly understand the reason for restricting :host() argument to <compound-selector>, I think these cases should also be invalid:

The second and third are indeed invalid, but the first is valid. (It won't match anything, since the host element only matches `:host`/`:host-context()` from within the shadow; outside of the shadow (which is the context in which the selector argument is evaluated) it won't match the pseudo.)

> I guess these cases cannot match anything? Should they be invalid?

As both argument contain pseudo-elements, neither of them are compound selectors, so they're both invalid.

> And :host(:host(.foo)) is valid but nesting :host() is useless, right?

Yes.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 2 January 2023 00:31:57 UTC