Revision: 5653
Author: [email protected]
Date: Sat Dec 28 02:43:59 2013 UTC
Log: 'transparent' is now a CSS color
https://codereview.appspot.com/46080043
'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.
R=kpreid2
http://code.google.com/p/google-caja/source/detail?r=5653
Modified:
/branches/es53
/branches/es53/src/com/google/caja/lang/css/css3-defs.json
/branches/es53/tests/com/google/caja/lang/css/CssPropertyPatternsTest.java
/branches/es53/tests/com/google/caja/plugin/CssValidatorTest.java
=======================================
--- /branches/es53/src/com/google/caja/lang/css/css3-defs.json Tue Nov 26
22:29:42 2013 UTC
+++ /branches/es53/src/com/google/caja/lang/css/css3-defs.json Sat Dec 28
02:43:59 2013 UTC
@@ -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>",
=======================================
---
/branches/es53/tests/com/google/caja/lang/css/CssPropertyPatternsTest.java
Tue Sep 24 20:06:05 2013 UTC
+++
/branches/es53/tests/com/google/caja/lang/css/CssPropertyPatternsTest.java
Sat Dec 28 02:43:59 2013 UTC
@@ -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)");
}
=======================================
--- /branches/es53/tests/com/google/caja/plugin/CssValidatorTest.java Tue
Sep 24 20:06:05 2013 UTC
+++ /branches/es53/tests/com/google/caja/plugin/CssValidatorTest.java Sat
Dec 28 02:43:59 2013 UTC
@@ -836,7 +836,7 @@
+ " QuantityLiteral : 14px\n"
+ " Operation : NONE\n"
+ " Term ; cssPropertyPartType=IDENT"
- + " ; cssPropertyPart=border\n"
+ + " ; cssPropertyPart=border::color\n"
+ " IdentLiteral : transparent");
}
@@ -1021,7 +1021,7 @@
+ " Property : background\n"
+ " Expr\n"
+ " Term ; cssPropertyPartType=IDENT"
- + " ; cssPropertyPart=background-color\n"
+ + " ; cssPropertyPart=background-color::color\n"
+ " IdentLiteral : transparent\n"
+ " Operation : NONE\n"
+ " Term ; cssPropertyPartType=URI"
--
---
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.