Closed Bug 67499 Opened 24 years ago Closed 24 years ago

Javascript won't change image over frames

Categories

(Core :: Layout, defect)

x86
All
defect
Not set
normal

Tracking

()

CLOSED FIXED
mozilla1.0

People

(Reporter: bischoff, Assigned: attinasi)

References

()

Details

Attachments

(2 files)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m18) Gecko/20010202 BuildID: 2001020204 Though it works in NN4 and IE, it seems that Javascript in Mozilla won't change images over frames. Reproducible: Always Steps to Reproduce: 1. Load the above url in Netscape 4 or IE 2. Click on the link in the bottom frame and note that the image in the top frame changes 3. Load the url in Mozilla and try step 2 4. Notice that it doesn't change the image. Actual Results: The image in the top frame remains unchanged. Expected Results: The image in the top frame should have changed. This might be related to bug 67347, but that's just speculation. http://bugzilla.mozilla.org/show_bug.cgi?id=67347 Also, I wasn't entirely sure on which Component to select. I picked "Javascript Engine", since that seemed to make sense, but maybe it's HTMLFrames or such.
Confirming the bug on WinNT, and Linux, using 20010201xx builds. The HTML of the given URL has a frameset with two frames, as follows: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Change Image test</TITLE> </HEAD> <FRAMESET ROWS="90,*"> <FRAME SRC="changeimage-topframe.html" NAME="topframe"> <FRAME SRC="changeimage-bottomframe.html" NAME="bottomframe"> <NOFRAMES> <BODY> Sorry, frames are needed to view this demo.</BODY> </NOFRAMES> </FRAMESET> </HTML> TOP FRAME ------------------------------------------------------------------------------ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Page Load Test</TITLE> <script language="Javascript"> // Preload Images staticimage = new Image(104,14); staticimage.src = "images/loadingImageStatic.gif"; loadingimage = new Image(104,14); loadingimage.src = "images/loadingImage.gif"; function reloadPage() { document.location.reload(); } function showProgressBar() { document.progress.src = loadingimage.src; } function hideProgressBar() { document.progress.src = staticimage.src; } </script> </HEAD> <link rel="stylesheet" href="changeimage.css"> <BODY onLoad="hideProgressBar();"> Progress Bar: <img name="progress" src="images/staticimage.gif" width="104" height="14" border="0"> <BR><BR> <script language="javascript1.1"> rand = Math.round(Math.random() * 5000); document.write("Your random number is ", rand,". "); </script> <span class="smalltext"> This is only included so that you'll know if this frame has been reloaded. </span> </BODY> </HTML> ------------------------------------------------------------------------------ BOTTOM FRAME ------------------------------------------------------------------------------ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Change Image Test</TITLE> <SCRIPT LANGUAGE="JavaScript"> // Preload Images staticimage = new Image(104,14); staticimage.src = "images/loadingImageStatic.gif"; loadingimage = new Image(104,14); loadingimage.src = "images/loadingImage.gif"; function showProgressBar() { parent.topframe.document.progress.src = loadingimage.src; } function hideProgressBar() { parent.topframe.document.progress.src = staticimage.src; } </script> <link rel="stylesheet" href="changeimage.css"> </HEAD> <BODY> <BR><BR> <a href="changeimage-bottomframe2.html" onclick="javascript:showProgressBar();"> This link should change the image in the top frame</a>. <BR><BR> <script language="javascript1.1"> rand = Math.round(Math.random() * 5000); document.write("Your random number is ", rand,". "); </script> <span class="smalltext"> This is only included so that you'll know if this frame has been reloaded. </span> </BODY> </HTML> ------------------------------------------------------------------------------
I think Mozilla is having a problem with the top frame itself: http://filebox.vt.edu/users/abischof/javascript/changeimage-topframe.html It is trying to load this gif: http://filebox.vt.edu/users/abischof/javascript/images/loadingImageStatic.gif However, we never see it. I see a space for a gif appear, and then disappear. But never the image itself... Browser, not engine. Reassigning to Layout for further triage - Note: could it be a problem with preloading images? I found the the following bugs on that subject: bug 32269, bug 41107
Assignee: rogerl → karnaze
Status: UNCONFIRMED → NEW
Component: Javascript Engine → Layout
Ever confirmed: true
OS: Windows 2000 → All
QA Contact: pschwartau → petersen
> Note: could it be a problem with preloading images? I found the > the following bugs on that subject: bug 32269, bug 41107 Hmm, the image that is supposed to replace the first image is indeed an animated gif. You could be on to something there..
Moving to m1.0 and reassigning to attinasi.
Assignee: karnaze → attinasi
Target Milestone: --- → mozilla1.0
WORKSFORME, build 2001-04-14-08 on Windows 98 SE.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
This doesn't work for me on build 2001-04-15-08 on Win2k. Compare how Mozilla reacts to IE, for instance -- after clicking the link, the image in the top frame should change to "progress bar" and stay there.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
The image changes to a progress bar for me - it is a nice purple too. I'm using a build from 4/16 on NT - Alex, can you please double-check and make sure you have anew build? Thanks.
I just installed build 2001041604 on Win2k SP1. I have my proxy set to "Direct connection to the Internet", and I made sure to delete my browser cache before installing the new build. Under Debug => Networking, I have HTTP Version set to 1.1, and both "Enable Keep Alive" and "Enable HTTP Pipelining" checkmarked. I mention these settings not because I consider them to be unusual, but just in case. I go through these steps when loading the page: 1. Load the url, and wait for "Document: Done" in the status bar 2. Click the link for "This link should change the image in the top frame" 3. Then, wait for "Document: Done" in the status bar again. At this point, the bottom frame should say "This is the second page", while the top frame should have an animated "progress bar" animating. But, I don't see it. I'd like for this to work-for-me, but it doesn't seem to be cooperating.
This works fine for me on both my NT and Win2K boxes using a fresh CVS pull, debug and release builds, with the options you specified. I'm downloading the binary now to test that. Chris Petersen, can you check this please and note your results? Thanks.
I just tried the url again, this time with build 2001042908 on Win2k: it still doesn't work for me. Marc, I figure that this build should be *at least* as bug-fixed as the CVS pull that you mentioned.. Any ideas?
OK, I finally got back to looking at this - it is failing for me now too on my NT machine. Accepting.
Status: REOPENED → ASSIGNED
As Phil Schwartau noted: "I see a space for a gif appear, and then disappear. But never the image itself..." I just noticed that if you are quick and click the link *before* the image outline disappears - then it works (I see the purple "progress bar" image and it stays). Build 2001-06-01-20 on Windows 98 SE, using a slow modem link.
I think the problem here is that the original image does not exist: <img name="progress" src="images/staticimage.gif" width="104" height="14" But the file http://filebox.vt.edu/users/abischof/javascript/images/staticimage.gif does not exist. For some (bad) reason, image elements the source of which could not be retrieved are being collapsed to zero width in Mozilla. So the progress meter image is actually there, but we can't see it. Moreover, replacing the (non-existent) SRC with another (existent) SRC works, but we can't see the result, since the size of the image is still 0. I will attach another testcase that demonstrates the problem.
Attached file testcase
Good call, Wolfgang. After having fixed the typo in my source, Mozilla handles the situation properly. Marking FIXED. Should another bug be reopened for the collapsed-to-zero-width problem?
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
hm. I wouldn't say this is fixed at all. The bug that caused the original problem is still there. But since I can find no form element that enables me to reopen, I filed a new one: bug 86257.
Making closed per last comments
Status: RESOLVED → CLOSED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: