summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormikesamuel <mikesamuel@ad8eed46-c659-4a31-e19d-951d88f54425>2014-05-14 16:33:10 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-14 16:33:10 +0000
commit65bceb75f6fdd5ac8519b092becc8507b68d55d6 (patch)
tree97285251941c87b6a8352cb6166433aefd7502d3
parent444574c7f49d5d7836d37ecf4ee6e942348dccb0 (diff)
parentaaf3076dbab1d3484717a87085e27ec21c7217d1 (diff)
downloadsanitizer-65bceb75f6fdd5ac8519b092becc8507b68d55d6.tar.gz
am aaf3076d: added main method to CssSchema to make reviewing the white-list easier
* commit 'aaf3076dbab1d3484717a87085e27ec21c7217d1': added main method to CssSchema to make reviewing the white-list easier
-rw-r--r--src/main/org/owasp/html/CssSchema.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/org/owasp/html/CssSchema.java b/src/main/org/owasp/html/CssSchema.java
index f46bcac..13ba66d 100644
--- a/src/main/org/owasp/html/CssSchema.java
+++ b/src/main/org/owasp/html/CssSchema.java
@@ -28,8 +28,11 @@
package org.owasp.html;
+import java.util.SortedSet;
+
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
/** Describes the kinds of tokens a CSS property's value can safely contain. */
final class CssSchema {
@@ -435,4 +438,21 @@ final class CssSchema {
}
return all.build();
}
+
+ /** Dumps key and literal list to stdout for easy examination. */
+ public static void main(String... argv) {
+ SortedSet<String> keys = Sets.newTreeSet();
+ SortedSet<String> literals = Sets.newTreeSet();
+ for (ImmutableMap.Entry<String, CssSchema> e : SCHEMA.entrySet()) {
+ keys.add(e.getKey());
+ literals.addAll(e.getValue().literals);
+ }
+ for (String key : keys) {
+ System.out.println(key);
+ }
+ System.out.println();
+ for (String literal : literals) {
+ System.out.println(literal);
+ }
+ }
}