optimal-select icon indicating copy to clipboard operation
optimal-select copied to clipboard

Treat :nth-of-type as a first class citizen

Open venkatkarun opened this issue 9 years ago • 1 comments

I modified https://github.com/Autarc/optimal-select/blob/master/src/match.js#L259 locally to use nth-of instead of nth-child and it works great across multiple sites. Do you have any objections to incorporating this change directly in match.js as opposed to a later optimization in optimize.js. I will be happy to send a pull request if you think the change seems worthy and don't want to take it on yourself.

venkatkarun avatar Mar 07 '16 15:03 venkatkarun

At first I thought about using the nth-type-of selector in the initial matching as well - the problem is that its doesn't work in every case. For validation and comparison a simplified version of the css-selector-generator-benchmark is used. If you apply the generalization too early some tests will fail. Therefore the nth-child selector is used as the default fallback. not-matching-selector

autarc avatar Mar 07 '16 16:03 autarc