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

Issue 11871043: Change sanitizeCssProperty to take virtualization param like other sanitize* fns (Closed)

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

Description

We need sanitizeCssProperty to take an ID suffix so it can sanitize <global-name>s. sanitizeStylesheet and sanitizeCssSelectors take a virtualization property with the necessary ID suffix. This change changes sanitizeCssProperty and all callers to take the same virtualization property and bundles base URI and the URI rewriter that all take into the virtualization property. This CL should not affect the semantics of a cajoled document.

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -123 lines) Patch
src/com/google/caja/plugin/domado.js View 3 chunks +11 lines, -6 lines 4 comments Download
src/com/google/caja/plugin/html-emitter.js View 1 chunk +5 lines, -3 lines 0 comments Download
src/com/google/caja/plugin/html-sanitizer.js View 3 chunks +10 lines, -7 lines 0 comments Download
src/com/google/caja/plugin/sanitizecss.js View 13 chunks +100 lines, -76 lines 0 comments Download
tests/com/google/caja/plugin/css-stylesheet-test.js View 2 chunks +4 lines, -3 lines 0 comments Download
tests/com/google/caja/plugin/css-stylesheet-tests.js View 1 chunk +1 line, -1 line 0 comments Download
tests/com/google/caja/plugin/cssparser_test.js View 1 chunk +1 line, -0 lines 0 comments Download
tests/com/google/caja/plugin/sanitizecss_test.js View 11 chunks +34 lines, -27 lines 0 comments Download

Messages

Total messages: 6
MikeSamuel
12 years, 8 months ago (2013-07-25 21:28:53 UTC) #1
kpreid2
https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js#newcode2005 src/com/google/caja/plugin/domado.js:2005: cssVirtualization = { This is duplicated code. The 'virtualization' ...
12 years, 8 months ago (2013-07-25 21:35:17 UTC) #2
MikeSamuel
https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js#newcode2005 src/com/google/caja/plugin/domado.js:2005: cssVirtualization = { On 2013/07/25 21:35:17, kpreid2 wrote: > ...
12 years, 8 months ago (2013-07-25 22:04:37 UTC) #3
kpreid2
https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js#newcode2005 src/com/google/caja/plugin/domado.js:2005: cssVirtualization = { On 2013/07/25 22:04:38, MikeSamuel wrote: > ...
12 years, 8 months ago (2013-07-25 22:10:36 UTC) #4
MikeSamuel
https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/domado.js#newcode2005 src/com/google/caja/plugin/domado.js:2005: cssVirtualization = { On 2013/07/25 22:10:37, kpreid2 wrote: > ...
12 years, 8 months ago (2013-07-25 23:51:51 UTC) #5
MikeSamuel
12 years, 8 months ago (2013-07-25 23:58:04 UTC) #6
On 2013/07/25 23:51:51, MikeSamuel wrote:
>
https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/dom...
> File src/com/google/caja/plugin/domado.js (right):
> 
>
https://codereview.appspot.com/11871043/diff/1/src/com/google/caja/plugin/dom...
> src/com/google/caja/plugin/domado.js:2005: cssVirtualization = {
> On 2013/07/25 22:10:37, kpreid2 wrote:
> > On 2013/07/25 22:04:38, MikeSamuel wrote:
> > > On 2013/07/25 21:35:17, kpreid2 wrote:
> > > > This is duplicated code. The 'virtualization' object is already this;
just
> > add
> > > > the needed pieces to it. Maybe rename 'rewriteUri' to 'rewriteUriForCss'
> to
> > > > clarify the special behavior.
> > > 
> > > The one at L 2109?
> > > Hmm.  I think the baseUri needs to be sensitive to setBase.
> > 
> > Then make it .getBaseUri() or an accessor property.
> > 
> > > Is it kosher to use Object.create to derive cssVirtualization from
> > > virtualization each time sanitize is called?
> > 
> > Why introduce a separate object? The whole point of the virtualization
object
> is
> > to be a bundle of _all_ the value-transformations and related info. I
> introduced
> > it to cut down on function parameter counts, and arbitrary invention of
> > specialized interfaces used in only one place.
> 
> Done.

For some reason `myvn snapshot` decided to create a new CL 1183043 instead of
updating this one.
I'm closing this.
Sign in to reply to this message.

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