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

Issue 61041: Cajole to HTML (Closed)

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

Description

Rewrote HTML Compiler and HTML Sanitizer to output Javascript and static HTML instead of just Javascript. http://code.google.com/p/google-caja/issues/detail?id=294 Issue 294: Caja produces pages that don't work if Javascript is disabled The problem is that, in order to preserve execution order properties, we emit HTML (and CSS?) as Javascript that builds the page. We need to also (optionally) output just the HTML and CSS in a <noscript> tag. This makes two major changes: (1) Replaces HtmlSanitizer and HtmlCompiler with a mechanism that outputs a static HTML chunk and then reworks it to add dynamic attributes. (2) Added an ID suffix to PluginMeta so that containers which can avoid suffix overlap can move more rewriting to the static side. The new HtmlSanitizer and HtmlCompiler use that when rewriting attributes, and when present, no javascript is needed to emit CSS so a noscript version of a gadget will be properly styled. The new Sanitizer and Compiler are based on the scheme described in http://google-caja.googlecode.com/svn/trunk/doc/html/templates/TemplateCompiler.html and can be extended to implement the entire template scheme. This change was adopted by Ihab

Patch Set 1 #

Patch Set 2 : Cajole to HTML #

Patch Set 3 : Cajole to HTML #

Patch Set 4 : Cajole to HTML #

Patch Set 5 : Cajole to HTML #

Patch Set 6 : Cajole to HTML #

Patch Set 7 : Cajole to HTML #

Patch Set 8 : Cajole to HTML #

Patch Set 9 : Cajole to HTML #

Patch Set 10 : Cajole to HTML #

Patch Set 11 : Cajole to HTML #

Patch Set 12 : Cajole to HTML #

Patch Set 13 : Cajole to HTML #

Total comments: 67

Patch Set 14 : Cajole to HTML #

Patch Set 15 : Cajole to HTML #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+2987 lines, -5144 lines) Patch
M build.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +4 lines, -9 lines 0 comments Download
M doc/html/templates/TemplateCompiler.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 16 chunks +47 lines, -42 lines 0 comments Download
M src/com/google/caja/demos/applet/CajaApplet.java View 3 4 5 6 7 8 9 10 11 12 13 4 chunks +5 lines, -2 lines 0 comments Download
M src/com/google/caja/lang/css/css-extensions-whitelist.json View 6 7 8 9 10 11 12 13 1 chunk +3 lines, -2 lines 0 comments Download
M src/com/google/caja/lexer/Keyword.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M src/com/google/caja/lexer/escaping/Escaping.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +7 lines, -6 lines 0 comments Download
M src/com/google/caja/opensocial/DefaultGadgetRewriter.java View 3 4 5 6 7 8 9 10 11 12 13 5 chunks +9 lines, -20 lines 0 comments Download
M src/com/google/caja/parser/html/AbstractElementStack.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -2 lines 0 comments Download
M src/com/google/caja/parser/html/XmlElementStack.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -2 lines 0 comments Download
M src/com/google/caja/parser/js/CajoledModule.java View 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -3 lines 0 comments Download
M src/com/google/caja/parser/js/ExpressionStmt.java View 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -0 lines 0 comments Download
M src/com/google/caja/parser/js/Parser.java View 3 4 5 6 7 8 9 10 11 12 13 4 chunks +12 lines, -14 lines 0 comments Download
M src/com/google/caja/parser/js/TranslatedCode.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -3 lines 0 comments Download
M src/com/google/caja/parser/js/UncajoledModule.java View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -4 lines 0 comments Download
M src/com/google/caja/parser/quasiliteral/CajitaRewriter.java View 3 4 5 6 7 8 9 10 11 12 13 2 chunks +11 lines, -7 lines 0 comments Download
M src/com/google/caja/plugin/BuildServiceImplementation.java View 6 7 8 9 10 11 12 13 6 chunks +42 lines, -9 lines 0 comments Download
src/com/google/caja/plugin/CssCompiler.java View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -214 lines 0 comments Download
M src/com/google/caja/plugin/CssRewriter.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +9 lines, -8 lines 0 comments Download
A + src/com/google/caja/plugin/CssRuleRewriter.java View 8 chunks +20 lines, -32 lines 0 comments Download
M src/com/google/caja/plugin/Dom.java View 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +13 lines, -0 lines 0 comments Download
D src/com/google/caja/plugin/DomAttributeConstraint.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -181 lines 0 comments Download
D src/com/google/caja/plugin/DomProcessingEvents.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -488 lines 0 comments Download
A src/com/google/caja/plugin/ExtractedHtmlContent.java View 1 chunk +40 lines, -0 lines 0 comments Download
D src/com/google/caja/plugin/HtmlCompiler.java View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -751 lines 0 comments Download
D src/com/google/caja/plugin/HtmlSanitizer.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -231 lines 0 comments Download
src/com/google/caja/plugin/IdentifierWriter.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -169 lines 0 comments Download
D src/com/google/caja/plugin/JsWriter.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -188 lines 0 comments Download
M src/com/google/caja/plugin/PluginCompiler.java View 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +27 lines, -9 lines 0 comments Download
M src/com/google/caja/plugin/PluginMeta.java View 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +17 lines, -1 line 0 comments Download
D src/com/google/caja/plugin/TreeConstruction.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -70 lines 0 comments Download
M src/com/google/caja/plugin/html-emitter.js View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +200 lines, -143 lines 0 comments Download
D src/com/google/caja/plugin/stages/CompileCssStage.java View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -47 lines 0 comments Download
M src/com/google/caja/plugin/stages/CompileHtmlStage.java View 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +37 lines, -39 lines 0 comments Download
A + src/com/google/caja/plugin/stages/RewriteCssStage.java View 2 chunks +4 lines, -8 lines 0 comments Download
M src/com/google/caja/plugin/stages/RewriteHtmlStage.java View 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +19 lines, -25 lines 0 comments Download
M src/com/google/caja/plugin/stages/SanitizeHtmlStage.java View 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -4 lines 0 comments Download
A src/com/google/caja/plugin/templates/IhtmlMessageType.java View 1 chunk +78 lines, -0 lines 0 comments Download
A src/com/google/caja/plugin/templates/QuasiUtil.java View 1 chunk +56 lines, -0 lines 0 comments Download
A src/com/google/caja/plugin/templates/SafeCssMaker.java View 4 5 6 7 8 9 10 11 1 chunk +142 lines, -0 lines 0 comments Download
A src/com/google/caja/plugin/templates/SafeHtmlMaker.java View 4 5 6 7 8 9 10 11 1 chunk +485 lines, -0 lines 4 comments Download
A + src/com/google/caja/plugin/templates/TemplateCompiler.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +397 lines, -576 lines 0 comments Download
A + src/com/google/caja/plugin/templates/TemplateSanitizer.java View 1 2 3 4 5 6 6 chunks +43 lines, -41 lines 0 comments Download
M src/com/google/caja/reporting/MessageGroup.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -2 lines 0 comments Download
M src/com/google/caja/service/CajolingService.java View 3 4 5 6 7 8 9 10 11 12 13 5 chunks +37 lines, -6 lines 0 comments Download
M src/com/google/caja/service/GadgetHandler.java View 3 4 5 6 7 8 9 10 11 12 13 3 chunks +9 lines, -4 lines 0 comments Download
M src/com/google/caja/service/HtmlHandler.java View 7 8 9 10 11 12 13 6 chunks +52 lines, -17 lines 0 comments Download
M tests/com/google/caja/AllTests.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +8 lines, -8 lines 0 comments Download
M tests/com/google/caja/demos/applet/CajaAppletTest.java View 3 4 5 6 7 8 9 10 11 12 13 3 chunks +87 lines, -62 lines 0 comments Download
M tests/com/google/caja/opensocial/DefaultGadgetRewriterTest.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -7 lines 0 comments Download
M tests/com/google/caja/opensocial/example-rewritten.xml View 3 4 5 6 7 8 9 10 11 12 13 4 chunks +25 lines, -9 lines 0 comments Download
M tests/com/google/caja/parser/js/ParserTest.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -4 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/CajitaRewriterTest.java View 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
D tests/com/google/caja/plugin/CssCompilerTest.java View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -106 lines 0 comments Download
M tests/com/google/caja/plugin/CssRewriterTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
A + tests/com/google/caja/plugin/CssRuleRewriterTest.java View 2 2 chunks +22 lines, -14 lines 0 comments Download
D tests/com/google/caja/plugin/DomProcessingEventsTest.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -178 lines 0 comments Download
D tests/com/google/caja/plugin/DomProcessingEventsTestData.java View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -447 lines 0 comments Download
M tests/com/google/caja/plugin/HtmlCompiledPluginTest.java View 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +11 lines, -14 lines 0 comments Download
D tests/com/google/caja/plugin/HtmlCompilerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -214 lines 0 comments Download
A tests/com/google/caja/plugin/HtmlEmitterTest.java View 1 chunk +169 lines, -0 lines 0 comments Download
D tests/com/google/caja/plugin/HtmlSanitizerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -219 lines 0 comments Download
D tests/com/google/caja/plugin/dom-processing-events-test.html View 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -93 lines 0 comments Download
M tests/com/google/caja/plugin/domita_test.html View 6 7 8 9 10 11 12 13 2 chunks +34 lines, -4 lines 0 comments Download
A tests/com/google/caja/plugin/html-emitter-test.html View 2 3 4 5 6 7 8 9 10 11 1 chunk +78 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/stages/RewriteHtmlStageTest.java View 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +30 lines, -6 lines 0 comments Download
A tests/com/google/caja/plugin/templates/RenamingTest.java View 1 chunk +23 lines, -0 lines 0 comments Download
A + tests/com/google/caja/plugin/templates/TemplateCompilerTest.java View 1 2 3 2 chunks +291 lines, -146 lines 0 comments Download
A + tests/com/google/caja/plugin/templates/TemplateSanitizerTest.java View 1 2 3 4 5 6 7 5 chunks +108 lines, -153 lines 0 comments Download
A tests/com/google/caja/plugin/templates/template-compiler-golden1-dynamic.html View 2 1 chunk +7 lines, -0 lines 0 comments Download
A tests/com/google/caja/plugin/templates/template-compiler-golden1-dynamic.js View 2 3 1 chunk +53 lines, -0 lines 0 comments Download
A tests/com/google/caja/plugin/templates/template-compiler-golden1-static.html View 2 1 chunk +11 lines, -0 lines 0 comments Download
A tests/com/google/caja/plugin/templates/template-compiler-golden1-static.js View 2 3 1 chunk +48 lines, -0 lines 0 comments Download
A tests/com/google/caja/plugin/templates/template-compiler-input1.html View 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M tests/com/google/caja/service/CajolingServiceTest.java View 3 4 5 6 7 8 9 10 11 12 13 6 chunks +84 lines, -70 lines 0 comments Download
M tests/com/google/caja/util/CajaTestCase.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +19 lines, -7 lines 0 comments Download
M third_party/js/jqueryjs/runtest/env.js View 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -1 line 0 comments Download
M third_party/js/jsunit/2.2/jsUnitCore.js View 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 6
MikeSamuel
6 years ago (2009-05-15 06:19:07 UTC) #1
Jasvir
The review is not yet complete but Ihab and I had some queries... http://codereview.appspot.com/61041/diff/3465/1923 File ...
6 years ago (2009-05-22 04:50:50 UTC) #2
MikeSamuel
http://codereview.appspot.com/61041/diff/3465/1923 File build.xml (right): http://codereview.appspot.com/61041/diff/3465/1923#newcode512 Line 512: <include name="**/caja/plugin/templates/*.json"/> On 2009/05/22 04:50:51, jasvir wrote: > ...
6 years ago (2009-05-22 20:42:54 UTC) #3
Jasvir
LGTM http://codereview.appspot.com/61041/diff/3465/1886 File src/com/google/caja/parser/js/TranslatedCode.java (right): http://codereview.appspot.com/61041/diff/3465/1886#newcode67 Line 67: rc.getOut().consume("/* Start translated code */"); Making the ...
6 years ago (2009-05-27 21:21:15 UTC) #4
ihab.awad
I am not the owner of this issue and hence cannot edit it. Therefore, I ...
5 years, 12 months ago (2009-05-29 05:11:04 UTC) #5
ihab.awad
5 years, 12 months ago (2009-05-29 16:24:22 UTC) #6
Update: This change is now moved to:

   http://codereview.appspot.com/67126
Sign in to reply to this message.

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