-
Notifications
You must be signed in to change notification settings - Fork 713
add handling for :matches and :is #6145
base: gh-pages
Are you sure you want to change the base?
Conversation
`:any` and `:matches` and `:is` need selector lists to test support, so the additional call was added. `:is` is a special case since the standard renamed it, so it gets its own if statement.
Thanks for submitting a PR! If I'm understanding this correctly, it seems to be special casing a specific selector in code that is supposed to handle selectors generically. I'm not very comfortable with that, once we start handling exceptions like this, the code will progressively get messier and messier. If you can think of a more general way to handle this that will also work for other cases (now or in the future), I'd be glad to merge it, but this doesn't scale. |
There are two things: one is that the original code used a generic |
Correct. Although it's impossible to know what parameters to test with when it comes to parameterized selectors, so this probably needs to be part of the selector definition (just like with values we tell PF which property to test them with).
Famous last words :) While there's certainly always a danger of potential futures blocking current development, some planning ahead is good. We rename (early) things all the time, it can easily happen again. Also, we don't tend to add stuff to PF with no implementations, and AFAIK |
In this case, if it's part of the definition, the prefix would be wrong. I would have to define another object to hold the test definition and some way of when to use it. But as of now, the only selectors that take parameters take the same parameters, so I used the shortest, smallest method to test them. I'll remove the |
I don't understand what you mean here. Could you elaborate?
That's not true, e.g. |
Browsers support `:is`, not `:matches`. Clarify the if statement.
:any
and:matches
and:is
need selector lists to test support, so the additional call was added.:is
is a special case since the standard renamed it, so it gets its own if statement.For part of #6130