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
1 changed files with 4 additions and 2 deletions

View File

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