I am testing out the new :has()
pseudo class. So far, only Firefox hasn’t enabled it by default.
I read in a comment on How do you enable :has() selector on Firefox about the following test:
CSS.supports("selector(:has(:focus))"));
It returns true
when I’ve enabled the setting on Firefox, and false
otherwise, which is expected.
The thing is what does the selector(:has(:focus))
actually mean? Obviously it’s testing for the :has()
pseudoclass, but what’s with the selector()
and the (:focus)
parts. If I try to simplify it, the test doesn’t work — at least it returns a false
.
I can’t find any detailed document on the CSS.supports()
method which discusses it.