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

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

From: Sebastian Zartner via GitHub <sysbot+gh@w3.org>
Date: Sun, 29 Mar 2020 00:35:12 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-605538791-1585442111-sysbot+gh@w3.org>
The `:has-child()` selector is effectively a sub-feature of `:has()` and it sounds like allowing arbitrarily deep selectors may not be implementable in a performant way.

So another approach to this would be to restrict `:has()` to a simple relative selector, i.e. `<combinator> <simple-selector>`. This avoids introducing two functional overlapping selectors, already covers many use cases, and is more performant than allowing complex selectors.

And if that resolves the performance issues regarding `:has()`, it hopefully gains some traction by implementors and doesn't require the note that "Supporting the `:has()` pseudo-class is not required to conform to this specification.".

In a later level, `:has()` may then still be enhanced to allow complex selectors to cover the rest of the use cases, but in the meantime, authors already get something they can work with.

Sebastian

-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4903#issuecomment-605538791 using your GitHub account
Received on Sunday, 29 March 2020 00:35:14 UTC

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