Reviewers: kpreid2,
Description:
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.
Please review this at https://codereview.appspot.com/65530043/
Affected files (+88, -0 lines):
src/com/google/caja/lang/css/css3-defs.json
src/com/google/caja/lang/css/css3-whitelist.json
tests/com/google/caja/plugin/sanitizecss_test.js
Index: src/com/google/caja/lang/css/css3-defs.json
===================================================================
--- src/com/google/caja/lang/css/css3-defs.json (revision 5665)
+++ src/com/google/caja/lang/css/css3-defs.json (working copy)
@@ -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",
Index: src/com/google/caja/lang/css/css3-whitelist.json
===================================================================
--- src/com/google/caja/lang/css/css3-whitelist.json (revision 5665)
+++ src/com/google/caja/lang/css/css3-whitelist.json (working copy)
@@ -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",
Index: tests/com/google/caja/plugin/sanitizecss_test.js
===================================================================
--- tests/com/google/caja/plugin/sanitizecss_test.js (revision 5665)
+++ tests/com/google/caja/plugin/sanitizecss_test.js (working copy)
@@ -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.