Parsing ":not(FOO)" or ":nth-child(FOO)" results in a PseudoClassConditionImpl with value "not(FOO)" or "nth-child(FOO)", i.e. the argument itself is not parsed any further. This is in SACParserCSS3.
This makes it impossible to differentiate between ":not(#foo)" and ":not(.foo)" without putting the argument string through second parser, i.e. the tree is incomplete. I found this issue when calculating CSS selector specificity using the the current parsers: ":not(#foo)" and ":not(.foo)" return the same single SAC_PSEUDO_CLASS_CONDITION/PseudoClassConditionImpl, although their specifity is different (1-0-0 vs 0-1-0) and there could be more selectors inside.
I guess the issue only is that CSS3 parsing/grammar is incomplete. I'll see if I can attach a patch, but it may take a while.
See here for more:
- https://www.w3.org/TR/selectors-3/#negation
- https://www.w3.org/TR/selectors-3/#nth-child-pseudo
Anonymous
Diff:
Updated the issue to better describe the problem.