Bob,  The issue for me was follows: I used StyleInjector in Chronoscope to
inject default styles/themes for some Widgets. Users of my library
complained that they could not include their own css stylesheet to override
some of these, the reason is, the injected stylesheet always appears after
all linked stylesheets in <head>, and therefore, it gets highest priority.
In effect, injected stylesheets are !important by default. I was forced to
include a configuration flag like 'don't inject a default style' for these
users, however this has the problem that the person must include override
styles for everything, not just the widget they want.  The only middle
ground solution appears to be letting users override StyleNames on
everything, but all of this is kind of inelegant since it fails to leverage
CSS cascade behavior.

 I actually don't care about exact ordering, only relative ordering. In
fact, if the methods were changed to simply injectFront()/injectRear(),
where the former places it as the first child of <head> and the latter
places it as the last child of </head>, that would be good enough.
Basically, you either want to have a 'subclass' relationship with all of the
user provided CSS, or a 'superclass' relationship with it, override, or
allow yourself to be overriden.

 There might be some who are using multiple modules each doing their own
injection that might care about exact placement. I find the exact placement
stuff to be too brittle since it depends on ordering of what users put in
their host page html.

-Ray



On Thu, Apr 2, 2009 at 7:56 AM, <b...@google.com> wrote:

> [+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 StyleElement.
>
>
>
> http://gwt-code-reviews.appspot.com/15803
>

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

Reply via email to