Mozilla 1.0 Commentary
Can I just say how happy I am that Mozilla 1.0 is finally here? I've been writing DHTML apps for a long time. Now, when I say DHTML I mean truly interactive content, more along the lines of what you usually see in flash apps or Java applets. One of the first DHTML apps I wrote was an intranet website for Microsoft's New York Marketing group. I built it during the beta of IE4.0 and launched the app shortly after IE4.0 went gold. I published a quick overiew of it along with some screenshots back in 1999, perhaps I can get more into the implementation sometime, but sufficed to say that it was an awesome experience. The HTML DOM was a beautiful thing even back then when it wasn't 100% standardized and now that, more recently with IE5+ and Mozilla 1.0, the HTML DOM is layered on top of the core XML DOM it's even more beautiful.
Anyway, back to Mozilla in a second, but first I need to set the stage:
Today, I work for Mimeo. I won't bore you with a sales pitch here, you can check out the site if you'd like more info about us, but a mission critical part of our offering is the ability to dynamically create and see your documents online. To do this we developed a two step wizard consisting of two "controls" which allow you to dynamically combine files and then format the overall document. For the first piece, combining, we had to develop two completely different versions of the renderer for Netscape 4.x and IE4+ (we do not even bother to support NS6.x as it was a complete nightmare and never got anything we threw at it quite right). IE4+ allowed us to dynamically add content such as table rows, divs, whatever. Netscape 4.x, while it did allow you to write dynamic content, forced you to rewrite everything to the document and the performance and stability was just abominable. For the second step, formatting, the content of the page was relatively static. No new elements need to be created, all we do is change image sources (HTMLImageElement::src), show/hide divs (ElementCSSInlineStyle::visibility), and change text (IHTMLElement::innerText in IE and document.open/writeline in NS4.x). The rest is pure JavaScript business logic which has run in NS4.x, IE4+, and Mozilla1.0 browsers almost flawlessly with no browser detection whatsoever for the past three years. So, hurray for one standard (albeit 3.0 JavaScript)! So, I think it's fair to say we have a pretty complex application compared to most DHTML out there, which is usually fireworks, some flying text, cursor chasers, sticky notes, etc.
Since Mozilla hit 0.9 we've taken every public release and run it against our site. Initially, since we coded for IE4+ and NS4.x, Mozilla was being treated like an IE4+ browser. This was fine for the most part, but we did find a few places where we were being too IE specific (shame on us!). So we tweaked and made those pieces use more abstract HTML DOM approaches to whatever problem they were solving. Happy to say, both controls work almost flawlessly in Mozilla now also with only a little tweaking to existing code.
Now, you might have noticed a couple of "almost"s back there. First off, the performance of in Mozilla in the DHTML area still isn't quite up to par with IE5+. I've seen the performance comparisons of other features, but none of these tests seem to tax the DHTML capabilities of the browser. We're also slowly discovering silly little things that just shouldn't exist as bugs in Mozilla. In fact, today I found one that inspired me to write this little commentary. For anyone familiar with regular expressions, try this little puppy out in NS4.x, NS6.x, IE4+, and Mozilla:
<codeSnippet language="JavaScript">
// A regex to trim strings
var objTrimmingRegexp = /^s*(S+(s+S+)*)*s*$/g;
// right answer IE4+, NS4.x, NS6.x, Mozilla1.0
window.alert(" hello world! ".replace(objTrimmingRegexp , "\"$1""));
//right answer IE4+, NS4.x, NS6.x
// wrong answer Mozilla1.0
window.alert(" ".replace(objTrimmingRegexp, "\"$1""));
</codeSnippet>
Also, an annoying UI bug we've seen is that whenever you have a <select size="N > 1"> list that contains enough options to cause the list to scroll, whenever you highlight an item in the list, the list control scrolls it to the top of the list.
To wrap up, I'm truly looking forward to finally ditching support for the NS4.x in our next version of our product. Truthfully, it's not about ditching NS4.x, it's about finally being able to take full advantage of standard technologies that, while they've been around for a while, are finally supported in more than one major browser.
Kudos to the Mozilla team for doing such a great job!