Revision: 8245
Author: b...@google.com
Date: Mon Jun 14 08:20:35 2010
Log: Edited wiki page through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=8245

Modified:
 /wiki/CssResource.wiki

=======================================
--- /wiki/CssResource.wiki      Wed Mar 24 09:46:37 2010
+++ /wiki/CssResource.wiki      Mon Jun 14 08:20:35 2010
@@ -408,6 +408,11 @@

* The configuration property `CssResource.style` may be set to `pretty` which will disable class-name obfuscation as well as pretty-print the CSS content. Combine this with a `ClientBundle.enableInlining` value of `false` to produce a CSS expression which is amenable to client-side editing. * The configuration property `CssResoure.mergeEnabled` can be set to `false` to disable modifications that re-order rules. This should be considered a temporary measure until the merge logic has been fully vetted. + * The configuration property `CssResource.reservedClassPrefixes` can be extended to prevent the CssResource obfuscator from allocating class names that conflict with external CSS libraries.
+    {{{
+<!-- This is included in Resources.gwt.xml -->
+<extend-configuration-property name="CssResource.reservedClassPrefixes" value="gwt-" />
+}}}
* To allow for client-side tweaking of the effective (i.e. permutation-specific) style rules, you can store the value of CssResource.getText() into a TextArea. Wire some UI action to pass the contents of the TextArea into `StyleInjector.setContents()` to overwrite the original, injected stylesheet.

 = Selector obfuscation details =
@@ -618,6 +623,13 @@

In the above example, the `.obfuscated` class selector will be obfuscated, and the `obfuscated()` method will return the replaced name. Neither of the legacy selectors will be obfuscated and the `legacySelectorA()` method will return the unobfuscated value. Furthermore, because the `legacySelectorB` is explicitly defined in the `...@external` declaration, the inaccessible class name will not trigger an error.

+When it is necessary to prevent CssResource from allocating obfuscated class identifiers that use a particular prefix, the `CssResource.reservedClassPrefixes` module configuration variable can be extended. Suppose that a module intends to integrate with a hypothetical "FooJs" library and that this library utilizes CSS class selectors that start with "fj".
+{{{
+<extend-configuration-property name="CssResource.reservedClassPrefixes" value="fj" />
+}}}
+
+Note that this configuration property and `...@external` serve orthogonal purposes. The `reservedClassPrefixes` variable means "do not export these names" while `...@external` means "do not obfuscate these names".
+
 == Automatically generating CssResource interfaces ==

A utility is included in the GWT distribution which will analyze a CssResource-compatible CSS file and create a corresponding Java interface for accessing the classnames used in the file.

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

Reply via email to