1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00

query-selectable selectors are not necessarily sheet-selectable

Related commits:
- 4f923384de
- 97a33c9572
- ef07171f5a

For instance, with "Experimental Web Platform features" enabled, the
following filter becomes natively query-selectable:

    .fail:has(+ a > b)

Meaning uBO won't need to emulate the `:has()` operator, it will
be executed natively using `querySelectorAll()`.

This commit fixes the erroneous assumption that a query-selectable
is also sheet-selectable.
This commit is contained in:
Raymond Hill 2021-10-28 10:36:26 -04:00
parent b4adc3a44e
commit 3891b4d050
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1404,9 +1404,12 @@ Parser.prototype.SelectorCompiler = class {
const compiled = this.compileProceduralSelector(raw);
if ( compiled === undefined ) { return false; }
out.compiled = compiled.selector !== compiled.raw
? JSON.stringify(compiled)
: compiled.selector;
out.compiled =
compiled.selector !== compiled.raw ||
this.sheetSelectable(compiled.selector) === false
? JSON.stringify(compiled)
: compiled.selector;
return true;
}