[csswg-drafts] [selectors] `:empty` selector shouldn't match elements with shadow roots (#6771)

lukewarlow has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors] `:empty` selector shouldn't match elements with shadow roots ==
The [selectors spec](https://drafts.csswg.org/selectors-4/) isn't currently clear about how the [`:empty`](https://drafts.csswg.org/selectors-4/#the-empty-pseudo) selector works with shadow roots.

The current situation is something I would consider unintuitive behaviour where an element with an (open) shadow root that itself has child elements, matches the `:empty` selector.

See https://jsfiddle.net/hyjfkwqx/. I would expect a red square with a smaller blue square in it, but instead the parent div has display: none applied.

Provided it's web compatible it would be great if the spec (and in turn implementations) could be updated so that the contents of shadow roots should be taken into account.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6771 using your GitHub account


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

Received on Wednesday, 27 October 2021 21:13:42 UTC