Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ':has()' pseudo-class due to <forgiving-relative-selector-list> #154

Open
slavaleleka opened this issue Dec 20, 2022 · 2 comments
Open

Comments

@slavaleleka
Copy link
Contributor

native :has() pseudo-class takes <forgiving-relative-selector-list>
https://www.w3.org/TR/selectors-4/#has-pseudo

but in v2.0 it seems to take <selector-list> which means that all of selectors in the selector list arg are being matched
https://uploads.adguard.org/slbdzdrvx7z36.png

native implementation also does not signal an error on invalid selector in the list arg
https://uploads.adguard.org/slbdzdrve42fv.png

@AdamWr
Copy link
Member

AdamWr commented Dec 22, 2022

Related issue - if rules like those:

example.org#?#div[data*="\\""]:has(> qwerty)
example.org#?#div:has(> h1)

are added (I guess the first one is incorrect, though document.querySelectorAll('div[data*="\\""]:has(> qwerty)') doesn't throw error), then the second one doesn't work.

Screenshot

image

Order is important, if I firstly add example.org#?#div:has(> h1) then this one rule works fine, but there are still errors in console and it looks like that every rule below a problematic rule don't work.

@XX-J
Copy link

XX-J commented Apr 15, 2023

Same type of issue #159.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants