Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(280)

Issue 12699046: Sanitize canvas style property values rather than requiring exact match. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by kpreid2
Modified:
12 years, 7 months ago
Reviewers:
MikeSamuel
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Possibly due to recent changes in the CSS sanitizer, 2D canvas would not accept rgb() and rgba() colors: <https://code.google.com/p/google-caja/issues/detail?id=1837> Now, instead of sanitizing the property and requiring the result to be identical to the input, we just sanitize the property. If there was a rationale for doing it the former way, I've forgotten it. @r5547

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -31 lines) Patch
M src/com/google/caja/plugin/domado.js View 4 chunks +22 lines, -28 lines 4 comments Download
M tests/com/google/caja/plugin/es53-test-domado-canvas-guest.html View 1 chunk +7 lines, -3 lines 0 comments Download

Messages

Total messages: 5
kpreid2
12 years, 7 months ago (2013-08-09 19:42:46 UTC) #1
kpreid2
Mike, I'm asking you to review this change because it is mainly about interacting with ...
12 years, 7 months ago (2013-08-09 19:48:17 UTC) #2
MikeSamuel
lgtm https://codereview.appspot.com/12699046/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/12699046/diff/1/src/com/google/caja/plugin/domado.js#newcode4679 src/com/google/caja/plugin/domado.js:4679: sanitizeCssProperty(cssPropertyName, tokens); This looks fine. No need for ...
12 years, 7 months ago (2013-08-09 20:10:52 UTC) #3
kpreid2
https://codereview.appspot.com/12699046/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/12699046/diff/1/src/com/google/caja/plugin/domado.js#newcode4691 src/com/google/caja/plugin/domado.js:4691: if (/\binherit\b/.test(style)) { return ''; } On 2013/08/09 20:10:52, ...
12 years, 7 months ago (2013-08-09 20:16:28 UTC) #4
MikeSamuel
12 years, 7 months ago (2013-08-09 20:18:23 UTC) #5
On 2013/08/09 20:16:28, kpreid2 wrote:
>
https://codereview.appspot.com/12699046/diff/1/src/com/google/caja/plugin/dom...
> File src/com/google/caja/plugin/domado.js (right):
> 
>
https://codereview.appspot.com/12699046/diff/1/src/com/google/caja/plugin/dom...
> src/com/google/caja/plugin/domado.js:4691: if (/\binherit\b/.test(style)) {
> return ''; }
> On 2013/08/09 20:10:52, MikeSamuel wrote:
> > I believe the way we sanitize functions, tokens.length should be 1 because a
> > color is either a hash token, or an rgb function call or a call to rgba, so
> > you could filter too if you passed a predicate that examined the token
> > list to sanitizeCssValue.
> 
> From your description, that sounds more tightly coupled. Is there a particular
> reason to do it that way?

Probably not.  Please ignore.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b