[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-06 Thread BobV
StyleInjector committed to trunk at r5185. @RayC, I added an assertion that there is a head tag. @RayR, The line lengths seem to be ok according to the eclipse formatting rules checked into trunk. I added notes to the Javadoc indicating that not all StyleElements returned are necessarily

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-04 Thread Miroslav Pokorny
Using individual rules naturally has pluses and minuses. In this case in which one wants to add rules on mass it's not appropriate thus appending new css to a particular stylesheet is more appropriateread on for my views and some developer benefits. Take the stylesheet included by one

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread rjrjr
LGTM Some nits, do with them what you will and commit this puppy. http://gwt-code-reviews.appspot.com/15803/diff/4001/4004 File user/src/com/google/gwt/dom/client/StyleInjector.java (right): http://gwt-code-reviews.appspot.com/15803/diff/4001/4004#newcode35 Line 35: head).getItem(0)); line

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread cromwellian
http://gwt-code-reviews.appspot.com/15803/diff/4001/4004 File user/src/com/google/gwt/dom/client/StyleInjector.java (right): http://gwt-code-reviews.appspot.com/15803/diff/4001/4004#newcode35 Line 35: head).getItem(0)); I mentioned this in another review, but this common idiom can fail if the

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread Ray Ryan
Can we add safely add head if we don't find it? On Fri, Apr 3, 2009 at 2:43 PM, cromwell...@gmail.com wrote: http://gwt-code-reviews.appspot.com/15803/diff/4001/4004 File user/src/com/google/gwt/dom/client/StyleInjector.java (right):

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread Miroslav Pokorny
This is probably the wrong time to ask -but updating styles via the addition of style tags seems very limiting. If I recall IE (cant recall which vetsion was probably 7) chokes when a page has more than thirty odd style elements. Why not add new rules using StyleSheet.addRule/insertRule or

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread Ray Cromwell
It seems to me that calling addRule/insertRule a hundred times would be pretty slow (just look how many rules are in the GWT Theme CSS), not to mention there are cross-browser issues to deal with, when a simple, well-tested, mechanism exists already. Sometimes doing the 'proper' thing is not an

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread Ray Cromwell
You can get the CssRule/CSSStyleDeclaration as text via the cssText property, but AFAIK, there is no property on document.styleSheets[n] that allows setting the whole stylesheet at once using text. If there is, it's certainly not part of the W3C DOM CSS OM. -Ray On Fri, Apr 3, 2009 at 8:21 PM,

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread Miroslav Pokorny
That's correct because they cascade. The benefit of specifying which stylesheet to inject into is that the gwt stylesheet can contain defaults which are in turn overridden at will in user defined stylesheets. Currently it's a free for all with ordering being undpecified which makes it

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-03 Thread Ray Cromwell
The current solution of allowing you to inject as the first child of head works just fine, at the loss of user defined stylesheets needing to use !important, but it is also extremely simple to implement, and the low hanging fruit. Iimposing that StyleInjector would have to use

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-02 Thread bobv
[+Ray Cromwell] @RayC, What was the exact problem that you were having without an insertBefore/After method? These methods are somewhat problematic to implement in a least-surprise way on IE owing to the pigeonhole principle unless the API is changed to return some kind of token instead of a

[gwt-contrib] Re: Add StyleInjector to GWT trunk

2009-04-01 Thread rjrjr
http://gwt-code-reviews.appspot.com/15803/diff/1/4 File user/src/com/google/gwt/dom/client/StyleInjector.java (right): http://gwt-code-reviews.appspot.com/15803/diff/1/4#newcode42 Line 42: return injectStyleSheet(contents); You're ignoring element. How can you get away with that? Your public