Skip to content
This repository was archived by the owner on Feb 23, 2022. It is now read-only.

Commit b9852d2

Browse files
committed
Suppress warning messages for whitelisted properties.
Tweak the CSS compiler to not complain about recognized properties with warnings if they are whitelisted with --allowed_unrecognized_properties. Property warnings are already disabled with the --allow_unrecognized_properties flag (see com.google.common.css.compiler.passes.PassRunner:177) so it makes sense to overload this flag to also whitelist flags that are *technically* recognized, but not supported. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133199104 MOE_MIGRATED_REVID=133703695
1 parent ca18477 commit b9852d2

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/com/google/common/css/compiler/passes/VerifyRecognizedProperties.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,19 @@ public boolean enterDeclaration(CssDeclarationNode declarationNode) {
7676
property = Property.byName(propertyName);
7777
}
7878

79-
if (!property.isRecognizedProperty() &&
80-
!allowedUnrecognizedProperties.contains(property.getName())) {
81-
reportError(String.format("%s is an unrecognized property",
82-
property.getName()), propertyNode);
83-
} else if (property.hasWarning()) {
84-
errorManager.reportWarning(new GssError(
85-
String.format(
86-
"WARNING for use of CSS property %s: %s\n",
87-
property.getName(), property.getWarning()),
88-
propertyNode.getSourceCodeLocation()));
79+
if (!allowedUnrecognizedProperties.contains(property.getName())) {
80+
if (!property.isRecognizedProperty()) {
81+
reportError(String.format("%s is an unrecognized property",
82+
property.getName()), propertyNode);
83+
} else if (property.hasWarning()) {
84+
errorManager.reportWarning(new GssError(
85+
String.format(
86+
"WARNING for use of CSS property %s: %s\n",
87+
property.getName(), property.getWarning()),
88+
propertyNode.getSourceCodeLocation()));
89+
}
8990
}
91+
9092
return true;
9193
}
9294

0 commit comments

Comments
 (0)