ExtendedCss icon indicating copy to clipboard operation
ExtendedCss copied to clipboard

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

Open AdamWr opened this issue 2 years ago • 2 comments

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: https://github.com/AdguardTeam/AdguardFilters/issues/147558 https://github.com/AdguardTeam/AdguardFilters/issues/147319#issuecomment-1499966394


With extension version 4.1.53

Screenshots

image

AdamWr avatar Apr 06 '23 14:04 AdamWr

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 avatar May 02 '23 14:05 peace2000

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

peace2000 avatar May 02 '23 14:05 peace2000