Mac OS X - Safari crashes when using the CSS Styleswitcher

The CSS Styleswitcher used on has been tested in a wide variety of OS's and browsers, but for some reason that I'm still trying to figure out, it causes the Mac OS X Safari browser to crash.



The closest explanation on why this might be happening is from OS X user Feisty-Cadaver:

- If I remove everything in the body except the Navcolumn and Navmenu divs, and leave one...
<ul><li><a href="styleswitcher.html">Arcade Paradise</a></li></ul>
...line, it will crash.

- if I remove the link from the <li> and put plain text, it will not crash.

- if I remove the navmenu div and leave the <a> tag, it will not crash.

What's odd though, is that it never seems to get to the JS part in setActiveStyleSheet() that actually enables/disables a particular stylesheet (I've put alerts all through that function, and it always dies before... making me think the styles really shouldn't be changing yet. It's really quite strange.

If i remove the <A> from the one <UL> it will not crash. I can leave the <A> and remove the NavMenu div and it will also work ok.


So somehow, it looks like a line can be a list item (an <li> ) or it can be a link, but it can't be both?? I have no idea why this could be.

At this point, I'm going under the assumption that the problem lies with the Safari browser, and not with the code or the JavaScript used on this site. I'm coming to this assumption based on the following reasons:

  1. All pages at conform to the XHTML 1.0 Transitional and CSS 2 standards of the W3C. In other words, it's not like I'm cranking out some kind of IE-proprietary site here.
  2. The styleswitcher JavaScript was downloaded from (and based on a tutorial at) A List Apart, which is the mothership website of web standards compliance. If ALA says it's okay, I'm going to believe them.
  3. The site and the styleswitcher work on every single modern OS and browser that it's been tested on, including OS X browsers Camino, Firefox, and Opera. Safari is the only browser that has this problem.


So there's the quandary that I'm at. My decision - at least for now, while this problem is still ongoing - is to leave the CSS styleswitcher in as-is. My decision is based on the following factors:


Now that I'm an OS X user myself (typing this from my new iBook!), I've had the "pleasure" of watching Safari crash enough times that I'm pretty content with the opinion that Safari is just a buggy piece of poo. I really hope that Apple gets Safari straightened out when Tiger is released, but I guess we'll see...



Testing and Results

The following OS platforms and browsers have been tested and are reported to be able to correctly render pages on, and more importantly, are reported to be able to use the Styleswitcher without any problems:


The following two configurations load and display fine, but are known to crash the browser when the Styleswitcher is used:


I have a bug report submitted to Apple, but for now, my suggestion to my Safari-using friends would be to get the Safari monkey off your back and use a browser that doesn't go down like a five-dollar whore at every opportunity. I'm currently using and loving Firefox 1.0. :)


| home |