1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-24 03:12:46 +01:00

Test for unsupported pseudo operators after normalization

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2356
This commit is contained in:
Raymond Hill 2022-11-10 10:32:22 -05:00
parent 2e134a0c46
commit b1a14794bf
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1549,15 +1549,14 @@ Parser.prototype.SelectorCompiler = class {
// Post-analysis
// Mind https://w3c.github.io/csswg-drafts/selectors-4/#has-pseudo
if ( data.name.startsWith('-abp-') ) {
data.type = 'Error';
return;
}
data.name = this.normalizedOperators.get(data.name) || data.name;
if ( this.proceduralOperatorNames.has(data.name) ) {
data.type = 'ProceduralSelector';
} else if ( this.proceduralActionNames.has(data.name) ) {
data.type = 'ActionSelector';
} else if ( data.name.startsWith('-abp-') ) {
data.type = 'Error';
return;
}
if ( this.maybeProceduralOperatorNames.has(data.name) ) {
if ( this.astHasType(args, 'ProceduralSelector') ) {