@Override public void visitProperty(PropertyTree tree) { if (tree.standardProperty() instanceof UnknownProperty && tree.property().isValidable() && !tree.isScssNamespace()) { addPreciseIssue(tree, "Remove this usage of the unknown \"" + tree.standardProperty().getName() + "\" property."); } super.visitProperty(tree); }
@Override public void visitProperty(PropertyTree tree) { if ("*".equals(tree.hack()) && !tree.isScssNamespace()) { addPreciseIssue(tree, "Remove this usage of the \"*\" hack."); } super.visitProperty(tree); }
@Override public void visitStatementBlock(StatementBlockTree tree) { List<PropertyDeclarationTree> declarations = tree.propertyDeclarations(); for (int i = 0; i < declarations.size(); i++) { PropertyTree currentProperty = declarations.get(i).property(); PropertyDeclarationTree nextDeclaration = i + 1 < declarations.size() ? declarations.get(i + 1) : null; if (!(currentProperty.standardProperty() instanceof UnknownProperty) && currentProperty.isVendorPrefixed() && !isNextPropertyValid(nextDeclaration, currentProperty)) { addPreciseIssue(currentProperty, "Define the standard property right after this vendor-prefixed property."); } } super.visitStatementBlock(tree); }
@Override public void visitProperty(PropertyTree tree) { if (!tree.isScssNamespace() && (tree.isVendorPrefixed() || tree.standardProperty().isExperimental())) { addPreciseIssue( tree, "Remove this usage of the experimental \"" + tree.standardProperty().getName() + "\" property."); } super.visitProperty(tree); }
@Nullable private PropertyTree firstUnsortedProperty(List<PropertyTree> propertyTrees) { for (int i = 0; i < propertyTrees.size() - 1; i++) { if (!propertyTrees.get(i).property().isInterpolated() && !propertyTrees.get(i + 1).property().isInterpolated() && propertyTrees.get(i).standardProperty().getName().compareTo(propertyTrees.get(i + 1).standardProperty().getName()) > 0) { return propertyTrees.get(i + 1); } } return null; }
private PropertyDeclarationTree getLastSrcPropertyDeclaration(List<PropertyDeclarationTree> declarations) { PropertyDeclarationTree srcDeclarationNode = null; for (PropertyDeclarationTree declaration : declarations) { if (declaration.property().standardProperty() instanceof Src) { srcDeclarationNode = declaration; } } return srcDeclarationNode; }
private Combinations isWidthOrHeight(PropertyTree tree) { String propertyName = tree.property().text(); if ("height".equalsIgnoreCase(propertyName)) { return Combinations.HEIGHT_FOUND; } else if ("width".equalsIgnoreCase(propertyName)) { return Combinations.WIDTH_FOUND; } return null; }
@Override public void visitPropertyDeclaration(PropertyDeclarationTree tree) { if (tree.property().isVendorPrefixed()) { String standardPropertyName = tree.property().standardProperty().getName(); Vendor vendor = tree.property().vendor(); if (properties.containsKey(standardPropertyName)) { properties.get(standardPropertyName).add(vendor); } else { properties.put(standardPropertyName, Sets.newHashSet(vendor)); } } super.visitPropertyDeclaration(tree); }
private void setActualPropertiesForNestedProperties() { for (PropertyDeclarationTree propertyDeclaration : block.propertyDeclarations()) { propertyDeclaration.property().setProperty(namespace.property().text() + "-" + propertyDeclaration.property().property().text()); } }
@Override public void visitProperty(PropertyTree tree) { if (tree.standardProperty().isObsolete() && !tree.isScssNamespace()) { addPreciseIssue( tree, MessageFormat.format( "Remove this usage of the obsolete / not on W3C Standards track \"{0}\" property.", tree.standardProperty().getName())); } super.visitProperty(tree); }
public ScssNestedPropertiesDeclarationTreeImpl(PropertyTree namespace, SyntaxToken colon, StatementBlockTree block) { this.namespace = namespace; this.colon = colon; this.block = block; this.namespace.setScssNamespace(true); setActualPropertiesForNestedProperties(); }
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 Combinations isWidthOrHeight(PropertyTree tree) { String propertyName = tree.property().text(); if ("height".equalsIgnoreCase(propertyName)) { return Combinations.HEIGHT_FOUND; } else if ("width".equalsIgnoreCase(propertyName)) { return Combinations.WIDTH_FOUND; } return null; }
@Override public void visitProperty(PropertyTree tree) { if (!tree.isScssNamespace() && !tree.standardProperty().getName().matches(propertiesToExclude) && (tree.isVendorPrefixed() || tree.standardProperty().isExperimental())) { addPreciseIssue( tree, "Remove this usage of the experimental \"" + tree.standardProperty().getName() + "\" property."); } super.visitProperty(tree); }
@Nullable private PropertyTree firstUnsortedProperty(List<PropertyTree> propertyTrees) { for (int i = 0; i < propertyTrees.size() - 1; i++) { if (!propertyTrees.get(i).property().isInterpolated() && !propertyTrees.get(i + 1).property().isInterpolated() && propertyTrees.get(i).standardProperty().getName().compareTo(propertyTrees.get(i + 1).standardProperty().getName()) > 0) { return propertyTrees.get(i + 1); } } return null; }
@Override public void visitPropertyDeclaration(PropertyDeclarationTree tree) { if (tree.property().isVendorPrefixed()) { String standardPropertyName = tree.property().standardProperty().getName(); Vendor vendor = tree.property().vendor(); if (properties.containsKey(standardPropertyName)) { properties.get(standardPropertyName).add(vendor); } else { properties.put(standardPropertyName, Sets.newHashSet(vendor)); } } super.visitPropertyDeclaration(tree); }
private void setActualPropertiesForNestedProperties() { for (PropertyDeclarationTree propertyDeclaration : block.propertyDeclarations()) { propertyDeclaration.property().setProperty(namespace.property().text() + "-" + propertyDeclaration.property().property().text()); } }
@Override public void visitProperty(PropertyTree tree) { if (tree.standardProperty().isObsolete() && !tree.isScssNamespace()) { addPreciseIssue( tree, MessageFormat.format( "Remove this usage of the obsolete / not on W3C Standards track \"{0}\" property.", tree.standardProperty().getName())); } super.visitProperty(tree); }
public ScssNestedPropertiesDeclarationTreeImpl(PropertyTree namespace, SyntaxToken colon, StatementBlockTree block) { this.namespace = namespace; this.colon = colon; this.block = block; this.namespace.setScssNamespace(true); setActualPropertiesForNestedProperties(); }
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; }