That's a rather lawyerly interpretation of the very minimal javadoc. You've given me a method that says "give me a style element and I'll insert this code after it," which strongly implies that you'll do your best to insert the code right after it, not all the way at the end of the head. You're really violating the principle of least surprise. What is the argument against
Node following = element.getNextSibling(); element.getParentElement().insertBefore(following, element); and why doesn't it apply to your implementation of injectStyleSheetBefore? Also, it seems like the javadoc needs to be a lot more forthcoming about the IE issues, with the inject methods warning the the element returned may contain a lot more than just the newly injected CSS on IE with more than 30 sheets. rjrjr On Wed, Apr 1, 2009 at 1:19 PM, <[email protected]> wrote: > > 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); > On 2009/04/01 20:05:03, rjrjr wrote: > >> Your public api implies promises that aren't being kept here--I'd >> > assume that if > >> I had <style> /* a */</style><style> /* b */</style><style> /* c >> > */</style> and > >> I called this with the b block as an argument, that the rules would be >> > inserted > >> before those in c block. This would be inserting it after c, right? >> > > No strict ordering is actually guaranteed by the javadoc. It can't be, > due to the limitations in the IE version. I'd have to know where in the > middle of a block to insert the new text if b and c were both in the > maximum-numbered stylesheet. > > The only thing guaranteed by the javadoc is the relative ordering of the > to-be-injected CSS relative to the old CSS. > > > http://gwt-code-reviews.appspot.com/15803 > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
