diff options
author | mikesamuel <mikesamuel@ad8eed46-c659-4a31-e19d-951d88f54425> | 2014-05-14 16:33:12 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-14 16:33:12 +0000 |
commit | 4b1f2c4d2693696e83f8f4b750ce6dd4210eaca7 (patch) | |
tree | c313c9985796dddcf43ff5688738fe8c70cfd381 | |
parent | 11e80a5cba6a24bd754d2d01f22a337758e510d4 (diff) | |
parent | ce5bde40e2e126de05105f09f1f965a5c70aaa94 (diff) | |
download | sanitizer-4b1f2c4d2693696e83f8f4b750ce6dd4210eaca7.tar.gz |
am ce5bde40: cosmetic fixes to source code : line wrapping and comments
* commit 'ce5bde40e2e126de05105f09f1f965a5c70aaa94':
cosmetic fixes to source code : line wrapping and comments
-rw-r--r-- | src/main/org/owasp/html/CssSchema.java | 511 | ||||
-rw-r--r-- | src/main/org/owasp/html/Encoding.java | 3 | ||||
-rw-r--r-- | src/main/org/owasp/html/HtmlPolicyBuilder.java | 4 | ||||
-rw-r--r-- | src/main/org/owasp/html/Sanitizers.java | 3 | ||||
-rw-r--r-- | src/main/org/owasp/html/StylingPolicy.java | 13 | ||||
-rw-r--r-- | src/main/org/owasp/html/TagBalancingHtmlStreamEventReceiver.java | 5 |
6 files changed, 390 insertions, 149 deletions
diff --git a/src/main/org/owasp/html/CssSchema.java b/src/main/org/owasp/html/CssSchema.java index 3e77fa1..b0739f7 100644 --- a/src/main/org/owasp/html/CssSchema.java +++ b/src/main/org/owasp/html/CssSchema.java @@ -88,191 +88,379 @@ public final class CssSchema { = ImmutableMap.builder(); ImmutableSet<String> mozBorderRadiusLiterals0 = ImmutableSet.of("/"); ImmutableSet<String> mozOpacityLiterals0 = ImmutableSet.of("inherit"); - ImmutableSet<String> mozOutlineLiterals0 = ImmutableSet.of("aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"); - ImmutableSet<String> mozOutlineLiterals1 = ImmutableSet.of("dashed", "dotted", "double", "groove", "outset", "ridge", "solid"); + ImmutableSet<String> mozOutlineLiterals0 = ImmutableSet.of( + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", + "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", + "darkgoldenrod", "darkgray", "darkgreen", "darkkhaki", "darkmagenta", + "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", + "darkseagreen", "darkslateblue", "darkslategray", "darkturquoise", + "darkviolet", "deeppink", "deepskyblue", "dimgray", "dodgerblue", + "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", + "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", + "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", + "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", + "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgreen", + "lightgrey", "lightpink", "lightsalmon", "lightseagreen", + "lightskyblue", "lightslategray", "lightsteelblue", "lightyellow", + "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", + "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", + "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", + "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", + "orange", "orangered", "orchid", "palegoldenrod", "palegreen", + "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", + "pink", "plum", "powderblue", "purple", "red", "rosybrown", "royalblue", + "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", + "silver", "skyblue", "slateblue", "slategray", "snow", "springgreen", + "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", + "wheat", "white", "whitesmoke", "yellow", "yellowgreen"); + ImmutableSet<String> mozOutlineLiterals1 = ImmutableSet.of( + "dashed", "dotted", "double", "groove", "outset", "ridge", "solid"); ImmutableSet<String> mozOutlineLiterals2 = ImmutableSet.of("thick", "thin"); - ImmutableSet<String> mozOutlineLiterals3 = ImmutableSet.of("hidden", "inherit", "inset", "invert", "medium", "none"); - ImmutableMap<String, String> mozOutlineFunctions = ImmutableMap.<String, String>of("rgb(", "rgb()", "rgba(", "rgba()"); - ImmutableSet<String> mozOutlineColorLiterals0 = ImmutableSet.of("inherit", "invert"); - ImmutableSet<String> mozOutlineStyleLiterals0 = ImmutableSet.of("hidden", "inherit", "inset", "none"); - ImmutableSet<String> mozOutlineWidthLiterals0 = ImmutableSet.of("inherit", "medium"); - ImmutableSet<String> oTextOverflowLiterals0 = ImmutableSet.of("clip", "ellipsis"); - ImmutableSet<String> azimuthLiterals0 = ImmutableSet.of("behind", "center-left", "center-right", "far-left", "far-right", "left-side", "leftwards", "right-side", "rightwards"); + ImmutableSet<String> mozOutlineLiterals3 = ImmutableSet.of( + "hidden", "inherit", "inset", "invert", "medium", "none"); + ImmutableMap<String, String> mozOutlineFunctions = + ImmutableMap.<String, String>of("rgb(", "rgb()", "rgba(", "rgba()"); + ImmutableSet<String> mozOutlineColorLiterals0 = + ImmutableSet.of("inherit", "invert"); + ImmutableSet<String> mozOutlineStyleLiterals0 = + ImmutableSet.of("hidden", "inherit", "inset", "none"); + ImmutableSet<String> mozOutlineWidthLiterals0 = + ImmutableSet.of("inherit", "medium"); + ImmutableSet<String> oTextOverflowLiterals0 = + ImmutableSet.of("clip", "ellipsis"); + ImmutableSet<String> azimuthLiterals0 = ImmutableSet.of( + "behind", "center-left", "center-right", "far-left", "far-right", + "left-side", "leftwards", "right-side", "rightwards"); ImmutableSet<String> azimuthLiterals1 = ImmutableSet.of("left", "right"); - ImmutableSet<String> azimuthLiterals2 = ImmutableSet.of("center", "inherit"); - ImmutableSet<String> backgroundLiterals0 = ImmutableSet.of("border-box", "contain", "content-box", "cover", "padding-box"); - ImmutableSet<String> backgroundLiterals1 = ImmutableSet.of("no-repeat", "repeat-x", "repeat-y", "round", "space"); + ImmutableSet<String> azimuthLiterals2 = + ImmutableSet.of("center", "inherit"); + ImmutableSet<String> backgroundLiterals0 = ImmutableSet.of( + "border-box", "contain", "content-box", "cover", "padding-box"); + ImmutableSet<String> backgroundLiterals1 = + ImmutableSet.of("no-repeat", "repeat-x", "repeat-y", "round", "space"); ImmutableSet<String> backgroundLiterals2 = ImmutableSet.of("bottom", "top"); - ImmutableSet<String> backgroundLiterals3 = ImmutableSet.of(",", "/", "auto", "center", "fixed", "inherit", "local", "none", "repeat", "scroll", "transparent"); - ImmutableMap<String, String> backgroundFunctions = ImmutableMap.<String, String>builder().put("image(", "image()").put("linear-gradient(", "linear-gradient()").put("radial-gradient(", "radial-gradient()").put("repeating-linear-gradient(", "repeating-linear-gradient()").put("repeating-radial-gradient(", "repeating-radial-gradient()").put("rgb(", "rgb()").put("rgba(", "rgba()").build(); - ImmutableSet<String> backgroundAttachmentLiterals0 = ImmutableSet.of(",", "fixed", "local", "scroll"); - ImmutableSet<String> backgroundColorLiterals0 = ImmutableSet.of("inherit", "transparent"); - ImmutableSet<String> backgroundImageLiterals0 = ImmutableSet.of(",", "none"); - ImmutableMap<String, String> backgroundImageFunctions = ImmutableMap.<String, String>of("image(", "image()", "linear-gradient(", "linear-gradient()", "radial-gradient(", "radial-gradient()", "repeating-linear-gradient(", "repeating-linear-gradient()", "repeating-radial-gradient(", "repeating-radial-gradient()"); - ImmutableSet<String> backgroundPositionLiterals0 = ImmutableSet.of(",", "center"); - ImmutableSet<String> backgroundRepeatLiterals0 = ImmutableSet.of(",", "repeat"); - ImmutableSet<String> borderLiterals0 = ImmutableSet.of("hidden", "inherit", "inset", "medium", "none", "transparent"); - ImmutableSet<String> borderCollapseLiterals0 = ImmutableSet.of("collapse", "inherit", "separate"); + ImmutableSet<String> backgroundLiterals3 = ImmutableSet.of( + ",", "/", "auto", "center", "fixed", "inherit", "local", "none", + "repeat", "scroll", "transparent"); + ImmutableMap<String, String> backgroundFunctions = + ImmutableMap.<String, String>builder() + .put("image(", "image()") + .put("linear-gradient(", "linear-gradient()") + .put("radial-gradient(", "radial-gradient()") + .put("repeating-linear-gradient(", "repeating-linear-gradient()") + .put("repeating-radial-gradient(", "repeating-radial-gradient()") + .put("rgb(", "rgb()").put("rgba(", "rgba()") + .build(); + ImmutableSet<String> backgroundAttachmentLiterals0 = + ImmutableSet.of(",", "fixed", "local", "scroll"); + ImmutableSet<String> backgroundColorLiterals0 = + ImmutableSet.of("inherit", "transparent"); + ImmutableSet<String> backgroundImageLiterals0 = + ImmutableSet.of(",", "none"); + ImmutableMap<String, String> backgroundImageFunctions = + ImmutableMap.<String, String>of( + "image(", "image()", + "linear-gradient(", "linear-gradient()", + "radial-gradient(", "radial-gradient()", + "repeating-linear-gradient(", "repeating-linear-gradient()", + "repeating-radial-gradient(", "repeating-radial-gradient()"); + ImmutableSet<String> backgroundPositionLiterals0 = ImmutableSet.of( + ",", "center"); + ImmutableSet<String> backgroundRepeatLiterals0 = ImmutableSet.of( + ",", "repeat"); + ImmutableSet<String> borderLiterals0 = ImmutableSet.of( + "hidden", "inherit", "inset", "medium", "none", "transparent"); + ImmutableSet<String> borderCollapseLiterals0 = ImmutableSet.of( + "collapse", "inherit", "separate"); ImmutableSet<String> bottomLiterals0 = ImmutableSet.of("auto", "inherit"); - ImmutableSet<String> boxShadowLiterals0 = ImmutableSet.of(",", "inset", "none"); - //ImmutableSet<String> clearLiterals0 = ImmutableSet.of("both", "inherit", "none"); - //ImmutableMap<String, String> clipFunctions = ImmutableMap.<String, String>of("rect(", "rect()"); + ImmutableSet<String> boxShadowLiterals0 = ImmutableSet.of( + ",", "inset", "none"); + //ImmutableSet<String> clearLiterals0 = ImmutableSet.of( + // "both", "inherit", "none"); + //ImmutableMap<String, String> clipFunctions = + // ImmutableMap.<String, String>of("rect(", "rect()"); ImmutableSet<String> contentLiterals0 = ImmutableSet.of("none", "normal"); ImmutableSet<String> cueLiterals0 = ImmutableSet.of("inherit", "none"); - //ImmutableSet<String> cursorLiterals0 = ImmutableSet.of("all-scroll", "col-resize", "crosshair", "default", "e-resize", "hand", "help", "move", "n-resize", "ne-resize", "no-drop", "not-allowed", "nw-resize", "pointer", "progress", "row-resize", "s-resize", "se-resize", "sw-resize", "text", "vertical-text", "w-resize", "wait"); - //ImmutableSet<String> cursorLiterals1 = ImmutableSet.of(",", "auto", "inherit"); + //ImmutableSet<String> cursorLiterals0 = ImmutableSet.of( + // "all-scroll", "col-resize", "crosshair", "default", "e-resize", + // "hand", "help", "move", "n-resize", "ne-resize", "no-drop", + // "not-allowed", "nw-resize", "pointer", "progress", "row-resize", + // "s-resize", "se-resize", "sw-resize", "text", "vertical-text", + // "w-resize", "wait"); + //ImmutableSet<String> cursorLiterals1 = ImmutableSet.of( + // ",", "auto", "inherit"); ImmutableSet<String> directionLiterals0 = ImmutableSet.of("ltr", "rtl"); - //ImmutableSet<String> displayLiterals0 = ImmutableSet.of("-moz-inline-box", "-moz-inline-stack", "block", "inline", "inline-block", "inline-table", "list-item", "run-in", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row", "table-row-group"); - ImmutableSet<String> elevationLiterals0 = ImmutableSet.of("above", "below", "higher", "level", "lower"); + //ImmutableSet<String> displayLiterals0 = ImmutableSet.of( + // "-moz-inline-box", "-moz-inline-stack", "block", "inline", + // "inline-block", "inline-table", "list-item", "run-in", "table", + // "table-caption", "table-cell", "table-column", "table-column-group", + // "table-footer-group", "table-header-group", "table-row", + // "table-row-group"); + ImmutableSet<String> elevationLiterals0 = ImmutableSet.of( + "above", "below", "higher", "level", "lower"); ImmutableSet<String> emptyCellsLiterals0 = ImmutableSet.of("hide", "show"); - //ImmutableMap<String, String> filterFunctions = ImmutableMap.<String, String>of("alpha(", "alpha()"); - ImmutableSet<String> fontLiterals0 = ImmutableSet.of("100", "200", "300", "400", "500", "600", "700", "800", "900", "bold", "bolder", "lighter"); - ImmutableSet<String> fontLiterals1 = ImmutableSet.of("large", "larger", "small", "smaller", "x-large", "x-small", "xx-large", "xx-small"); - ImmutableSet<String> fontLiterals2 = ImmutableSet.of("caption", "icon", "menu", "message-box", "small-caption", "status-bar"); - ImmutableSet<String> fontLiterals3 = ImmutableSet.of("cursive", "fantasy", "monospace", "sans-serif", "serif"); + //ImmutableMap<String, String> filterFunctions = + // ImmutableMap.<String, String>of("alpha(", "alpha()"); + ImmutableSet<String> fontLiterals0 = ImmutableSet.of( + "100", "200", "300", "400", "500", "600", "700", "800", "900", "bold", + "bolder", "lighter"); + ImmutableSet<String> fontLiterals1 = ImmutableSet.of( + "large", "larger", "small", "smaller", "x-large", "x-small", + "xx-large", "xx-small"); + ImmutableSet<String> fontLiterals2 = ImmutableSet.of( + "caption", "icon", "menu", "message-box", "small-caption", + "status-bar"); + ImmutableSet<String> fontLiterals3 = ImmutableSet.of( + "cursive", "fantasy", "monospace", "sans-serif", "serif"); ImmutableSet<String> fontLiterals4 = ImmutableSet.of("italic", "oblique"); - ImmutableSet<String> fontLiterals5 = ImmutableSet.of(",", "/", "inherit", "medium", "normal", "small-caps"); + ImmutableSet<String> fontLiterals5 = ImmutableSet.of( + ",", "/", "inherit", "medium", "normal", "small-caps"); ImmutableSet<String> fontFamilyLiterals0 = ImmutableSet.of(",", "inherit"); - ImmutableSet<String> fontStretchLiterals0 = ImmutableSet.of("condensed", "expanded", "extra-condensed", "extra-expanded", "narrower", "semi-condensed", "semi-expanded", "ultra-condensed", "ultra-expanded", "wider"); + ImmutableSet<String> fontStretchLiterals0 = ImmutableSet.of( + "condensed", "expanded", "extra-condensed", "extra-expanded", + "narrower", "semi-condensed", "semi-expanded", "ultra-condensed", + "ultra-expanded", "wider"); ImmutableSet<String> fontStretchLiterals1 = ImmutableSet.of("normal"); - ImmutableSet<String> fontStyleLiterals0 = ImmutableSet.of("inherit", "normal"); - ImmutableSet<String> fontVariantLiterals0 = ImmutableSet.of("inherit", "normal", "small-caps"); - ImmutableSet<String> listStyleLiterals0 = ImmutableSet.of("armenian", "cjk-decimal", "decimal", "decimal-leading-zero", "disc", "disclosure-closed", "disclosure-open", "ethiopic-numeric", "georgian", "hebrew", "hiragana", "hiragana-iroha", "japanese-formal", "japanese-informal", "katakana", "katakana-iroha", "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", "lower-alpha", "lower-greek", "lower-latin", "lower-roman", "simp-chinese-formal", "simp-chinese-informal", "square", "trad-chinese-formal", "trad-chinese-informal", "upper-alpha", "upper-latin", "upper-roman"); - ImmutableSet<String> listStyleLiterals1 = ImmutableSet.of("inside", "outside"); - ImmutableSet<String> listStyleLiterals2 = ImmutableSet.of("circle", "inherit", "none"); - ImmutableSet<String> maxHeightLiterals0 = ImmutableSet.of("auto", "inherit", "none"); - //ImmutableSet<String> overflowLiterals0 = ImmutableSet.of("auto", "hidden", "inherit", "scroll", "visible"); - //ImmutableSet<String> overflowXLiterals0 = ImmutableSet.of("no-content", "no-display"); - //ImmutableSet<String> overflowXLiterals1 = ImmutableSet.of("auto", "hidden", "scroll", "visible"); - //ImmutableSet<String> pageBreakAfterLiterals0 = ImmutableSet.of("always", "auto", "avoid", "inherit"); - //ImmutableSet<String> pageBreakInsideLiterals0 = ImmutableSet.of("auto", "avoid", "inherit"); - ImmutableSet<String> pitchLiterals0 = ImmutableSet.of("high", "low", "x-high", "x-low"); - //ImmutableSet<String> playDuringLiterals0 = ImmutableSet.of("auto", "inherit", "mix", "none", "repeat"); - //ImmutableSet<String> positionLiterals0 = ImmutableSet.of("absolute", "relative", "static"); - ImmutableSet<String> speakLiterals0 = ImmutableSet.of("inherit", "none", "normal", "spell-out"); - ImmutableSet<String> speakHeaderLiterals0 = ImmutableSet.of("always", "inherit", "once"); - ImmutableSet<String> speakNumeralLiterals0 = ImmutableSet.of("continuous", "digits"); - ImmutableSet<String> speakPunctuationLiterals0 = ImmutableSet.of("code", "inherit", "none"); - ImmutableSet<String> speechRateLiterals0 = ImmutableSet.of("fast", "faster", "slow", "slower", "x-fast", "x-slow"); - ImmutableSet<String> tableLayoutLiterals0 = ImmutableSet.of("auto", "fixed", "inherit"); - ImmutableSet<String> textAlignLiterals0 = ImmutableSet.of("center", "inherit", "justify"); - ImmutableSet<String> textDecorationLiterals0 = ImmutableSet.of("blink", "line-through", "overline", "underline"); - ImmutableSet<String> textTransformLiterals0 = ImmutableSet.of("capitalize", "lowercase", "uppercase"); - ImmutableSet<String> textWrapLiterals0 = ImmutableSet.of("suppress", "unrestricted"); - ImmutableSet<String> unicodeBidiLiterals0 = ImmutableSet.of("bidi-override", "embed"); - ImmutableSet<String> verticalAlignLiterals0 = ImmutableSet.of("baseline", "middle", "sub", "super", "text-bottom", "text-top"); - //ImmutableSet<String> visibilityLiterals0 = ImmutableSet.of("collapse", "hidden", "inherit", "visible"); - ImmutableSet<String> voiceFamilyLiterals0 = ImmutableSet.of("child", "female", "male"); - ImmutableSet<String> volumeLiterals0 = ImmutableSet.of("loud", "silent", "soft", "x-loud", "x-soft"); - ImmutableSet<String> whiteSpaceLiterals0 = ImmutableSet.of("-moz-pre-wrap", "-o-pre-wrap", "-pre-wrap", "nowrap", "pre", "pre-line", "pre-wrap"); - ImmutableSet<String> wordWrapLiterals0 = ImmutableSet.of("break-word", "normal"); + ImmutableSet<String> fontStyleLiterals0 = ImmutableSet.of( + "inherit", "normal"); + ImmutableSet<String> fontVariantLiterals0 = ImmutableSet.of( + "inherit", "normal", "small-caps"); + ImmutableSet<String> listStyleLiterals0 = ImmutableSet.of( + "armenian", "cjk-decimal", "decimal", "decimal-leading-zero", "disc", + "disclosure-closed", "disclosure-open", "ethiopic-numeric", "georgian", + "hebrew", "hiragana", "hiragana-iroha", "japanese-formal", + "japanese-informal", "katakana", "katakana-iroha", + "korean-hangul-formal", "korean-hanja-formal", + "korean-hanja-informal", "lower-alpha", "lower-greek", "lower-latin", + "lower-roman", "simp-chinese-formal", "simp-chinese-informal", + "square", "trad-chinese-formal", "trad-chinese-informal", + "upper-alpha", "upper-latin", "upper-roman"); + ImmutableSet<String> listStyleLiterals1 = ImmutableSet.of( + "inside", "outside"); + ImmutableSet<String> listStyleLiterals2 = ImmutableSet.of( + "circle", "inherit", "none"); + ImmutableSet<String> maxHeightLiterals0 = ImmutableSet.of( + "auto", "inherit", "none"); + //ImmutableSet<String> overflowLiterals0 = ImmutableSet.of( + // "auto", "hidden", "inherit", "scroll", "visible"); + //ImmutableSet<String> overflowXLiterals0 = ImmutableSet.of( + // "no-content", "no-display"); + //ImmutableSet<String> overflowXLiterals1 = ImmutableSet.of( + // "auto", "hidden", "scroll", "visible"); + //ImmutableSet<String> pageBreakAfterLiterals0 = ImmutableSet.of( + // "always", "auto", "avoid", "inherit"); + //ImmutableSet<String> pageBreakInsideLiterals0 = ImmutableSet.of( + // "auto", "avoid", "inherit"); + ImmutableSet<String> pitchLiterals0 = ImmutableSet.of( + "high", "low", "x-high", "x-low"); + //ImmutableSet<String> playDuringLiterals0 = ImmutableSet.of( + // "auto", "inherit", "mix", "none", "repeat"); + //ImmutableSet<String> positionLiterals0 = ImmutableSet.of( + // "absolute", "relative", "static"); + ImmutableSet<String> speakLiterals0 = ImmutableSet.of( + "inherit", "none", "normal", "spell-out"); + ImmutableSet<String> speakHeaderLiterals0 = ImmutableSet.of( + "always", "inherit", "once"); + ImmutableSet<String> speakNumeralLiterals0 = ImmutableSet.of( + "continuous", "digits"); + ImmutableSet<String> speakPunctuationLiterals0 = ImmutableSet.of( + "code", "inherit", "none"); + ImmutableSet<String> speechRateLiterals0 = ImmutableSet.of( + "fast", "faster", "slow", "slower", "x-fast", "x-slow"); + ImmutableSet<String> tableLayoutLiterals0 = ImmutableSet.of( + "auto", "fixed", "inherit"); + ImmutableSet<String> textAlignLiterals0 = ImmutableSet.of( + "center", "inherit", "justify"); + ImmutableSet<String> textDecorationLiterals0 = ImmutableSet.of( + "blink", "line-through", "overline", "underline"); + ImmutableSet<String> textTransformLiterals0 = ImmutableSet.of( + "capitalize", "lowercase", "uppercase"); + ImmutableSet<String> textWrapLiterals0 = ImmutableSet.of( + "suppress", "unrestricted"); + ImmutableSet<String> unicodeBidiLiterals0 = ImmutableSet.of( + "bidi-override", "embed"); + ImmutableSet<String> verticalAlignLiterals0 = ImmutableSet.of( + "baseline", "middle", "sub", "super", "text-bottom", "text-top"); + //ImmutableSet<String> visibilityLiterals0 = ImmutableSet.of( + // "collapse", "hidden", "inherit", "visible"); + ImmutableSet<String> voiceFamilyLiterals0 = ImmutableSet.of( + "child", "female", "male"); + ImmutableSet<String> volumeLiterals0 = ImmutableSet.of( + "loud", "silent", "soft", "x-loud", "x-soft"); + ImmutableSet<String> whiteSpaceLiterals0 = ImmutableSet.of( + "-moz-pre-wrap", "-o-pre-wrap", "-pre-wrap", "nowrap", "pre", + "pre-line", "pre-wrap"); + ImmutableSet<String> wordWrapLiterals0 = ImmutableSet.of( + "break-word", "normal"); ImmutableSet<String> rgb$FunLiterals0 = ImmutableSet.of(","); - ImmutableSet<String> linearGradient$FunLiterals0 = ImmutableSet.of(",", "to"); - ImmutableSet<String> radialGradient$FunLiterals0 = ImmutableSet.of("at", "closest-corner", "closest-side", "ellipse", "farthest-corner", "farthest-side"); - ImmutableSet<String> radialGradient$FunLiterals1 = ImmutableSet.of(",", "center", "circle"); + ImmutableSet<String> linearGradient$FunLiterals0 = ImmutableSet.of( + ",", "to"); + ImmutableSet<String> radialGradient$FunLiterals0 = ImmutableSet.of( + "at", "closest-corner", "closest-side", "ellipse", "farthest-corner", + "farthest-side"); + ImmutableSet<String> radialGradient$FunLiterals1 = ImmutableSet.of( + ",", "center", "circle"); ImmutableSet<String> rect$FunLiterals0 = ImmutableSet.of(",", "auto"); ImmutableSet<String> alpha$FunLiterals0 = ImmutableSet.of("=", "opacity"); - Property mozBorderRadius = new Property(5, mozBorderRadiusLiterals0, zeroFns); + Property mozBorderRadius = + new Property(5, mozBorderRadiusLiterals0, zeroFns); builder.put("-moz-border-radius", mozBorderRadius); - Property mozBorderRadiusBottomleft = new Property(5, ImmutableSet.<String>of(), zeroFns); + Property mozBorderRadiusBottomleft = + new Property(5, ImmutableSet.<String>of(), zeroFns); builder.put("-moz-border-radius-bottomleft", mozBorderRadiusBottomleft); - //CssSchema mozOpacity = new CssSchema(1, mozOpacityLiterals0, zeroFns); + //CssSchema mozOpacity = new Property(1, mozOpacityLiterals0, zeroFns); //builder.put("-moz-opacity", mozOpacity); @SuppressWarnings("unchecked") - Property mozOutline = new Property(7, union(mozOutlineLiterals0, mozOutlineLiterals1, mozOutlineLiterals2, mozOutlineLiterals3), mozOutlineFunctions); + Property mozOutline = new Property( + 7, + union(mozOutlineLiterals0, mozOutlineLiterals1, mozOutlineLiterals2, + mozOutlineLiterals3), + mozOutlineFunctions); builder.put("-moz-outline", mozOutline); @SuppressWarnings("unchecked") - Property mozOutlineColor = new Property(2, union(mozOutlineColorLiterals0, mozOutlineLiterals0), mozOutlineFunctions); + Property mozOutlineColor = new Property( + 2, union(mozOutlineColorLiterals0, mozOutlineLiterals0), + mozOutlineFunctions); builder.put("-moz-outline-color", mozOutlineColor); @SuppressWarnings("unchecked") - Property mozOutlineStyle = new Property(0, union(mozOutlineLiterals1, mozOutlineStyleLiterals0), zeroFns); + Property mozOutlineStyle = new Property( + 0, union(mozOutlineLiterals1, mozOutlineStyleLiterals0), zeroFns); builder.put("-moz-outline-style", mozOutlineStyle); @SuppressWarnings("unchecked") - Property mozOutlineWidth = new Property(5, union(mozOutlineLiterals2, mozOutlineWidthLiterals0), zeroFns); + Property mozOutlineWidth = new Property( + 5, union(mozOutlineLiterals2, mozOutlineWidthLiterals0), zeroFns); builder.put("-moz-outline-width", mozOutlineWidth); Property oTextOverflow = new Property(0, oTextOverflowLiterals0, zeroFns); builder.put("-o-text-overflow", oTextOverflow); @SuppressWarnings("unchecked") - Property azimuth = new Property(5, union(azimuthLiterals0, azimuthLiterals1, azimuthLiterals2), zeroFns); + Property azimuth = new Property( + 5, union(azimuthLiterals0, azimuthLiterals1, azimuthLiterals2), + zeroFns); builder.put("azimuth", azimuth); @SuppressWarnings("unchecked") - Property background = new Property(23, union(azimuthLiterals1, backgroundLiterals0, backgroundLiterals1, backgroundLiterals2, backgroundLiterals3, mozOutlineLiterals0), backgroundFunctions); + Property background = new Property( + 23, + union(azimuthLiterals1, backgroundLiterals0, backgroundLiterals1, + backgroundLiterals2, backgroundLiterals3, mozOutlineLiterals0), + backgroundFunctions); builder.put("background", background); - builder.put("background-attachment", new Property(0, backgroundAttachmentLiterals0, zeroFns)); + builder.put("background-attachment", + new Property(0, backgroundAttachmentLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property backgroundColor = new Property(258, union(backgroundColorLiterals0, mozOutlineLiterals0), mozOutlineFunctions); + Property backgroundColor = new Property( + 258, union(backgroundColorLiterals0, mozOutlineLiterals0), + mozOutlineFunctions); builder.put("background-color", backgroundColor); - builder.put("background-image", new Property(16, backgroundImageLiterals0, backgroundImageFunctions)); - @SuppressWarnings("unchecked") - Property backgroundPosition = new Property(5, union(azimuthLiterals1, backgroundLiterals2, backgroundPositionLiterals0), zeroFns); + builder.put("background-image", + new Property(16, backgroundImageLiterals0, + backgroundImageFunctions)); + @SuppressWarnings("unchecked") + Property backgroundPosition = new Property( + 5, + union(azimuthLiterals1, backgroundLiterals2, + backgroundPositionLiterals0), + zeroFns); builder.put("background-position", backgroundPosition); @SuppressWarnings("unchecked") - Property backgroundRepeat = new Property(0, union(backgroundLiterals1, backgroundRepeatLiterals0), zeroFns); + Property backgroundRepeat = new Property( + 0, union(backgroundLiterals1, backgroundRepeatLiterals0), zeroFns); builder.put("background-repeat", backgroundRepeat); @SuppressWarnings("unchecked") - Property border = new Property(7, union(borderLiterals0, mozOutlineLiterals0, mozOutlineLiterals1, mozOutlineLiterals2), mozOutlineFunctions); + Property border = new Property( + 7, + union(borderLiterals0, mozOutlineLiterals0, mozOutlineLiterals1, + mozOutlineLiterals2), + mozOutlineFunctions); builder.put("border", border); @SuppressWarnings("unchecked") - Property borderBottomColor = new Property(2, union(backgroundColorLiterals0, mozOutlineLiterals0), mozOutlineFunctions); + Property borderBottomColor = new Property( + 2, union(backgroundColorLiterals0, mozOutlineLiterals0), + mozOutlineFunctions); builder.put("border-bottom-color", borderBottomColor); - builder.put("border-collapse", new Property(0, borderCollapseLiterals0, zeroFns)); + builder.put("border-collapse", + new Property(0, borderCollapseLiterals0, zeroFns)); Property borderSpacing = new Property(5, mozOpacityLiterals0, zeroFns); builder.put("border-spacing", borderSpacing); - //CssSchema bottom = new CssSchema(5, bottomLiterals0, zeroFns); + //Property bottom = new Property(5, bottomLiterals0, zeroFns); //builder.put("bottom", bottom); @SuppressWarnings("unchecked") - Property boxShadow = new Property(7, union(boxShadowLiterals0, mozOutlineLiterals0), mozOutlineFunctions); + Property boxShadow = new Property( + 7, union(boxShadowLiterals0, mozOutlineLiterals0), mozOutlineFunctions); builder.put("box-shadow", boxShadow); @SuppressWarnings("unchecked") - Property captionSide = new Property(0, union(backgroundLiterals2, mozOpacityLiterals0), zeroFns); + Property captionSide = new Property( + 0, union(backgroundLiterals2, mozOpacityLiterals0), zeroFns); builder.put("caption-side", captionSide); //@SuppressWarnings("unchecked") - //CssSchema clear = new CssSchema(0, union(azimuthLiterals1, clearLiterals0), zeroFns); + //Property clear = new Property( + // 0, union(azimuthLiterals1, clearLiterals0), zeroFns); //builder.put("clear", clear); - //builder.put("clip", new CssSchema(0, bottomLiterals0, clipFunctions)); + //builder.put("clip", new Property(0, bottomLiterals0, clipFunctions)); @SuppressWarnings("unchecked") - Property color = new Property(258, union(mozOpacityLiterals0, mozOutlineLiterals0), mozOutlineFunctions); + Property color = new Property( + 258, union(mozOpacityLiterals0, mozOutlineLiterals0), + mozOutlineFunctions); builder.put("color", color); - //builder.put("content", new CssSchema(8, contentLiterals0, zeroFns)); + //builder.put("content", new Property(8, contentLiterals0, zeroFns)); Property cue = new Property(16, cueLiterals0, zeroFns); builder.put("cue", cue); //@SuppressWarnings("unchecked") - //CssSchema cursor = new CssSchema(272, union(cursorLiterals0, cursorLiterals1), zeroFns); + //Property cursor = new Property( + // 272, union(cursorLiterals0, cursorLiterals1), zeroFns); //builder.put("cursor", cursor); @SuppressWarnings("unchecked") - Property direction = new Property(0, union(directionLiterals0, mozOpacityLiterals0), zeroFns); + Property direction = new Property( + 0, union(directionLiterals0, mozOpacityLiterals0), zeroFns); builder.put("direction", direction); //@SuppressWarnings("unchecked") - //CssSchema display = new CssSchema(0, union(cueLiterals0, displayLiterals0), zeroFns); + //Property display = new Property( + // 0, union(cueLiterals0, displayLiterals0), zeroFns); //builder.put("display", display); @SuppressWarnings("unchecked") - Property elevation = new Property(5, union(elevationLiterals0, mozOpacityLiterals0), zeroFns); + Property elevation = new Property( + 5, union(elevationLiterals0, mozOpacityLiterals0), zeroFns); builder.put("elevation", elevation); @SuppressWarnings("unchecked") - Property emptyCells = new Property(0, union(emptyCellsLiterals0, mozOpacityLiterals0), zeroFns); + Property emptyCells = new Property( + 0, union(emptyCellsLiterals0, mozOpacityLiterals0), zeroFns); builder.put("empty-cells", emptyCells); - //builder.put("filter", new CssSchema(0, ImmutableSet.<String>of(), filterFunctions)); + //builder.put("filter", + // new Property(0, ImmutableSet.<String>of(), filterFunctions)); //@SuppressWarnings("unchecked") - //CssSchema cssFloat = new CssSchema(0, union(azimuthLiterals1, cueLiterals0), zeroFns); + //Property cssFloat = new Property( + // 0, union(azimuthLiterals1, cueLiterals0), zeroFns); //builder.put("float", cssFloat); @SuppressWarnings("unchecked") - Property font = new Property(73, union(fontLiterals0, fontLiterals1, fontLiterals2, fontLiterals3, fontLiterals4, fontLiterals5), zeroFns); + Property font = new Property( + 73, + union(fontLiterals0, fontLiterals1, fontLiterals2, fontLiterals3, + fontLiterals4, fontLiterals5), + zeroFns); builder.put("font", font); @SuppressWarnings("unchecked") - Property fontFamily = new Property(72, union(fontFamilyLiterals0, fontLiterals3), zeroFns); + Property fontFamily = new Property( + 72, union(fontFamilyLiterals0, fontLiterals3), zeroFns); builder.put("font-family", fontFamily); @SuppressWarnings("unchecked") - Property fontSize = new Property(1, union(fontLiterals1, mozOutlineWidthLiterals0), zeroFns); + Property fontSize = new Property( + 1, union(fontLiterals1, mozOutlineWidthLiterals0), zeroFns); builder.put("font-size", fontSize); @SuppressWarnings("unchecked") - Property fontStretch = new Property(0, union(fontStretchLiterals0, fontStretchLiterals1), zeroFns); + Property fontStretch = new Property( + 0, union(fontStretchLiterals0, fontStretchLiterals1), zeroFns); builder.put("font-stretch", fontStretch); @SuppressWarnings("unchecked") - Property fontStyle = new Property(0, union(fontLiterals4, fontStyleLiterals0), zeroFns); + Property fontStyle = new Property( + 0, union(fontLiterals4, fontStyleLiterals0), zeroFns); builder.put("font-style", fontStyle); - builder.put("font-variant", new Property(0, fontVariantLiterals0, zeroFns)); + builder.put("font-variant", new Property( + 0, fontVariantLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property fontWeight = new Property(0, union(fontLiterals0, fontStyleLiterals0), zeroFns); + Property fontWeight = new Property( + 0, union(fontLiterals0, fontStyleLiterals0), zeroFns); builder.put("font-weight", fontWeight); Property height = new Property(5, bottomLiterals0, zeroFns); builder.put("height", height); @@ -280,89 +468,126 @@ public final class CssSchema { builder.put("letter-spacing", letterSpacing); builder.put("line-height", new Property(1, fontStyleLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property listStyle = new Property(16, union(listStyleLiterals0, listStyleLiterals1, listStyleLiterals2), backgroundImageFunctions); + Property listStyle = new Property( + 16, + union(listStyleLiterals0, listStyleLiterals1, listStyleLiterals2), + backgroundImageFunctions); builder.put("list-style", listStyle); - builder.put("list-style-image", new Property(16, cueLiterals0, backgroundImageFunctions)); + builder.put("list-style-image", new Property( + 16, cueLiterals0, backgroundImageFunctions)); @SuppressWarnings("unchecked") - Property listStylePosition = new Property(0, union(listStyleLiterals1, mozOpacityLiterals0), zeroFns); + Property listStylePosition = new Property( + 0, union(listStyleLiterals1, mozOpacityLiterals0), zeroFns); builder.put("list-style-position", listStylePosition); @SuppressWarnings("unchecked") - Property listStyleType = new Property(0, union(listStyleLiterals0, listStyleLiterals2), zeroFns); + Property listStyleType = new Property( + 0, union(listStyleLiterals0, listStyleLiterals2), zeroFns); builder.put("list-style-type", listStyleType); Property margin = new Property(1, bottomLiterals0, zeroFns); builder.put("margin", margin); Property maxHeight = new Property(1, maxHeightLiterals0, zeroFns); builder.put("max-height", maxHeight); - //CssSchema opacity = new CssSchema(1, mozOpacityLiterals0, zeroFns); + //Property opacity = new Property(1, mozOpacityLiterals0, zeroFns); //builder.put("opacity", opacity); - //builder.put("overflow", new CssSchema(0, overflowLiterals0, zeroFns)); + //builder.put("overflow", new Property(0, overflowLiterals0, zeroFns)); //@SuppressWarnings("unchecked") - //CssSchema overflowX = new CssSchema(0, union(overflowXLiterals0, overflowXLiterals1), zeroFns); + //Property overflowX = new Property( + // 0, union(overflowXLiterals0, overflowXLiterals1), zeroFns); //builder.put("overflow-x", overflowX); Property padding = new Property(1, mozOpacityLiterals0, zeroFns); builder.put("padding", padding); //@SuppressWarnings("unchecked") - //CssSchema pageBreakAfter = new CssSchema(0, union(azimuthLiterals1, pageBreakAfterLiterals0), zeroFns); + //Property pageBreakAfter = new Property( + // 0, union(azimuthLiterals1, pageBreakAfterLiterals0), zeroFns); //builder.put("page-break-after", pageBreakAfter); - //builder.put("page-break-inside", new CssSchema(0, pageBreakInsideLiterals0, zeroFns)); + //builder.put("page-break-inside", new Property( + // 0, pageBreakInsideLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property pitch = new Property(5, union(mozOutlineWidthLiterals0, pitchLiterals0), zeroFns); + Property pitch = new Property( + 5, union(mozOutlineWidthLiterals0, pitchLiterals0), zeroFns); builder.put("pitch", pitch); - //builder.put("play-during", new CssSchema(16, playDuringLiterals0, zeroFns)); + //builder.put("play-during", new Property( + // 16, playDuringLiterals0, zeroFns)); //@SuppressWarnings("unchecked") - //CssSchema position = new CssSchema(0, union(mozOpacityLiterals0, positionLiterals0), zeroFns); + //Property position = new Property( + // 0, union(mozOpacityLiterals0, positionLiterals0), zeroFns); //builder.put("position", position); builder.put("quotes", new Property(8, cueLiterals0, zeroFns)); builder.put("speak", new Property(0, speakLiterals0, zeroFns)); - builder.put("speak-header", new Property(0, speakHeaderLiterals0, zeroFns)); + builder.put("speak-header", new Property( + 0, speakHeaderLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property speakNumeral = new Property(0, union(mozOpacityLiterals0, speakNumeralLiterals0), zeroFns); + Property speakNumeral = new Property( + 0, union(mozOpacityLiterals0, speakNumeralLiterals0), zeroFns); builder.put("speak-numeral", speakNumeral); - builder.put("speak-punctuation", new Property(0, speakPunctuationLiterals0, zeroFns)); + builder.put("speak-punctuation", new Property( + 0, speakPunctuationLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property speechRate = new Property(5, union(mozOutlineWidthLiterals0, speechRateLiterals0), zeroFns); + Property speechRate = new Property( + 5, union(mozOutlineWidthLiterals0, speechRateLiterals0), zeroFns); builder.put("speech-rate", speechRate); - builder.put("table-layout", new Property(0, tableLayoutLiterals0, zeroFns)); + builder.put("table-layout", new Property( + 0, tableLayoutLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property textAlign = new Property(0, union(azimuthLiterals1, textAlignLiterals0), zeroFns); + Property textAlign = new Property( + 0, union(azimuthLiterals1, textAlignLiterals0), zeroFns); builder.put("text-align", textAlign); @SuppressWarnings("unchecked") - Property textDecoration = new Property(0, union(cueLiterals0, textDecorationLiterals0), zeroFns); + Property textDecoration = new Property( + 0, union(cueLiterals0, textDecorationLiterals0), zeroFns); builder.put("text-decoration", textDecoration); @SuppressWarnings("unchecked") - Property textTransform = new Property(0, union(cueLiterals0, textTransformLiterals0), zeroFns); + Property textTransform = new Property( + 0, union(cueLiterals0, textTransformLiterals0), zeroFns); builder.put("text-transform", textTransform); @SuppressWarnings("unchecked") - Property textWrap = new Property(0, union(contentLiterals0, textWrapLiterals0), zeroFns); + Property textWrap = new Property( + 0, union(contentLiterals0, textWrapLiterals0), zeroFns); builder.put("text-wrap", textWrap); @SuppressWarnings("unchecked") - Property unicodeBidi = new Property(0, union(fontStyleLiterals0, unicodeBidiLiterals0), zeroFns); + Property unicodeBidi = new Property( + 0, union(fontStyleLiterals0, unicodeBidiLiterals0), zeroFns); builder.put("unicode-bidi", unicodeBidi); @SuppressWarnings("unchecked") - Property verticalAlign = new Property(5, union(backgroundLiterals2, mozOpacityLiterals0, verticalAlignLiterals0), zeroFns); + Property verticalAlign = new Property( + 5, + union(backgroundLiterals2, mozOpacityLiterals0, verticalAlignLiterals0), + zeroFns); builder.put("vertical-align", verticalAlign); - //builder.put("visibility", new CssSchema(0, visibilityLiterals0, zeroFns)); + //builder.put("visibility", new Property(0, visibilityLiterals0, zeroFns)); @SuppressWarnings("unchecked") - Property voiceFamily = new Property(8, union(fontFamilyLiterals0, voiceFamilyLiterals0), zeroFns); + Property voiceFamily = new Property( + 8, union(fontFamilyLiterals0, voiceFamilyLiterals0), zeroFns); builder.put("voice-family", voiceFamily); @SuppressWarnings("unchecked") - Property volume = new Property(1, union(mozOutlineWidthLiterals0, volumeLiterals0), zeroFns); + Property volume = new Property( + 1, union(mozOutlineWidthLiterals0, volumeLiterals0), zeroFns); builder.put("volume", volume); @SuppressWarnings("unchecked") - Property whiteSpace = new Property(0, union(fontStyleLiterals0, whiteSpaceLiterals0), zeroFns); + Property whiteSpace = new Property( + 0, union(fontStyleLiterals0, whiteSpaceLiterals0), zeroFns); builder.put("white-space", whiteSpace); builder.put("word-wrap", new Property(0, wordWrapLiterals0, zeroFns)); - //builder.put("zoom", new CssSchema(1, fontStretchLiterals1, zeroFns)); + //builder.put("zoom", new Property(1, fontStretchLiterals1, zeroFns)); Property rgb$Fun = new Property(1, rgb$FunLiterals0, zeroFns); builder.put("rgb()", rgb$Fun); @SuppressWarnings("unchecked") - Property image$Fun = new Property(18, union(mozOutlineLiterals0, rgb$FunLiterals0), mozOutlineFunctions); + Property image$Fun = new Property( + 18, union(mozOutlineLiterals0, rgb$FunLiterals0), mozOutlineFunctions); builder.put("image()", image$Fun); @SuppressWarnings("unchecked") - Property linearGradient$Fun = new Property(7, union(azimuthLiterals1, backgroundLiterals2, linearGradient$FunLiterals0, mozOutlineLiterals0), mozOutlineFunctions); + Property linearGradient$Fun = new Property( + 7, + union(azimuthLiterals1, backgroundLiterals2, + linearGradient$FunLiterals0, mozOutlineLiterals0), + mozOutlineFunctions); builder.put("linear-gradient()", linearGradient$Fun); @SuppressWarnings("unchecked") - Property radialGradient$Fun = new Property(7, union(azimuthLiterals1, backgroundLiterals2, mozOutlineLiterals0, radialGradient$FunLiterals0, radialGradient$FunLiterals1), mozOutlineFunctions); + Property radialGradient$Fun = new Property( + 7, + union(azimuthLiterals1, backgroundLiterals2, mozOutlineLiterals0, + radialGradient$FunLiterals0, radialGradient$FunLiterals1), + mozOutlineFunctions); builder.put("radial-gradient()", radialGradient$Fun); builder.put("rect()", new Property(5, rect$FunLiterals0, zeroFns)); builder.put("alpha()", new Property(1, alpha$FunLiterals0, zeroFns)); @@ -371,10 +596,12 @@ public final class CssSchema { builder.put("-moz-border-radius-topright", mozBorderRadiusBottomleft); builder.put("-moz-box-shadow", boxShadow); builder.put("-webkit-border-bottom-left-radius", mozBorderRadiusBottomleft); - builder.put("-webkit-border-bottom-right-radius", mozBorderRadiusBottomleft); + builder.put("-webkit-border-bottom-right-radius", + mozBorderRadiusBottomleft); builder.put("-webkit-border-radius", mozBorderRadius); builder.put("-webkit-border-radius-bottom-left", mozBorderRadiusBottomleft); - builder.put("-webkit-border-radius-bottom-right", mozBorderRadiusBottomleft); + builder.put("-webkit-border-radius-bottom-right", + mozBorderRadiusBottomleft); builder.put("-webkit-border-radius-top-left", mozBorderRadiusBottomleft); builder.put("-webkit-border-radius-top-right", mozBorderRadiusBottomleft); builder.put("-webkit-border-top-left-radius", mozBorderRadiusBottomleft); diff --git a/src/main/org/owasp/html/Encoding.java b/src/main/org/owasp/html/Encoding.java index 3940216..080d68e 100644 --- a/src/main/org/owasp/html/Encoding.java +++ b/src/main/org/owasp/html/Encoding.java @@ -177,7 +177,8 @@ final class Encoding { if (ch <= ((char) 0xdfff)) { char next; if (i + 1 < n - && Character.isSurrogatePair(ch, next = plainText.charAt(i + 1))) { + && Character.isSurrogatePair( + ch, next = plainText.charAt(i + 1))) { // Emit supplemental codepoints as entity so that they cannot // be mis-encoded as UTF-8 of surrogates instead of UTF-8 proper // and get involved in UTF-16/UCS-2 confusion. diff --git a/src/main/org/owasp/html/HtmlPolicyBuilder.java b/src/main/org/owasp/html/HtmlPolicyBuilder.java index 8d00a31..5bd0448 100644 --- a/src/main/org/owasp/html/HtmlPolicyBuilder.java +++ b/src/main/org/owasp/html/HtmlPolicyBuilder.java @@ -416,8 +416,8 @@ public class HtmlPolicyBuilder { /** * Convert <code>style="<CSS>"</code> to sanitized CSS which allows - * color, font-size, type-face, and other styling using the default schema; but - * which does not allow content to escape its clipping context. + * color, font-size, type-face, and other styling using the default schema; + * but which does not allow content to escape its clipping context. */ public HtmlPolicyBuilder allowStyling() { allowStyling(CssSchema.DEFAULT); diff --git a/src/main/org/owasp/html/Sanitizers.java b/src/main/org/owasp/html/Sanitizers.java index 77c193b..0437ffb 100644 --- a/src/main/org/owasp/html/Sanitizers.java +++ b/src/main/org/owasp/html/Sanitizers.java @@ -80,7 +80,8 @@ public final class Sanitizers { .toFactory(); private static final AttributePolicy INTEGER = new AttributePolicy() { - public String apply(String elementName, String attributeName, String value) { + public String apply( + String elementName, String attributeName, String value) { int n = value.length(); if (n == 0) { return null; } for (int i = 0; i < n; ++i) { diff --git a/src/main/org/owasp/html/StylingPolicy.java b/src/main/org/owasp/html/StylingPolicy.java index 7e4c0b8..1c448e7 100644 --- a/src/main/org/owasp/html/StylingPolicy.java +++ b/src/main/org/owasp/html/StylingPolicy.java @@ -109,7 +109,9 @@ final class StylingPolicy implements AttributePolicy { cssProperties.add(cssProperty); token = Strings.toLowerCase(token); String key = cssProperty.fnKeys.get(token); - cssProperty = key != null ? cssSchema.forKey(key) : CssSchema.DISALLOWED; + cssProperty = key != null + ? cssSchema.forKey(key) + : CssSchema.DISALLOWED; if (cssProperty != CssSchema.DISALLOWED) { emitToken(token); } @@ -117,14 +119,21 @@ final class StylingPolicy implements AttributePolicy { public void quotedString(String token) { closeQuotedIdents(); + // The contents of a quoted string could be treated as + // 1. a run of space-separated words, as in a font family name, + // 2. as a URL, + // 3. as plain text content as in a list-item bullet, + // 4. or it could be ambiguous as when multiple bits are set. int meaning = - cssProperty.bits & (CssSchema.BIT_UNRESERVED_WORD | CssSchema.BIT_URL); + cssProperty.bits + & (CssSchema.BIT_UNRESERVED_WORD | CssSchema.BIT_URL); if ((meaning & (meaning - 1)) == 0) { // meaning is unambiguous if (meaning == CssSchema.BIT_UNRESERVED_WORD && token.length() > 2 && isAlphanumericOrSpace(token, 1, token.length() - 1)) { emitToken(Strings.toLowerCase(token)); } else if (meaning == CssSchema.BIT_URL) { + // convert to a URL token and hand-off to the appropriate method // url("url(" + token + ")"); // TODO: %-encode properly } } diff --git a/src/main/org/owasp/html/TagBalancingHtmlStreamEventReceiver.java b/src/main/org/owasp/html/TagBalancingHtmlStreamEventReceiver.java index dc0dd89..b880a3b 100644 --- a/src/main/org/owasp/html/TagBalancingHtmlStreamEventReceiver.java +++ b/src/main/org/owasp/html/TagBalancingHtmlStreamEventReceiver.java @@ -981,7 +981,10 @@ public class TagBalancingHtmlStreamEventReceiver static boolean allowsPlainTextualContent(String canonElementName) { ElementContainmentInfo info = ELEMENT_CONTAINMENT_RELATIONSHIPS.get(canonElementName); - if (info == null || (info.contents & ElementContainmentRelationships.CHARACTER_DATA.types) != 0) { + if (info == null + || ((info.contents + & ElementContainmentRelationships.CHARACTER_DATA.types) + != 0)) { switch (HtmlTextEscapingMode.getModeForTag(canonElementName)) { case PCDATA: return true; case RCDATA: return true; |