chrsan/css-selectors

:not() selector parser problems

Closed this issue · 2 comments

The parser is to greedy when it comes to :not() selectors, it puts all the previous specifiers of the simple selector into the :not selector, e.g.

"div.class1:not(.class2)" is parsed as "div:not(.class1.class2)"
or
"div:not(.class1):not(.class2)" turns into "div:not(:not(.class1).class2)"

however, the parser correctly deals with the specifiers after the :not() selector, e.g.
"div:not(.class2).class1"

This is really bad. I'm kind of swamped right now, but if you want to send a patch I'll commit it right away.

Fixed in version 2.0