Reviewers: kpreid2,

Description:
'transparent' used to be a special keyword in some CSS rules.
CSS3 makes 'transparent' a color keyword, and it's valid anywhere
a color is valid.

This change makes 'transparent' a color.

Please review this at https://codereview.appspot.com/46080043/

Affected files (+10, -7 lines):
  M     src/com/google/caja/lang/css/css3-defs.json
  M     tests/com/google/caja/lang/css/CssPropertyPatternsTest.java


Index: src/com/google/caja/lang/css/css3-defs.json
===================================================================
--- src/com/google/caja/lang/css/css3-defs.json (revision 5650)
+++ src/com/google/caja/lang/css/css3-defs.json (working copy)
@@ -142,7 +142,7 @@
     },

     { "key": "background-color",
-      "signature": "<color> | transparent",
+      "signature": "<color>",
       "default": "transparent",
       "appliesTo": "*",
       "inherited": false,
@@ -189,7 +189,7 @@
"source": "http://dev.w3.org/csswg/css-backgrounds/#background-size"; },

     { "key": "border",
- "signature": "[ <border-width> || <border-style> || [<color> | transparent] ]",
+      "signature": "[ <border-width> || <border-style> || <color> ]",
       "default": null, "default-comment": "see individual properties",
       "appliesTo": "*",
       "inherited": false,
@@ -232,7 +232,7 @@
       "mediaGroups": ["visual"] },

     { "key": "border-color",
-      "signature": "[ <color> | transparent ]{1,4}",
+      "signature": "[ <color> ]{1,4}",
       "default": null, "default-comment": "see individual properties",
       "appliesTo": "*",
       "inherited": false,
@@ -292,7 +292,7 @@
       "mediaGroups": ["visual"] },

     { "key": "border-top-color",
-      "signature": "<color> | transparent",
+      "signature": "<color>",
"default": null, "default-comment": "the value of the 'color' property",
       "appliesTo": "*",
       "inherited": false,
@@ -1250,8 +1250,11 @@
     },

     { "key": "<color>",
- "signature": "<hex-color>|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|rgb(<red>,<green>,<blue>)| rgba(<red>,<green>,<blue>,<alpha>)",
-      "source": "http://www.w3.org/TR/css3-iccprof#colorunits";
+ "signature": "<hex-color>|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|transparent|violet| wheat|white|whitesmoke|yellow|yellowgreen|rgb(<red>,<green>,<blue>)| rgba(<red>,<green>,<blue>,<alpha>)",
+      "source": [
+        "http://www.w3.org/TR/css3-iccprof#colorunits";,
+        "http://www.w3.org/TR/css3-color/";
+      ]
     },

     { "key": "<counter>",
Index: tests/com/google/caja/lang/css/CssPropertyPatternsTest.java
===================================================================
--- tests/com/google/caja/lang/css/CssPropertyPatternsTest.java (revision 5650) +++ tests/com/google/caja/lang/css/CssPropertyPatternsTest.java (working copy)
@@ -92,7 +92,7 @@
         );
     assertMatches(
         "'color'", "#fff", "#aabbcc", "red", "rgb(0,0,255)",
-        "rgb(0, 0, 255)", "hotpink", "yellow", "black");
+        "rgb(0, 0, 255)", "hotpink", "yellow", "black", "transparent");
     assertDoesNotMatch("'color'", "infrateal", "rgbv(0,0,255)",
                        "rgb(expression(alert(1337)))", "rgba(do,evil,now)");
   }


--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to