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

Re: [csswg-drafts] [selectors-4] New selector based on the amount of child elements (#5694)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Fri, 06 Nov 2020 00:59:21 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-722736765-1604624360-sysbot+gh@w3.org>
Regarding complexity, we have (from hardest to easiest):
1. `:has()`
2. `:has-child(S) = :has(> :is(S))` (#4903)
3. `:nth-children(An+B of S) = :has-child(:nth-child(An+B of S):nth-last-child(1 of S))`
    (or maybe `= :is(:has-child(:nth-child(An+B of S):nth-last-child(1 of S)), :not(:has-child(S)))` if `B=0` or `A,B≠0, A∣B, A*B<0`)

So this one seems the most feasible, and `:has()` might be unfeasible (for the web, for now). But if `:has-child()` is feasible, I would prefer it over this one.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 6 November 2020 00:59:23 UTC

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