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

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