Revision: 5666
Author: [email protected]
Date: Tue Feb 18 19:22:57 2014 UTC
Log: allow css background-size and resize
https://codereview.appspot.com/65530043
this will also be merged into the es53 branch.
background-size: was already defined, and it's implicitly allowed by the
background: property, but it was inadvertently left off the whitelist.
resize: is new.
I've also added a test for text-overflow: which was in a previous CL.
R=kpreid2
http://code.google.com/p/google-caja/source/detail?r=5666
Modified:
/trunk/src/com/google/caja/lang/css/css3-defs.json
/trunk/src/com/google/caja/lang/css/css3-whitelist.json
/trunk/tests/com/google/caja/plugin/sanitizecss_test.js
=======================================
--- /trunk/src/com/google/caja/lang/css/css3-defs.json Tue Feb 11 07:14:43
2014 UTC
+++ /trunk/src/com/google/caja/lang/css/css3-defs.json Tue Feb 18 19:22:57
2014 UTC
@@ -907,6 +907,14 @@
"inherited": true,
"mediaGroups": ["visual"] },
+ { "key": "resize",
+ "signature": "none | both | horizontal | vertical",
+ "default": "none",
+ "appliesTo": "*",
+ "inherited": false,
+ "mediaGroups": ["visual"],
+ "source": "https://developer.mozilla.org/en-US/docs/Web/CSS/resize"
},
+
{ "key": "richness",
"signature": "<number>",
"default": "50",
=======================================
--- /trunk/src/com/google/caja/lang/css/css3-whitelist.json Tue Nov 26
22:27:53 2013 UTC
+++ /trunk/src/com/google/caja/lang/css/css3-whitelist.json Tue Feb 18
19:22:57 2014 UTC
@@ -24,6 +24,7 @@
"background-image",
"background-position",
"background-repeat",
+ "background-size",
"border",
"border-bottom",
"border-bottom-color",
@@ -124,6 +125,7 @@
"play-during",
"position",
"quotes",
+ "resize",
"richness",
"right",
"speak",
=======================================
--- /trunk/tests/com/google/caja/plugin/sanitizecss_test.js Thu Nov 28
03:55:43 2013 UTC
+++ /trunk/tests/com/google/caja/plugin/sanitizecss_test.js Tue Feb 18
19:22:57 2014 UTC
@@ -660,3 +660,81 @@
'p{color:red;*zoom:1;color:blue}');
jsunit.pass();
});
+
+jsunitRegister('testResize', function testResize() {
+ assertSanitizedStylesheet(
+ ['.scopeClass p{',
+ 'resize:both;',
+ 'resize:horizontal;',
+ 'resize:inherit;',
+ 'resize:none;',
+ 'resize:vertical;',
+ '}'
+ ].join(''),
+ ['p {',
+ 'resize:invalid;',
+ 'resize:both;',
+ 'resize:horizontal;',
+ 'resize:inherit;',
+ 'resize:none;',
+ 'resize:vertical;',
+ '}'
+ ].join(''));
+ jsunit.pass();
+});
+
+jsunitRegister('testBackgroundSize', function testBackgroundSize() {
+ assertSanitizedStylesheet(
+ ['.scopeClass p{',
+ 'background-size:inherit;',
+ 'background-size:1px;',
+ 'background-size:2px , 3px;',
+ 'background-size:4%;',
+ 'background-size:5% 6%;',
+ 'background-size:auto;',
+ 'background-size:auto auto;',
+ 'background-size:cover;',
+ 'background-size:contain;',
+ '}'
+ ].join(''),
+ ['p {',
+ 'background-size:invalid;',
+ 'background-size:inherit;',
+ 'background-size:1px;',
+ 'background-size:2px,3px;',
+ 'background-size:4%;',
+ 'background-size:5% 6%;',
+ 'background-size:auto;',
+ 'background-size:auto auto;',
+ 'background-size:cover;',
+ 'background-size:contain;',
+ '}'
+ ].join(''));
+ jsunit.pass();
+});
+
+jsunitRegister('testTextOverflow', function testTextOverflow() {
+ assertSanitizedStylesheet(
+ ['.scopeClass p{',
+ 'text-overflow:inherit;',
+ 'text-overflow:clip;',
+ 'text-overflow:ellipsis;',
+ 'text-overflow:"1";',
+ 'text-overflow:clip ellipsis;',
+ 'text-overflow:ellipsis "2";',
+ 'text-overflow:"3" "4";',
+ '}'
+ ].join(''),
+ ['p {',
+ 'text-overflow:invalid;',
+ 'text-overflow:inherit;',
+ 'text-overflow:clip;',
+ 'text-overflow:ellipsis;',
+ 'text-overflow:"1";',
+ 'text-overflow:clip ellipsis;',
+ 'text-overflow:ellipsis "2";',
+ 'text-overflow:"3" "4";',
+ '}'
+ ].join(''));
+ jsunit.pass();
+});
--
---
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.