Fix removal of `:scope` prefix in `:has()` operator

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/2778#issuecomment-1705101771
This commit is contained in:
Raymond Hill 2023-09-11 12:34:53 -04:00
parent d5fb3c08a1
commit 2571660161
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 1 additions and 1 deletions

View File

@ -3687,7 +3687,7 @@ class ExtSelectorCompiler {
case 'has': { case 'has': {
let r = this.astCompile(parts, { noaction: true }); let r = this.astCompile(parts, { noaction: true });
if ( typeof r === 'string' ) { if ( typeof r === 'string' ) {
r = { selector: r.replace(/^\s*:scope\s*/, ' ') }; r = { selector: r.replace(/^\s*:scope\s*/, '') };
} }
return r; return r;
} }