Some rules with ':not(:has())' don't work correctly
Related issue - https://github.com/AdguardTeam/AdguardFilters/issues/140279
Steps to reproduce:
- Add this rule:
example.org#?#div:not(:has(img, input, iframe, h1, p))
- Go to - https://example.org/
Website is blank, but it shouldn't be.
It looks like that ExtendedCss.query('div:not(:has(img, input, iframe, h1, p))') returns one div, but document.querySelectorAll('div:not(:has(img, input, iframe, h1, p))') returns empty NodeList.
Screenshot

By the way, it looks like that even if rule is added without ?, like this:
example.org##div:not(:has(img, input, iframe, h1, p))
then it's still treated as an Extended CSS rule, but I think it shouldn't be.
Judging by overnight testing, I currently get the impression that AdGuard is in practice interpreting #?#div:not(:has(img, input, iframe, h1, p)) as #?#div:not(:has(img)), as a simple way to explain what is going on.
Maybe it is time to back version compatible with Pale Moon and Basilisk.
That would unfortunately have been pretty impractical for these kinds of entries, as it'd require something like #?#div:not(:has(img)):not(:has(input)):not(:has(iframe)):not(:has(h1)):not(:has(p))
Another case:
This rule in Easylist Cookie list:
bloomberg.com##body:not(:has(div[class*="player" i][class*="_container"], #root .datastrip)) > div[id^="sp_message_container"]
Broke Bloomberg completely: https://www.bloomberg.com/news/articles/2023-04-27/electronic-arts-star-wars-jedi-survivor-was-made-in-record-time?leadSource=uverify+wall
The rule should target div[id^="sp_message_container"], not the body element.
Also simpler forms of the rule cause the breakage:
bloomberg.com##body:not(:has(div[class*="player" i][class*="_container"])) > div[id^="sp_message_container"]
bloomberg.com##body:not(:has(#root .datastrip)) > div[id^="sp_message_container"]
I think that the issue on bloomberg.com is rather a bit different and it's related to this - https://github.com/AdguardTeam/ExtendedCss/issues/166
Ok, copied my comments there. But I'll leave them here as well just in case.