Event handler assigned to wrong object

It appears that when you use the prototype object to assign custom methods to event handlers (in this instance `onload`), Safari incorrectly reassigns the `this` keyword to `Window`, when it should reference the object you initially assigned the method to.

In Safari (1.3 and 2+) the onload function will alert the `Window` object when one would expect it alert `Image`.

Test page Workaround is not included
Reported by: Tom Biegeleisen.

Safari | Reported on 3 April 2007.

This site is no longer maintained. I’m sorry, but it’s just too much work for too little return. You can continue to browse old bug reports, though.

Search reports by browser:

Atom RSS


(Add your own)

1 Posted by Mark Rowe on 28 May 2007 | Permalink

As the test case mentions, this has been fixed in recent builds of WebKit.

2 Posted by Brandy on 14 June 2007 | Permalink

As you might expect, this bug is fixed in Safari 3 Beta on a Mac. (I'm using 10.4.9 on a Macbook Pro.)