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

Fix overzealous validation of :style() arguments

This commit is contained in:
Raymond Hill 2022-09-24 12:14:50 -04:00
parent f638da41d6
commit c698a9fcec
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1476,7 +1476,10 @@ Parser.prototype.SelectorCompiler = class {
astFromRaw(raw, type) { astFromRaw(raw, type) {
let ast; let ast;
try { try {
ast = cssTree.parse(raw, { context: type }); ast = cssTree.parse(raw, {
context: type,
parseValue: false,
});
} catch(reason) { } catch(reason) {
return; return;
} }
@ -1932,7 +1935,6 @@ Parser.prototype.SelectorCompiler = class {
if ( /image-set\(|url\(|\/\s*\/|\\|\/\*/i.test(s) ) { return; } if ( /image-set\(|url\(|\/\s*\/|\\|\/\*/i.test(s) ) { return; }
const parts = this.astFromRaw(s, 'declarationList'); const parts = this.astFromRaw(s, 'declarationList');
if ( parts === undefined ) { return; } if ( parts === undefined ) { return; }
if ( this.astHasType(parts, 'Raw') ) { return; }
if ( this.astHasType(parts, 'Declaration') === false ) { return; } if ( this.astHasType(parts, 'Declaration') === false ) { return; }
return s; return s;
} }