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

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

From: Rune Lillesveen via GitHub <sysbot+gh@w3.org>
Date: Fri, 27 Mar 2020 12:15:47 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-604967806-1585311346-sysbot+gh@w3.org>
Yes, div:has-child(div:has-child(img)) is essentially a different syntax for a variant of :has, so my assumption would be that :has-child() only takes a compound or compound list, not allowing nested has-child() or any other simple selectors which can contain combinators *sigh*, and as previously mentioned only in the rightmost compound.

In Blink, the invalidation for nth-* selectors is similar to what we would do here. Mark an element if it either matched or failed to match a :has-child() selector, and when any of its children mutates and the flag is set, mark that parent for style recalc.

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

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