Re: [csswg-drafts] [css-scoping][css-cascade] :scope in shadowy prelude-less @scope matches nothing (#9178)

Yes, this seems pretty clearly to just be an oversight; if the stylesheet is a root element of the shadow tree, it should scope to the shadow host. (And `:scope` should be able to match the host element in this instance, [like `&` can](https://drafts.csswg.org/css-nesting/#nest-selector) (search for "featureless").) This effectively makes the @scope a no-op, I think, since shadow styles are always scoped to the shadow anyway? But it should def work, rather than breaking.

> I noticed that [drafts.csswg.org/css-scoping-1/#shadow-gloss](https://drafts.csswg.org/css-scoping-1/#shadow-gloss) contradicts the other part of the spec:
> [snip]
> But since this doesn't match browser implementations, I assume it's a remnant of a previous spec version.

Hm, yeah, that might predate some of the featureless text, or maybe it's just being too general, and meant like "you can't do `my-component > .in-the-shadow`". I'll tweak the wording.

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


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

Received on Thursday, 17 August 2023 00:38:15 UTC