M
Martin Honnen
I was playing around with canvas support in recent Safari, Mozilla and
Opera (only version 9 preview) but run into issues with Safari related
to the very old DOM Level 0 Image object for preloading images.
When doing e.g.
var img = new Image();
img.onload = function (evt) {
alert(this);
};
img.src = 'whatever.gif';
I expect the this object in the onload event handler to be the img
object the event handler is attached to.
Not so with Safari it seems, the this object is the window object and
even the event object does not seem to give you any properties (like
target) to get the img object.
Complete test case is here:
<http://home.arcor.de/martin.honnen/safariBugs/imageOnloadThisObject1.html>
Can anyone confirm that?
I see it with Safari 1.2, 1.3, 2.0.
Does anyone know that problem? I don't see any reason to implement it
that way, rather seems a big bug to me.
Is anyone here close to Safari development to consider filing a bug at
the proper location?
Could anyone test whether the problem also occurs with Konqueror versions?
Opera (only version 9 preview) but run into issues with Safari related
to the very old DOM Level 0 Image object for preloading images.
When doing e.g.
var img = new Image();
img.onload = function (evt) {
alert(this);
};
img.src = 'whatever.gif';
I expect the this object in the onload event handler to be the img
object the event handler is attached to.
Not so with Safari it seems, the this object is the window object and
even the event object does not seem to give you any properties (like
target) to get the img object.
Complete test case is here:
<http://home.arcor.de/martin.honnen/safariBugs/imageOnloadThisObject1.html>
Can anyone confirm that?
I see it with Safari 1.2, 1.3, 2.0.
Does anyone know that problem? I don't see any reason to implement it
that way, rather seems a big bug to me.
Is anyone here close to Safari development to consider filing a bug at
the proper location?
Could anyone test whether the problem also occurs with Konqueror versions?