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)

x86
Windows 2000
defect

Tracking

()

VERIFIED DUPLICATE of bug 20110

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.
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
Sorr, i should have added when I saw this bug from arnoudb@futurenet.nl i was on Win95.
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
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
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.
Target Milestone: M16 → M18
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 !
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.
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
Status: RESOLVED → VERIFIED
verified. using the 2000092808 m18 nightly on win2k.
You need to log in before you can comment on or make changes to this bug.