Page 1 of 1

Performance of :-abp-has()

Posted: Sun Aug 27, 2017 11:57 pm
by humppa
Just for my comprehension:
Here it says
Also it is recommended that the selector inside a :-abp-has() starts with a combinator like >, + or ~. Otherwise a lot of elements will be needlessly selected as more that one ancestor will match.
So it is better to use

Code: Select all

site.com##.wrapper-safe:-abp-has(>.fb > div[class^="fb-col-"] > section > a.DealOfTheDay)
or

Code: Select all

site.com##.wrapper-safe:-abp-has(>div > div > section > .DealOfTheDay)
than this

Code: Select all

site.com##.wrapper-safe:-abp-has(.DealOfTheDay)
?

Re: Performance of :-abp-has()

Posted: Tue Aug 29, 2017 9:43 am
by lewisje
yes, because it starts by looking for just direct descendants, not all descendants

Re: Performance of :-abp-has()

Posted: Tue Aug 29, 2017 1:03 pm
by humppa
Ok thanks, I just thought the many filters (costly: [attribute*="value"]) inside the braces could outweigh the benefits of starting with >.
Of course I understand it's always a matter of given site structure, too.

Re: Performance of :-abp-has()

Posted: Tue Aug 29, 2017 5:50 pm
by sbell
I'm sorry, but we do not want to cover site-specific filter questions in the Adblock Plus forum.

The Adblock Plus project is deliberately not involved in authoring filters. The best place to get help for such questions is the forum of a filter list project such as EasyList.

Re: Performance of :-abp-has()

Posted: Tue Aug 29, 2017 8:19 pm
by mapx
@sbell, it's about how to use certain features ABP is providing.

-abp-has is a new feature and the users are asking how to use it better.

Re: Performance of :-abp-has()

Posted: Tue Aug 29, 2017 8:32 pm
by humppa
Thank you mapx, that's what I would have written if the topic wasn't locked.
Maybe sbell thought, site.com is a real site.
However, I think I got my answer and a new best practice for -abp-has:()

Thanks, keep up the good work :-)

Re: Performance of :-abp-has()

Posted: Wed Aug 30, 2017 8:16 pm
by sbell
My apologies! The post was indeed redacted in error.

Re: Performance of :-abp-has()

Posted: Wed Aug 30, 2017 10:30 pm
by humppa
@sbell
It's ok, that happens. We're all just people. Nice of you that you replied again!