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

Pseudo-class combined with ':not()' does not work correctly #166

Open
AdamWr opened this issue Apr 6, 2023 · 2 comments
Open

Pseudo-class combined with ':not()' does not work correctly #166

AdamWr opened this issue Apr 6, 2023 · 2 comments
Assignees

Comments

@AdamWr
Copy link
Member

AdamWr commented Apr 6, 2023

It looks like a regression and it started occurring in AdGuard Browser extension version 4.1.55, but works correctly in version 4.1.53.
The same issue occurs in latest nightly build for Windows 7.13 nightly 8 (build 4242, CL 1.11.79).

Steps to reproduce:

  1. Add this rule:
example.org#?#div:matches-css(margin: /./) > :not(p)

or

example.org#?#div:has(a) > :not(p)
  1. Go to - https://example.org/

Rule hides div but it should hide only h1 element.

Screenshots

image

image

Related issues:
AdguardTeam/AdguardFilters#147558
AdguardTeam/AdguardFilters#147319 (comment)


With extension version 4.1.53

Screenshots

image

@AdamWr AdamWr changed the title ':matches-css()' combined with ':not()' does not work correctly Pseudo-class combined with ':not()' does not work correctly Apr 6, 2023
@zzebrum zzebrum assigned slavaleleka and unassigned zzebrum Apr 13, 2023
@adguard-bot adguard-bot assigned maximtop and unassigned slavaleleka Apr 28, 2023
@peace2000
Copy link

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.

@peace2000
Copy link

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"]

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

6 participants