Skip to content

Commit 8bfc26b

Browse files
committed
avoid doing caching when the rule is still in flux -> cache removed until it is really needed
1 parent 59a85f3 commit 8bfc26b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

org/w3c/css/css/CssRuleList.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313
public class CssRuleList {
1414

1515
AtRule atRule;
16-
String atRuleString;
1716
ArrayList<CssStyleRule> rulelist;
1817
public String pseudopage;
1918
String indent;
2019

2120
public CssRuleList() {
2221
atRule = null;
23-
atRuleString = new String();
2422
rulelist = new ArrayList<CssStyleRule>();
2523
indent = new String();
2624
}
@@ -35,22 +33,22 @@ public ArrayList<CssStyleRule> getStyleRules() {
3533

3634
public void addAtRule(AtRule atRule) {
3735
this.atRule = atRule;
38-
atRuleString = atRule.toString();
3936
}
4037

4138
public String getAtRule() {
42-
return atRuleString;
39+
return (atRule != null) ? atRule.toString() : "";
4340
}
4441

4542
public String getAtRuleEscaped() {
46-
return Messages.escapeString(atRuleString);
43+
return Messages.escapeString(atRule.toString());
4744
}
4845

4946
public boolean isEmpty() {
5047
return atRule.isEmpty() /*&& rulelist.isEmpty() */;
5148
}
5249

5350
public String toString() {
51+
String atRuleString = atRule.toString();
5452
StringBuilder ret = new StringBuilder();
5553
if (null != atRule && atRule.isEmpty()) {
5654
if (atRuleString.length() != 0) {

0 commit comments

Comments
 (0)