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

Re: [csswg-drafts] [selectors4] :target-within?

From: J. S. Choi via GitHub <sysbot+gh@w3.org>
Date: Wed, 29 Nov 2017 03:49:49 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-347744623-1511927388-sysbot+gh@w3.org>
There’s an alternative to @LeaVerou’s idea of turning `:has(:focus)` and `:has(:target)` into fast special cases of `:has()` that’s worth also considering.

The alternative idea is to revise the current Selectors Level 4 draft so that `:has` becomes an always-fast selector that accepts only a limited enumeration of arguments such as `:focus` and `:target`. The current draft’s slow/general version of `:has()` would be (hopefully safely) renamed. After all, it’s not yet implemented anywhere.

In this proposal, a longer name for the slow/general selector—like `:has-matches()` or whatever—may be appropriate, if one agrees that the slow/general selector would be used much less often (i.e., in JavaScript only) than the fast/enumerated selector.

GitHub Notification of comment by js-choi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/457#issuecomment-347744623 using your GitHub account
Received on Wednesday, 29 November 2017 03:49:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 29 November 2017 03:49:56 UTC