for (final ICSSProperty property : cssRule.getProperties())
{
final ICSSPropertyValue propertyValue = property.getValue();
if (propertyValue instanceof CSSFunctionCallPropertyValue)
{
final CSSFunctionCallPropertyValue functionCall = (CSSFunctionCallPropertyValue)propertyValue;
if (CSSFunctionCallPropertyValue.CLASS_REFERENCE.equals(functionCall.name))
{
// Found a ClassReference() property.
if ("null".equals(functionCall.rawArguments))
{
// Do nothing. ClassReference(null) resets the skin class.
}
else
{
final String qName;
if (CSSStringPropertyValue.isQuoted(functionCall.rawArguments))
qName = stripQuotes(functionCall.rawArguments);
else
qName = functionCall.rawArguments;
final IDefinition definition = project.resolveQNameToDefinition(qName);
// The definition is expected to be a class definition.
if (definition != null && definition instanceof IClassDefinition)
{
classReferences.add((IClassDefinition)definition);
}
else
{
final CSSUnresolvedClassReferenceProblem problem = new CSSUnresolvedClassReferenceProblem(functionCall);
problems.add(problem);
}
}
}
else if (CSSFunctionCallPropertyValue.EMBED.equals(functionCall.name))
{
final String embedMetadata = String.format("[%s(%s)]", functionCall.name, functionCall.rawArguments);
// TODO Calling normalize here prevents an assert later
// in the getFileSpecification() of Workspace. The problem is that an embed
// in default.css inside a SWC has a source path which doesn't look normalized.
final String sourcePath = FilenameNormalization.normalize(functionCall.getSourcePath());
final MetaTagsNode metadata = ASParser.parseMetadata(project.getWorkspace(), embedMetadata,
sourcePath, functionCall.getStart(),
functionCall.getLine(), functionCall.getColumn(),
problems);
final IMetaTagNode embedTag = metadata.getTagByName("Embed");
if (embedTag == null)
{
problems.add(new CSSEmbedAssetProblem(functionCall));