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

Issue 1541041: Issue 1103: style applied to body in css or cascading from body in cajoled source not working (Closed)

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

Description

This fixes the remainder of issue 1103: Felix said: the part that isn't fixed is that when a gadget has <body class="foo">...</body> the class attribute is removed, rather than reparented. the workaround in many cases is pretty simple: instead of putting a class on body, put the class on a div within the body. that doesn't work for yui because some widgets will insert nodes in body, which in caja will be a fake body that won't have the right classes, so the inserted nodes will not have the right style rules applied. This addresses that. (1) add to html-emitter.js a method that adds classes to the body. (2) changes RewriteHtmlStage to find call the new HtmlEmitter method. (3) changes CssRuleRewriter so that all CSS rules that involve body classes refer to the virtual body (4) adds tests to domita_test.html to test body classes. Submitted @4132

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -30 lines) Patch
M src/com/google/caja/config/WhiteList.java View 2 chunks +16 lines, -0 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/RulesetDescription.java View 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/plugin/CssRuleRewriter.java View 2 chunks +5 lines, -22 lines 0 comments Download
M src/com/google/caja/plugin/html-emitter.js View 2 chunks +9 lines, -0 lines 0 comments Download
M src/com/google/caja/plugin/stages/RewriteHtmlStage.java View 5 chunks +68 lines, -0 lines 2 comments Download
M src/com/google/caja/plugin/templates/HtmlAttributeRewriter.java View 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/plugin/CssRuleRewriterTest.java View 2 chunks +9 lines, -3 lines 2 comments Download
M tests/com/google/caja/plugin/domita_test_untrusted.html View 5 chunks +22 lines, -3 lines 0 comments Download
M tests/com/google/caja/plugin/stages/RewriteHtmlStageTest.java View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 5
MikeSamuel
15 years, 10 months ago (2010-06-04 02:47:58 UTC) #1
felix8a
http://codereview.appspot.com/1541041/diff/1/7 File src/com/google/caja/plugin/stages/RewriteHtmlStage.java (right): http://codereview.appspot.com/1541041/diff/1/7#newcode323 src/com/google/caja/plugin/stages/RewriteHtmlStage.java:323: if (e == null) { e = StringLiteral.valueOf(pos, identifiers); ...
15 years, 9 months ago (2010-06-15 13:19:01 UTC) #2
MikeSamuel
http://codereview.appspot.com/1541041/diff/1/2 File tests/com/google/caja/plugin/CssRuleRewriterTest.java (right): http://codereview.appspot.com/1541041/diff/1/2#newcode57 tests/com/google/caja/plugin/CssRuleRewriterTest.java:57: "[ '.vdoc-body___.ie6.', ' p {\\n color: blue\\n}' ]"); On ...
15 years, 9 months ago (2010-06-15 21:00:57 UTC) #3
MikeSamuel
http://codereview.appspot.com/1541041/diff/1/7 File src/com/google/caja/plugin/stages/RewriteHtmlStage.java (right): http://codereview.appspot.com/1541041/diff/1/7#newcode323 src/com/google/caja/plugin/stages/RewriteHtmlStage.java:323: if (e == null) { e = StringLiteral.valueOf(pos, identifiers); ...
15 years, 9 months ago (2010-06-15 21:04:50 UTC) #4
felix8a
15 years, 9 months ago (2010-06-16 00:02:34 UTC) #5
oh, right.  ok, I see now.  lgtm.
Sign in to reply to this message.

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