CssResource offers a strict mode [1] which ensures that the emitted JS
/ CSS is as optimal as the system can make it by imposing a few
conditions on the input Java / CSS.  Specifically, all CSS class
selectors must correspond with a Java accessor method, or the class
name must be explicitly exempted from obfuscation.

A warning was added to the compiler many weeks ago to encourage users
to annotate their CssResources with @NotStrict or @Strict in
preparation for this move.  The @NotStrict annotation will continue to
be honored indefinitely and the @Strict annotation will be retired.

There are two patches related to this move:

http://gwt-code-reviews.appspot.com/75804
  - Switches CssResourceGenerator to operate in strict-by-default behavior
  - Removes the CssResource.strictAccessors configuration property

http://gwt-code-reviews.appspot.com/72808
  - Adds a utility class which will examine a CSS file and produce a
CssResource interface which can be used to access the class selectors
in that CSS file.

Example use:

java -cp gwt-dev.jar:gwt-user.jar \
  com.google.gwt.resources.css.InterfaceGenerator \
  -standalone \
  -typeName some.package.MyCssResource \
  -css /Users/bob/gwt/trunk/user/test/com/google/gwt/resources/client/test.css \
  > src/some/package/MyCssResource.java

[1] http://code.google.com/p/google-web-toolkit/wiki/CssResource#Strict_scoping

-- 
Bob Vawter
Google Web Toolkit Team

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to