Open Banou26 opened 2 years ago
I am experiencing a similar issue with table:not(table table)
i.e. All tables that are not descendants of another table.
My difference was that instead of throwing an error, it would not parse the selector in the :not
parameters as a complex selector (As is permitted in CSS Selectors Level 4)
I observed the :not
would only parse the last tag, for instance if my selector was ul:not(p ul)
it would parse it as ul:not(ul)
the same with child combinator >
and adjacent sibling combinator +
inside :not() pseudo-class arg
div:not(div > span)
div:not(h1 + p)
there is no error in browser:
I came across the same issue. It seems selector validation is broken. If you really need it to work you can try disabling validation, keep in mind it is an ugly hack though and it might not work for everyone:
In node_modules/nwsapi/src/nwsapi.js
replace:
reValidator = RegExp(standardValidator, 'g');
with
reValidator = RegExp('.*', 'g');
@dperini The issue shouldn't be closed, the problem wasn't fixed. Validation still fails for valid selectors mentioned in this issue.
@svarzee you are correct I should at least have pushed the code to fix this before closing. However just for you to know I already have the code for that and I am in the process to get this fixed.
@Banou26 I pushed a commit for the problem you have submitted (b9da5347250ca7c9796f70c86189dfbeacb9aa18) hope it fixes your issue. It could be of help if you can check the github master repository and confirm the fix. Thank you for your time and help.
throws
Trying to query for
.js-sns-icon-container ~ h2 ~ h2 ~ .spaceit_pad:not(.js-sns-icon-container ~ h2 ~ h2 ~ h2 ~ .spaceit_pad)
in browsers work completly fine (Tried in chrome and FF).