private void setActualPropertiesForNestedProperties() { for (PropertyDeclarationTree propertyDeclaration : block.propertyDeclarations()) { propertyDeclaration.property().setProperty(namespace.property().text() + "-" + propertyDeclaration.property().property().text()); } }
private PropertyDeclarationTree getSecondToLastSrcPropertyDeclaration(List<PropertyDeclarationTree> declarations) { PropertyDeclarationTree srcSecondToLastPropertyDeclaration = null; PropertyDeclarationTree srcLastPropertyDeclaration = null; for (PropertyDeclarationTree declaration : declarations) { if (declaration.property().standardProperty() instanceof Src) { srcSecondToLastPropertyDeclaration = srcLastPropertyDeclaration; srcLastPropertyDeclaration = declaration; } } return srcSecondToLastPropertyDeclaration; }
private List<String> missingGradients(RulesetTree tree) { List<String> missingGradients = new ArrayList<>(GRADIENTS); for (PropertyDeclarationTree propertyDeclaration : tree.block().propertyDeclarations()) { for (FunctionTree function : propertyDeclaration.value().valueElementsOfType(FunctionTree.class)) { String functionName = function.function().text().toLowerCase(); if (functionName.matches(GRADIENT_MATCHER)) { missingGradients.removeIf(functionName::matches); } } } return missingGradients; }
private boolean propertyToBeChecked(PropertyDeclarationTree tree) { if (!(tree.property().standardProperty() instanceof FontFamily)) { return false; } if (tree.parent() != null && tree.parent().parent() != null && tree.parent().parent() instanceof AtRuleTree && ((AtRuleTree) tree.parent().parent()).standardAtRule() instanceof FontFace) { return false; } return true; }
@Override public String text() { return ident != null ? ident.text() : string.actualText(); }
public static Tree rulesetIssueLocation(RulesetTree tree) { return tree.selectors() != null ? tree.selectors() : tree.block().openCurlyBrace(); }
@Override public boolean isValid(Tree tree) { if (tree instanceof PercentageTree) { if (positiveOnly) { return ((PercentageTree) tree).value().isPositive(); } return true; } return false; }
private void setActualPropertiesForNestedProperties() { for (PropertyDeclarationTree propertyDeclaration : block.propertyDeclarations()) { propertyDeclaration.property().setProperty(namespace.property().text() + "-" + propertyDeclaration.property().property().text()); } }
private PropertyDeclarationTree getLastSrcPropertyDeclaration(List<PropertyDeclarationTree> declarations) { PropertyDeclarationTree srcDeclarationNode = null; for (PropertyDeclarationTree declaration : declarations) { if (declaration.property().standardProperty() instanceof Src) { srcDeclarationNode = declaration; } } return srcDeclarationNode; }
@Override public String text() { return ident != null ? ident.text() : string.actualText(); }
@Override public boolean isValid(Tree tree) { if (tree instanceof PercentageTree) { if (positiveOnly) { return ((PercentageTree) tree).value().isPositive(); } return true; } return false; }
private PropertyDeclarationTree getSecondToLastSrcPropertyDeclaration(List<PropertyDeclarationTree> declarations) { PropertyDeclarationTree srcSecondToLastPropertyDeclaration = null; PropertyDeclarationTree srcLastPropertyDeclaration = null; for (PropertyDeclarationTree declaration : declarations) { if (declaration.property().standardProperty() instanceof Src) { srcSecondToLastPropertyDeclaration = srcLastPropertyDeclaration; srcLastPropertyDeclaration = declaration; } } return srcSecondToLastPropertyDeclaration; }
private PropertyDeclarationTree getLastSrcPropertyDeclaration(List<PropertyDeclarationTree> declarations) { PropertyDeclarationTree srcDeclarationNode = null; for (PropertyDeclarationTree declaration : declarations) { if (declaration.property().standardProperty() instanceof Src) { srcDeclarationNode = declaration; } } return srcDeclarationNode; }