for (int propIndex = 0, n = propData.size(); propIndex < n; ++propIndex) {
Pair<CssSchema.CssPropertyInfo, CssPropertyData> d
= propData.get(propIndex);
CssPropertyData data = d.b;
ObjectConstructor dataObj = new ObjectConstructor(unk);
int propBits = 0;
for (CssPropBit b : data.properties) {
propBits |= b.jsValue;
}
dataObj.appendChild(
new ValueProperty(propbitsObjKey, new IntegerLiteral(unk, propBits)));
List<Expression> litGroups = Lists.newArrayList();
for (int groupIndex : litPartition.unions[propIndex]) {
litGroups.add((Expression) QuasiBuilder.substV(
"L[@i]", "i", new IntegerLiteral(unk, groupIndex)));
}
if (!litGroups.isEmpty()) {
dataObj.appendChild(new ValueProperty(
litgroupObjKey, new ArrayConstructor(unk, litGroups)));
}
List<Expression> fnKeyStrs = Lists.newArrayList();
for (CssPropertySignature.CallSignature fn : data.fns) {
String fnKey = fnSigToData.get(fn).key;
fnKeyStrs.add(StringLiteral.valueOf(unk, fnKey));
}
ArrayConstructor fnKeyArray = new ArrayConstructor(unk, fnKeyStrs);
dataObj.appendChild(new ValueProperty(fnsObjKey, fnKeyArray));
String dataJs;
{
StringBuilder js = new StringBuilder();
JsMinimalPrinter tokenConsumer = new JsMinimalPrinter(js);
dataObj.render(new RenderContext(tokenConsumer));
tokenConsumer.noMoreTokens();
dataJs = js.toString();
}
String equivKey = dataJsToKey.get(dataJs);
Expression value = dataObj;
if (equivKey == null) {
dataJsToKey.put(dataJs, data.key);
} else {
value = StringLiteral.valueOf(unk, equivKey);
hasAliases = true;
}
cssSchemaProps.add(new ValueProperty(
unk, StringLiteral.valueOf(unk, data.key), value));
}
ObjectConstructor cssSchema = new ObjectConstructor(unk, cssSchemaProps);
ParseTreeNode js = QuasiBuilder.substV(
""
+ "var cssSchema = (function () {"
+ " @poolDecls?;"