From d70609d5d69fbb6ff575790ce828c017ef155207 Mon Sep 17 00:00:00 2001 From: Jos van den Oever Date: Mon, 14 Jun 2010 17:38:52 +0200 Subject: [PATCH] Do not add empty rules. --- javascriptzip/style2css.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/javascriptzip/style2css.js b/javascriptzip/style2css.js index 9d7709c4..5d0df2b5 100644 --- a/javascriptzip/style2css.js +++ b/javascriptzip/style2css.js @@ -73,7 +73,7 @@ function style2css(stylesheet, stylesxmldom) { var i = iter.iterateNext(); while (i) { var rule = createRule(i); - if (rule && rule.length > 0) { + if (rule) { try { stylesheet.insertRule(rule, stylesheet.cssRules.length); } catch (e) { @@ -113,6 +113,9 @@ function style2css(stylesheet, stylesxmldom) { if (properties.length > 0) { rule += getParagraphProperties(properties.item(0)); } + if (rule.length == 0) { + return null; + } return selector + '{' + rule + '}'; }