for (CssProperty p : x.getProperties()) {
b.append(p.getName()).append(":").append(p.getValues().getExpression());
}
String content = b.toString();
CssRule canonical = rulesByContents.get(content);
// Check everything between the canonical rule and this rule for common
// properties. If there are common properties, it would be unsafe to
// promote the rule.
if (canonical != null) {
boolean hasCommon = false;
int index = rulesInOrder.indexOf(canonical) + 1;
assert index != 0;
for (Iterator<CssRule> i = rulesInOrder.listIterator(index); i.hasNext()
&& !hasCommon;) {
hasCommon = CssResourceGenerator.haveCommonProperties(i.next(), x);
}
if (!hasCommon) {
canonical.getSelectors().addAll(x.getSelectors());
ctx.removeMe();
return false;
}
}