Comment by a.revolution.ultra.blue:

Guys, check the other post on client bundle, {...@nenchev / @shahidzaman}, I  
answered both your questions there.  @whoever-asked-about-resetting-rules,  
I have some custom implementation that allows for dynamic / updateable  
rules.  Remember that all IE browsers only allow a max of 31 stylesheets  
{inline or link}, even in IE8 {would 63 kill them, honestly?}.  Also, there  
is no reliable way to remove style elements properly in all browsers, so  
instead I store and clear StyleElements manually.  My implementation uses a  
few custom data classes and whatnot, but you can get the important bits  
you'll need from it.



if (styles.xHas( id )){
StyleElement el = styles.xCast( id ); //my own native JS map class.  Use  
hashmap
try{
        Text txt = Document.get().createTextNode( "."+id+"{"
+toWrite.xGetStr( i )+
"}" );//id is a class name used in css, and as style element id
for(int o = el.getChildCount();o-->0;el.removeChild( el.getChild( o ) ));
//To clear elements, just remove all text nodes
xRNA asRna = el.cast(); //This is my custom js object.
if (asRna.xFalse( "styleSheet" )) //If styleElement has styleSheet  
property...
        el.appendChild( txt ); //We must add style as text node
else
        asRna.xGetRna( "styleSheet" ).xSetStr( "cssText" , txt.getNodeValue() );
//This gets the styleSheet js object, and sets the cssText property as a  
String
}catch(Throwable e){GWT.log( "ack" , e );}
}

If this confuses you, I can make up a jar for anyone who wants to use it.


For more information:
http://code.google.com/p/google-web-toolkit/wiki/CssResource

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

Reply via email to