1. Display:none; Bug
Edit (2005-06-08) This bug is fixed in the open version of WebKit (which is pretty much developer-only at this point).
I'm in the middle of digging out from latest Safari release and I noticed this bug which will actually crash a virgin copy of Safari 1.3 (v312). (Confirmed in Safari 2.0 (v412) as well.)
The code below is the most trivial example that I can find. Basically, if you try to hide an image by setting display:none; Safari crashes hard, but it seems to require 2 preconditions:
that you've queried the dimensions of the image
collapsing the image would affect the height of the parent container
It looks like it may not be entirely related to images. I think I might have found another instance hiding a block element surrounding an image using the same technique. I sent a note in the Crash Reported with this sample file and as much explanation as possible. Hopefully someone will have a look. Perhaps I'll send a note to Dave Hyatt, the Surfin' Safari guy. (Note: submitted to Apple's bug reporter 2004-04-18)
<html>
<head>
<title>test</title>
<script language="javascript">
function test()
{
for (var i = 0, len = document.images.length; i < len; i++)
{
var image = document.images[i];
image.width;
image.style.display = "none";
}
}
</script>
</head>
<body onload="test();">
<div>
<img src="1.gif"><br />
<img src="2.gif">
</div>
</body>
</html>
2. Synchronous XMLHttpRequest Bug
If you make a synchronous data call to an XMLHttpRequest object and you have a PAC file (Proxy Access Configuration) set up, this will hang indefinitely. You have to force quit Safari. This doesn't happen if you run the command with the asynchronous flag.
Haven't reported this one yet, need to play more and make sure I've reduced it to a core problem.
<html>
<head>
<script language="javascript">
function callURLSync()
{
_xmlHttpReq = new XMLHttpRequest();
if (_xmlHttpReq)
{
// false means run synchronous
_xmlHttpReq.open("GET", '/some_url', false);
_xmlHttpReq.send(null);
}
}
</script>
</head>
<body>
<a href="#" onclick="callURLSync();"> test </a>
</body>
</html>
Here's a sample PAC file (obviously this doesn't do anything but pass the connection through, but that's the point):
function FindProxyForURL(url, host)
{
return "DIRECT";
}
3. IFRAME Bug
Occasionally in Safari 2.0 (v412) an IFRAME will open a file:// URL in a window in the Finder. That should pretty much never happen as far as I'm concerned. It's most easily demonstrated with a directory, but it sometimes happens with files too. This was a nasty thing to fix for PithHelmet. The block files would keep getting opened in the Finder - not smooth.
<html> <body> <iframe src="file:///Users/Shared"></iframe> </body> </html>
Wikir