Safari onblur Crash

July 7, 2005

I was thinking of a way to use Ajax to auto-save form data. I thought adding an onblur handler to form fields might be a good way to grab data from accidentally abandoned forms. To test that the event was fired whenever someone closes a browser window, but hasn’t unfocused the <input> element, I tried this HTML:
<input type="text" onblur="alert('event fired')">

Firefox and IE  6 both fire the event when the browser window is somehow closed or the application exits. When I tested this in a Safari tab, Safari crashed.

I’ve filed bug reports from within Safari before (Safari → Report Bugs to Apple…), but felt that they’d disappeared into the void. Apple had just released WebKit as open source, so I wanted to see if I could get a more personal response to my problem. I checked out the latest WebKit source, built it, and I could still reproduce the crash. I logged into the #webkit IRC channel and spoke with Joost de Valk, a WebKit QA, about the issue. He confirmed the crash right away, and walked me through submitting a bug report.

To reproduce the crash, Warning: Safari will crash, you will lose all of your open windows and tabs. open this link up in a new tab with at least one other tab open in the same window. Give the input field focus (click in it), and close the tab— but not the entire browser. If Safari doesn’t crash for you, please let me know what version you’re running. Better yet, go let Apple know directly.

Archives