W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2020

Re: [csswg-drafts] [css-selectors] has-child selector (#4903)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Fri, 27 Mar 2020 18:06:08 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-605176241-1585332367-sysbot+gh@w3.org>
> Sure, it's only one-level ancestor, but it is not if you nest them, right? So div:has-child(div:has-child(img)) or such.

In previous discussions of this (largely predating us using GH, unfortunately), it was presumed that nesting `:has-child()` would be invalid.

So you could have `:has-child()` at multiple points in a selector, like `div:has-child(img) + label:has-child(:checked)`, but you wouldn't ever be able to recurse with it.

I assume we'd definitely impose this restriction, else this is just a less convenient way of writing `:has()`, as you say.

GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4903#issuecomment-605176241 using your GitHub account
Received on Friday, 27 March 2020 18:06:12 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:02 UTC