@Override public void visitAtRule(AtRuleTree tree) { if (tree.block() != null) { checkAtRuleOpeningCurlyBrace(tree); if (!tree.block().content().isEmpty()) { if (isOnSameLine(tree.block().openCurlyBrace(), tree.block().content().get(0))) { addPreciseIssue(tree.block().openCurlyBrace(), "Move the code following the opening curly brace to the next line."); } if (isOnSameLine(tree.block().content().get(0), tree.block().closeCurlyBrace())) { addPreciseIssue(tree.block().closeCurlyBrace(), "Move the closing curly brace to the next line."); } } } super.visitAtRule(tree); }
@Override public void visitAtRule(AtRuleTree tree) { if (tree.block() != null) { checkAtRuleOpeningCurlyBrace(tree); if (!tree.block().content().isEmpty()) { if (isOnSameLine(tree.block().openCurlyBrace(), tree.block().content().get(0))) { addPreciseIssue(tree.block().openCurlyBrace(), "Move the code following the opening curly brace to the next line."); } if (isOnSameLine(tree.block().content().get(0), tree.block().closeCurlyBrace())) { addPreciseIssue(tree.block().closeCurlyBrace(), "Move the closing curly brace to the next line."); } } } super.visitAtRule(tree); }
private void checkAtRuleOpeningCurlyBrace(AtRuleTree tree) { Preconditions.checkNotNull(tree.block()); Tree tree1 = tree.preludes() != null ? tree.preludes() : tree.atKeyword(); Tree tree2 = tree.block().openCurlyBrace(); if (!isOnSameLine(tree1, tree2)) { addPreciseIssue(tree2, "Move the opening curly brace to the previous line."); } }
private void checkAtRuleOpeningCurlyBrace(AtRuleTree tree) { Preconditions.checkNotNull(tree.block()); Tree tree1 = tree.preludes() != null ? tree.preludes() : tree.atKeyword(); Tree tree2 = tree.block().openCurlyBrace(); if (!isOnSameLine(tree1, tree2)) { addPreciseIssue(tree2, "Move the opening curly brace to the previous line."); } }
@Override public void visitAtRule(AtRuleTree tree) { if (!isFontFaceRuleToBeChecked(tree)) { return; } List<PropertyDeclarationTree> declarations = tree.block().propertyDeclarations(); if (DEEPEST_LEVEL.equals(browserSupportLevel)) { if (getSecondToLastSrcPropertyDeclaration(declarations) == null) { addPreciseIssue(tree.atKeyword(), "Add an \"src\" property setting the URL for the \".eot\" font file (to support IE9 Compatibility Modes)."); } else { checkSecondToLastSrcPropertyDeclaration(getSecondToLastSrcPropertyDeclaration(declarations)); } } checkLastSrcProperty(getLastSrcPropertyDeclaration(declarations)); super.visitAtRule(tree); }
@Override public void visitAtRule(AtRuleTree tree) { if (!isFontFaceRuleToBeChecked(tree)) { return; } List<PropertyDeclarationTree> declarations = tree.block().propertyDeclarations(); if (DEEPEST_LEVEL.equals(browserSupportLevel)) { if (getSecondToLastSrcPropertyDeclaration(declarations) == null) { addPreciseIssue(tree.atKeyword(), "Add an \"src\" property setting the URL for the \".eot\" font file (to support IE9 Compatibility Modes)."); } else { checkSecondToLastSrcPropertyDeclaration(getSecondToLastSrcPropertyDeclaration(declarations)); } } checkLastSrcProperty(getLastSrcPropertyDeclaration(declarations)); super.visitAtRule(tree); }