Fix css parsing error
parent
d1c29d01a8
commit
54bc773d09
|
@ -259,6 +259,10 @@ SyncerWeb.prototype.post_sync = function*(req, res)
|
||||||
function rewriteCss(ast)
|
function rewriteCss(ast)
|
||||||
{
|
{
|
||||||
var rules = ast.rules || ast.stylesheet && ast.stylesheet.rules;
|
var rules = ast.rules || ast.stylesheet && ast.stylesheet.rules;
|
||||||
|
if (ast.stylesheet && ast.stylesheet.parsingErrors)
|
||||||
|
{
|
||||||
|
delete ast.stylesheet.parsingErrors;
|
||||||
|
}
|
||||||
if (rules)
|
if (rules)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < rules.length; i++)
|
for (var i = 0; i < rules.length; i++)
|
||||||
|
@ -268,6 +272,8 @@ function rewriteCss(ast)
|
||||||
// prune @document instructions (may spy on current URL)
|
// prune @document instructions (may spy on current URL)
|
||||||
rules.splice(i--, 1);
|
rules.splice(i--, 1);
|
||||||
}
|
}
|
||||||
|
else if (rules[i].type == 'rule' && (!rules[i].selectors || !rules[i].declarations))
|
||||||
|
rules.splice(i--, 1);
|
||||||
else
|
else
|
||||||
rewriteCss(rules[i]);
|
rewriteCss(rules[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue