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
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
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
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
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):
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
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
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,
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
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
[+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
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
12 matches
Mail list logo