Some of you may know that I write this software primarily for Firefox (on Linux!). Only once in a great while do I pull up Internet Explorer and see just how badly it mangles my pages. Yesterday was one of those days.
Ohmigosh! What happened? The pages all looked like caca. Parsing errors, style errors, framing errors. I know it's been at least a few weeks since I last checked and made everything work, but I couldn't imagine things breaking that badly.
First thing was page parsing errors. This site natively generates valid XHTML. But now I've got content being imported from all over the place. If you import content, you can forget about your pages ever validating again. I'm even re-writing the foreign content to make it compliant. But there's a lot of screwy software out there generating a whole lot of weird stuff and unfortunately there are more ways to write bad XHTML than one can imagine. If you haven't yet imagined it, you aren't going to have the code to fix it.
Next on the list was the cascading style sheets. They are called cascading because you have the ability to override and provide layers of style information. That's how I do themes here. You don't rewrite the entire style sheet, you just write down the things you want to change.
As it turns out, Microsoft claims to support cascading styles, but they are only supported as long as the style information comes from different source types, such as files, inline, or block declarations. They don't support cascading from multiple files. Well, OK they sortof do if you use an @import statement, or fully declare every single block. That doesn't work for me, because I'm figuring out what styles sheets to use on the fly. But if you set an element size in one file and set its color in a second file, it forgets that you already set the size.
I wouldn't have brought it up if I hadn't already fixed it. The solution of course is that if they won't accept multiple files, I'll just have to take all the various CSS files, arrange them, merge them (in real time), and send them out as a single file. Problem solved. As with all things Microsoft, it's a real ugly hack; but at least I turned it into an elegant ugly hack.
Then it turns out that chat was hopelessly broken. I'm not surprised. You may recall that I whipped it up in an afternoon. But I recently started converting it to XML rather than hacked text streams. This requires the Javascript XML parser. If you are using Javascript you already know that there is nothing about it which will work cross platform (though one could argue this point for CSS as well). You've got code x for Microsoft browsers and code y for everything else. So now I had to munge around the DOM and figure out what they call the text content blob that's associated with an XML element and then insert the most widely used block of code ever - "if (ie/microsoft/windows/msdos/whatever) {do this}, else {do it the right way}". In this case I'll actually give Microsoft credit for naming it 'text', whereas the other folks call it 'textContent'.
The box model also bit me again. Sigh. This time it's the W3C that screwed up, but Microsoft happily went along. I need a box, 100 units by 100 units to display on the screen. So let's do it. In firefox you get a box 100 units by 100 units. In IE your box is 140 or so by 140 or so. Because they don't count the scrollbars, and margins and padding and stuff. So you have to fudge. Shrink the box until the outside comes out to 100 and hope nobody uses fat scrollbars. But then on firefox you'll get a box that's 87 by 87. You just can't win - although there are some hacks to at least make firefox honor the same box model. What there isn't is a way to specify a box that's exactly 100 X 100.
I'll probably find a few more IE bugs and then --- I'll turn the infernal thing off for another month or two.
(Sex is a Simple editor for X11)
-- Seen on debian bugtracking

Digg
Delicious
Netscape
Technorati