Non-encrypted GWT HTML class tag styles

I have inherited an old xsl transformation that generates plain HTML, which is then bound to a widget using a GWT HTML field. The current setup looks like this:

HTML html = new HTML
html.setHTML(result)

In the UiBinder section of the widget, there are some old legacy styles defined:

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

The issue I'm facing is that while these styles are getting obfuscated, the plain HTML content set in the HTML container remains unstyled.

I attempted to use

@external .*; 

but it's not allowed in that context. Trying to prefix all styles with @external prefix-* also results in errors:

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

Is there a way to disable obfuscation for this specific UiBinder file or force GWT to obfuscate the incoming HTML content as well?

Answer №1

I'm uncertain about whether the @external .* syntax can be used in an inline <style> element. It might be worth a try to separate all styles (or just a few of them - with and without the leading dot).

If all styles are intended for legacy purposes only, you may want to consider creating a @NotStrict CssResource. For example:

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

Don't forget to call its ensureInjected().

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with Iframe DOM: encountering undefined values while attempting to retrieve form field data

For some reason, I've been struggling to debug a piece of JavaScript that should be straightforward. I've experimented with various approaches, such as using a form to access fields and using getElementById. I've also played around with incl ...

Revolutionary Knockout-Kendo MultiSelect Feature: Pressing Enter Erases Previously Selected Options

When using the Knockout-Kendo MultiSelect control, I have encountered an issue. If I select a value from the list, then enter a second value and press enter, the previously entered values are removed. VIEW <select data-bind="kendoMultiSelect: { da ...

What is the process for obtaining a slider control that includes two values?

Is there a way to implement a slider control with two values on a webpage? |........... Value 1: 100 Value 2: 0 ......|..... Value 1: 50 Value 2: 50 ...........| Value 1: 0 Value 2: 100 Note: These are just examples of the slider positioning and not ...

An unusual issue encountered while utilizing jQuery toggle: a straightforward illustration

Attempting to create a partial fade effect using toggle for toggling opacity values when clicking an element, but encountering an issue where nothing happens on the first click. The HTML code: <html> <head> <script type="text/javascript" s ...

What are the steps to configure MongoDB on Heroku using MongoHQ and Node.js?

I am currently using a local application, which is what I'm most familiar with. Heroku provided the following snippet of code: var mongo = require('mongodb'); var mongoUri = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || &apos ...

Issues accessing my Facebook account due to domain problems

I have developed an HTML5 game that I am currently running in my web browser. My objective is to integrate Facebook login functionality, so I followed a tutorial and replaced the necessary information with my App ID. However, upon running it, an error mes ...

Using HTML in jQuery or JavaScript: A Step-by-Step Guide

Here's the deal - I've got a bunch of buttons. https://i.sstatic.net/839MH.png What I want is, when the 4th button is clicked, to trigger a select menu option like this: The outcome I'm aiming for after clicking the button is https://i.ss ...

I want to locate every child that appears after the <body> element, and extract the HTML of the element containing a specific class within it

It may sound a bit confusing at first, but essentially I have some dynamically generated HTML that resembles the following: <body> <div class="component" id="465a496s5498"> <div class="a-container"> <div class="random-div"> ...

Having trouble selecting a dynamically changing div element in Selenium with Java using a click action

Every time I navigate to www.reddit.com and enter a query in the Search field, then press enter to go to the first valid link within a subreddit, sorting options are presented. By default, it is set to BEST but I wish to change it to TOP. My test class cod ...

modifying the IP address used while making a jQuery request

I am currently working on integrating a payment system, but unfortunately, I do not have a static IP address and my country is restricted. I am using my personal hosting with the whitelisted IP, however, it seems like the initial request to their servers ...

Comparing hardware-accelerated CSS3 animations, transitions, and jQuery animate for mobile devices

While developing my app using PhoneGap and jQuery, I encountered a dilemma regarding animations. Initially, I relied on what I knew best - jQuery animate - to create smooth movements. However, discussions about hardware acceleration caught my attention. ...

Tips for accurately dissecting a PDF document to determine the status of checkboxes

Looking for a solution to parse PDF forms on the server side, I have experimented with various node.js modules including pdf2json, hummus, and node-pdftk. While I have successfully retrieved all text fields, I am facing issues when it comes to extracting c ...

What are the steps for implementing claim-based authentication in Windows Phone 7?

Currently, I am in the process of developing a Windows Phone 7 application and exploring claim-based authentication for the first time. To assist me with this, I have been referring to the following link which explains how to implement claim-based authenti ...

The success response is returned by MVC jQuery ajax GET, regardless of any errors

Here is the AJAX GET function used in my project: $('#DetailMaxGuest').change(function () { var result = $('#DetailMaxGuest').val(); var resultparse = parseInt(result); var resultid = $('#resultid').va ...

What steps are involved in integrating QuickBlox on your website?

I am completely new to web development and have a question about integrating QuickBlox into my website using JavaScript. I have included the necessary JavaScript files in my website and set up the QuickBlox admin application, but I'm not sure how to p ...

I've recently delved into the world of JavaScript and am currently working on creating a calculator website. However, I'm facing some challenges in getting it to function

I created a calculator code using HTML, CSS, and JavaScript for a website. However, due to my limited experience with JavaScript coding, I encountered some issues. Currently, I have only implemented the number input part (not operations or deletion), but w ...

Utilizing jQuery's Chained Selectors: Implementing Selectors on Previously Filtered Elements

DO NOT MISS: http://jsfiddle.net/gulcoza/9cVFT/1/ LATEST FIDDLE: http://jsfiddle.net/gulcoza/9cVFT/4/ All the code can be found in the above fiddle, but I will also explain it here: HTML <ul> <li id="e1">1</li> <li id="e2" ...

Having trouble with loading images in Bootstrap 5 framework

I am currently developing a website using HTML in Visual Studio Code with Bootstrap 5. However, I am facing an issue where the images I have inserted into a new section are not loading, while the ones in previous sections are displaying perfectly fine. < ...

What is the method for modifying the "error" property of a material-ui component?

I'm facing a challenge with form field validation and below is the code snippet I'm working on: import React, {Component} from 'react'; import {TextField} from '@material-ui/core'; class ProductField extends Component { ...

Testing the disappearance of text in a textarea using Cypress

Is there a way to test the textarea text that disappears once you start typing? Even after I type something, no changes are reflected in the displayed document. https://i.sstatic.net/rNjil.png I am trying to verify that the texts such as Enter a comment ...