Dennis Ich
Dennis Ich

Reputation: 3785

GWT HTML-Class Tag Styles not obfuscated

I got a legacy xsl transformation which results in plain HTML and which is bound then to a widget with a GWT HTML field. Its currently looking like this:

HTML html = new HTML
html.setHTML(result)

inside the UiBinder part of the widget there is a

<ui:style>
  <!-- old legacy styles -->
</ui:style>

the problem now is, that there are a lot of styles in there and they seem to get obfuscated while the names in plain HTML which is set in the HTML container is not obfuscated - so the result is unstyled.

I tried to set

@external .*; 

which is not allowed in there. Prefixing all styles and using @external prefix-* has the same effect:

[ERROR] Line 6: The annotation @CssResource.ClassName is disallowed for this location
[ERROR] Line 7: Syntax error on token "*", delete this token

Is it possible to disable obfuscation for this one UiBidner file or force gwt to also obfuscate the HTML stuff that comes in?

Upvotes: 1

Views: 132

Answers (1)

Andrea Boscolo
Andrea Boscolo

Reputation: 3048

I do not recall if you can use the @external .* syntax into an inline <style> element. Maybe try to explode all styles (or just with a couple of them - with and without the leading dot).

But if all styles are meant just to be legacy, don't bother an simply create a @NotStrict CssResource. Something like:

interface MyBundle extends ClientBundle {
  @Source("legacy.css")
  @NotStrict
  CssResource legacy();
}

And remember to call its ensureInjected().

Upvotes: 1

Related Questions