Parse -abp-has as declarative if possible

With the new csstree-based parser, it should now be
safe to parse `-abp-has` as declarative. There are over
a hundred such cosmetic filters in EasyList, and we want
to have these filters declaratively enforced whenever
possible in order to let the browser do the work natively
rather than rely on JS code.
This commit is contained in:
Raymond Hill 2022-10-14 13:04:47 -04:00
parent 5d97353287
commit 30bd6c7bb8
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 1 additions and 0 deletions

View File

@ -1425,6 +1425,7 @@ Parser.prototype.SelectorCompiler = class {
if ( match === ':-abp-contains(' ) {
return ':has-text(';
} else if ( match === ':-abp-has(' ) {
this.asProcedural = false;
return ':has(';
}
return match;