// This pass simply finds all the CssNodes.
visitChildren(node);
// Perform the replacments.
IdGenerator nodeIdGen = node.getNearestAncestor(SoyFileSetNode.class).getNodeIdGenerator();
for (CssNode cssNode : cssNodes) {
StandaloneNode newNode;
if (cssHandlingScheme == CssHandlingScheme.LITERAL) {
newNode = new RawTextNode(nodeIdGen.genId(), cssNode.getCommandText());
} else if (cssHandlingScheme == CssHandlingScheme.REFERENCE) {
PrintNode newPrintNode =
new PrintNode(nodeIdGen.genId(), false, cssNode.getCommandText(), null);
newPrintNode.addChild(new PrintDirectiveNode(nodeIdGen.genId(), "|noAutoescape", ""));
newNode = newPrintNode;
// Check that the expression is a valid reference.
boolean isInvalidExpr = false;
if (newPrintNode.getExprUnion().getExpr() == null) {
isInvalidExpr = true;