Properly detect unsupported pseudo operators

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/yr8eda/
This commit is contained in:
Raymond Hill 2022-11-10 09:30:52 -05:00
parent 4d4a5f3807
commit 20181e9f18
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 0 deletions

View File

@ -1549,6 +1549,10 @@ 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';