Closed
Bug 29186
Opened 25 years ago
Closed 25 years ago
onMouseOver really fast makes image disappear for a second
Categories
(Core :: Graphics: ImageLib, defect, P3)
Tracking
()
M18
People
(Reporter: arnoudb, Assigned: rogerl)
References
()
Details
When using PNG images in a menu with an onMouseOver, it sometimes takes a while
before the new image is displayed. The faster you move the mouse, the worse it
gets, especially if you move over the menu in a vertical way. This also seems to
happen with other image formats, like GIF and JPG, but not nearly as often. (I
have but a PNG, GIF and JPG version of the same menu at the above URL)
Another thing is that when you move the mouse out of the image area too fast,
the onmouseout does not always work, and the old image hangs in there.
These things might be two different things, but might also be tied together, as
far as I can tell.
Comment 1•25 years ago
|
||
Very interesting bug. We were not sure what was the best component for this.
It is partly image related.
Direct link to the PNG version that is esay to reprodice
http://www.xs4all.nl/~berendse/moztest/png/menu.html
Direct link to the JPG version that is sorta easy to reproce
http://www.xs4all.nl/~berendse/moztest/jpg/menu.html
Direct link to the GIF version that is harder to reproduce
http://www.xs4all.nl/~berendse/moztest/gif/menu.html
Status: UNCONFIRMED → NEW
Ever confirmed: true
I'm not seeing this on NT. I'll see if I can dig up
a win2000 machine somewhere. Anyone notice this problem
on any other platforms?
Could you give us more info on the win2000 machine?
How fast? How much ram?
thanks,
pn.
Status: NEW → ASSIGNED
Target Milestone: M16
Comment 3•25 years ago
|
||
Sorr, i should have added when I saw this bug from arnoudb@futurenet.nl i was on
Win95.
Reporter | ||
Comment 4•25 years ago
|
||
Which of these two issues aren't you seeing on NT? The problem that images
"hang" sometimes even after onmouseout should've executed, or the one that the
PNG images disappear for a moment if you mouseover really fast? (It happens with
GIF and JPG only rarely. I haven't been able to figure out when exactly it
does.)
When I found and reported this bug I was on a P1-225MHz machine with 80MB RAM
and Win2000. I later checked this on a P2-400 with 128MB (also running Win2k).
The problem with the lag in displaying the PNG images seemed much less on that
machine, but it was still quite easy to reproduce. I was unable to reproduce the
lag in the GIF and JPG images on that machine (but that was already hard to
reproduce even on the slower system). It seems to me the mouseOver wants to
display the new image too "eagerly", even before the new image is loaded, so the
problem doesn't show that much on faster systems (that can load the images
faster).
As for the onMouseOut not displaying the correct image after leaving the image
area, I have traced that down to be a scripting bug! (That, most likely, makes
this a completely different bug from the above, so maybe it's best to split this
Bugzilla bug in two...). Look at the, perhaps somewhat unconventional, script
for changing between images:
path = "images/"
on = "_on.png"
off = "_off.png"
function switchimg(img)
{ if (document.images[img].src.indexOf(on) != -1)
document.images[img].src = path + img + off;
else document.images[img].src = path + img + on;
}
This code is somehow producing the hanging images when moving the mouse over the
menu really fast. It I replace it with this, more conventional, code:
path = "images/"
on = "_on.png"
off = "_off.png"
function switchimg(img, how)
{ if (how)
document.images[img].src = path + img + on
else document.images[img].src = path + img + off
}
then it works fine. Below are some links to the menu with the working script.
(Link to GIF version with new script)
http://www.xs4all.nl/~berendse/moztest/script/gif/menu.html
(Link to JPG version with new script)
http://www.xs4all.nl/~berendse/moztest/script/jpg/menu.html
(Link to PNG version with new script)
http://www.xs4all.nl/~berendse/moztest/script/png/menu.html
I am having a similar problem with "hanging" gif images at
http://www.vortxweb.net/ccs-pg/holidays/mz_aprilfool.shtml
The page has js functions for cursor trails (6 gifs that follow the cursor
around the screen). 99% of the time, the last image hangs in its initial
position near the top left corner of the page. Occassionally, the last 2 will
hang, but usually it's just the last one.
reassigning to a js person.
It doesn't appear to be a problem of decoding
or rendering the images.
Assignee: pnunn → rogerl
Status: ASSIGNED → NEW
Assignee | ||
Comment 7•25 years ago
|
||
I ran a timing test on the JS code under 4.72 and a 3/23 optimized mozilla
build.
4.72 Mozilla
indexOf() 26939 32265
direct 6289 18391
(milliseconds for 1000000 iterations)
Status: NEW → ASSIGNED
Comment 8•25 years ago
|
||
Could this be a race condition within the js interpreter? This is more than
just a minor irritant, it makes any site that uses rollover likely to fail (in
the sense that the page looks ****) using mozilla.
Assignee | ||
Updated•25 years ago
|
Target Milestone: M16 → M18
Comment 9•25 years ago
|
||
Update: still problems on WinNT using Mozilla debug build made on 06/07/00.
1. Go to http://www.xs4all.nl/~berendse/moztest/png/menu.html with Mozilla.
MouseOvers that are horizontal seem to work OK. No matter how fast I move the
mouse horizontally, the MouseOver events occur. But fast vertical mouse
movements do not seem to produce the events consistently.
In NN4.7 response was very good both for horizontal or vertical.
In IE4, horizontal movement fine, but vert movement showed occasional problems -
i.e. occasionally none of the events would occur; or only one which would "hang"
2. Go to http://www.vortxweb.net/ccs-pg/holidays/mz_aprilfool.shtml in Mozilla.
The "cursor trails" don't work very well. You only get a small number of them
forming, and some of them "hang" ...
In NN4.7 the trails work perfectly. They create quickly and decay properly.
In IE4, after a few seconds of mouse movement, I get script errors. The dialog
box says:
An error has occurred in the script on this page
Line: 137
Char: 3
Error: 'dom' is not an object
Code: 0
Line: 149
Char: 12
Error: 'dom' is not an object
Code: 0
NOTE: in Windows NT Task Manager, I monitored the CPU usage on this page:
NO MOUSE MOVEMENT RAPID MOUSE MOVEMENT
NN4.7 0 - 7 % 25 - 40 %
IE4 2 - 13% 45 - 55 %
Moz 75-90% (!!!) 100%
CPU is at 75-90% when Moz is displaying this page, WITHOUT ANY MOUSE MOVEMENT!!!
No messages are appearing in the debug console during this time. However, this
leaves so little CPU to handle the cursor trails, no wonder they don't render
well !
Comment 10•25 years ago
|
||
The reason it takes a while for the new image to be displayed is because the
image cahce is not working. See bug 20110. As for events getting wedged, I
have no idea. If the events are really getting wedged, please update the
description on this bug. If not, please mark this as duplicate of bug 20110.
Assignee | ||
Comment 11•25 years ago
|
||
I'm not seeing any evidence that events are getting lost or (and in any case)
that the JS engine is responsible for the image delay. Dup'ing to 20110, but
feel free to re-open after that closes out and this is not fixed.
*** This bug has been marked as a duplicate of 20110 ***
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Updated•24 years ago
|
Status: RESOLVED → VERIFIED
Comment 12•24 years ago
|
||
verified. using the 2000092808 m18 nightly on win2k.
You need to log in
before you can comment on or make changes to this bug.
Description
•