AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
53 stars 12 forks source link

Some rules are treated as invalid/incorrect #81

Closed AdamWr closed 4 years ago

AdamWr commented 4 years ago

For example:

! Invalid selector:
comingsoon.net##.fixed-header.affix .main-menu-container::after, .main-nav .menu-item:first-child
! Invalid selector:
foreignpolicy.com###logo, #menu, #mobile-nav-trigger, #site-wrapper > .scrolled, .-emph.-user.-top.navlink, .hamburger-button, .header-alt-layout .header-subnav .header-menu-item:first-child:before, .header-alt-layout__title
! Invalid selector:
foxnews.com##.c-item.c-item-first.c-item-last, .featured.featured-video .control, .featured.featured-video.sticky-video .contain .info .title:before, .g-41.section-featured, .vid-scroll-bknd
! Invalid selector:
globalnews.ca##.sticky-wrapper.sticky .stickyiframe-container:after, .stickyiframe-title-bar
! Invalid selector:
msn.com###header-common:before, #sticky-footer, #subfoot, .loaded.next.paddle, .loaded.previous.paddle, .show.floatingfeedback, .spotlight-1 > div[style="height: 50px;"], .start.animate.close-mini
! Invalid selector:
theatlantic.com##.t-homepage .c-nav--slim--lacroix::after, .t-homepage .c-nav__list--slim--lacroix .c-nav__item--small-a--lacroix

From - https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/ThirdParty/filter_201_WebAnnoyancesUltralist/diff.txt

And these:

! Incorrect style:
photoblog.pl#$##frontpage .frontpage-teaser-photo-container[style*="background-image: url()"] h1 { margin-top: 45px !important; }
! Incorrect style:
photoblog.pl#$##frontpage .frontpage-teaser-photo-container[style*="background-image: url()"] { height: 225px !important; }

From - https://github.com/AdguardTeam/FiltersRegistry/blob/master/filters/ThirdParty/filter_237_PolishAnnoyance/diff.txt

But these rules seem to look correctly.

Alex-302 commented 4 years ago

CSS rules with url() are unsupported.

AdamWr commented 4 years ago

Okay, but it should be possible to apply CSS rule to selector like that: body[style*="background-image: url()"]

example.com#$#body[style*="background-image: url()"] { margin-top: 45px !important; } still should works, and it shouldn't be marked as "incorrect style", I think.

Alex-302 commented 4 years ago

Ah, my mistake)