> > >> +// N.B.: Uses DOM methods instead of jQuery to ensure cross-browser > comaptibility. > > > > I though much of the point of libraries like jQuery was to make it so > > you didn't have to ensure cross-browser compatibility? >
More background: TiddlyWiki's implementation of setStylesheet() is an intricate piece of coding that dynamically adds (or removes) a set of stylesheet definitions. Unlike similar functionality in other libraries, the stylesheet is specified in ordinary CSS syntax, and not, say, as a set of name/value pairs. Getting it working originally (before jQuery was invented) was one of those horribly familiar exercises in cross-browser compatibility. It takes a slightly different approach for IE from other browsers, and the precise sequence of operations turns out to be critical. One of the basic operations, for example, is to append something to the DOM tree. In ordinary jQuery development, that is encapsulated in the jQuery.append() method. What Fred was getting at was that an observer might expect the stylesheet code to use jQuery.append() where it can to do the appending. It turns out, though, that jQuery does much complex processing behind the scenes for append() than might be expected at first glance. It's not always clear which code path is going to be used in given circumstances. This has implications for the stylesheet code, which, as discussed, is very vulnerable to changes in the sequence of operations. So, Fred's choice was something like this: a) Use the existing stylesheet code, which has been tested through use in production for more than three years b) Reimplement that code using jQuery primitives, and then retest in all those browser/operating system combinations We selected (a) because it's the more conservative, economical course. Cheers Jerm > > I've discussed this with Jeremy. > Since the CSS rules have to be evaluated after being injected into the > document, browsers are quite peculiar here. That's why we're relying on > the proven (and partially browser-specific) low-level methods for now. > > Having said that, I do have a jQuery-fied version of the internals on my > local Git branch, and plan on testing that in various browsers to see > whether it works (would save quite a few LoC). > > > -- F. > > > > -- Jeremy Ruston mailto:[email protected] http://www.tiddlywiki.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/TiddlyWikiDev?hl=en -~----------~----~----~----~------~----~------~--~---
