Closed
Bug 464064
Opened 17 years ago
Closed 16 years ago
moving multiple iframes via javascript will cause the wrong source to be loaded.
Categories
(Core :: DOM: Navigation, defect)
Core
DOM: Navigation
Tracking
()
RESOLVED
FIXED
People
(Reporter: jirwin, Unassigned)
References
()
Details
Attachments
(3 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
If 1. you come to a page directly by entering the url into the location bar
And 2. that page has two iframes
And 3. on window load you move the first iframe into a div
Then FF3 automatically changes the src of the first iframe to be the src of the second iframe.
When you refresh the page, the move is always then handled correctly on subsequent loads. Going to the page directly again by entering the url into the location bar and the problem returns
Reproducible: Always
Steps to Reproduce:
1.Copy the following code to a web server:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Multiframe test</title>
</head>
<body>
If 1. you come to a page directly by entering the url into the location bar <br />
And 2. that page has two iframes <br />
And 3. on window load you move the first iframe into a div <br />
Then FF3 automatically changes the src of the first iframe to be the src of the second iframe. <br /><br />
When you refresh the page, the move is always then handled correctly on subsequent loads. <br />
Going to the page directly again by entering the url into the location bar and the problem returns <br /> <br />
<div id="movehere" style="border:1px solid black; padding:10px; width:620px">First Iframe moved into this div <br /></div>
First Iframe was here <br />
<iframe id="frame1" src="http://www.google.com/?q=first" width="600px" height="100px" frameborder="1" scrolling="no"></iframe> <br />
Second Iframe is here <br />
<iframe id="frame2" src="http://www.google.com/?q=second" width="600px" height="100px" frameborder="1" scrolling="no"></iframe>
<script>
window.onload=foo;
function foo()
{
div=document.getElementById("movehere");
div.appendChild(document.getElementById("frame1"));
}
</script>
</body>
</html>
2. Go to it
3. See the problem (both iframes will have the same src)
Actual Results:
Both Iframes have the same src - a google search with the term "second"
Expected Results:
The first iframe on the page's src should remain a google search of the term "first" after the move via js.
This happens only if ff3. FF2 it is fine in. This bug is a simple fully reproducible bug that has already been checked on multiple systems. It may be related to https://bugzilla.mozilla.org/show_bug.cgi?id=388714 where ads in different servers have gotten swapped around and hopefully by fixing this it will fix that.
| Reporter | ||
Updated•17 years ago
|
| Reporter | ||
Updated•17 years ago
|
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → 3.0 Branch
Comment 1•17 years ago
|
||
James, when I load this testcase in Firefox 2, Firefox 3, and Firefox 3.1b2 builds I get the same thing: the first iframe has "first" in the textfield, while the second one has "second".
On reload (using the reload button in the toolbar), all three builds show "first" in both textfields. That looks to me like bug 462076. If instead of reloading I focus the URL field after loading this test page and hit enter, I see "second" in both iframes, again in all three builds involved.
Do you see something different on this testcase, or the same thing I see?
| Reporter | ||
Comment 2•17 years ago
|
||
| Reporter | ||
Updated•17 years ago
|
Attachment #347620 -
Attachment mime type: application/x-httpd-php → text/html
| Reporter | ||
Comment 3•17 years ago
|
||
Unfortunately Im not getting exactly the same behavior as you. On reload using
the reload button in toolbar/F5 I am not getting "first" in both fields as you
are. Also what I see wrong is only in ff3.0.3. ff 2.0.0.14 seems to work fine
for me.
I am however in ff 3.0.3 get the problem of "second" in both iframes when going
to the URL field and hitting enter. Also going via a link (such as in test
case I created - https://bugzilla.mozilla.org/attachment.cgi?id=347620) causes
"second" to appear in both for me. Going to it via the link from this page
though it still appears fine though.
It would not surprise me if this is related to the bug that you mentioned. I
hope this test case though can be used to get to the bottom of both of them.
Comment 4•17 years ago
|
||
> Unfortunately Im not getting exactly the same behavior as you.
That's very odd. These are clean profiles (-safe-mode or some such, say), with no extensions?
We know exactly what's going on in the other bug, but it's a problem in Firefox 2 as well as Firefox 3. And we haven't changed the relevant code much between Firefox 2 and Firefox 3. That's why I'd like to figure out why you're seeing the problem in one but not the other...
| Reporter | ||
Comment 5•17 years ago
|
||
So did some more testing on some VMware machines and ff2 and ff3 each with only firebug extension installed.
Results of click in the address bar and hitting enter:
FF2+firebug: displays correctly (first, second)
FF2 -safe-mode with ad-ons disabled: bug exists (second, second)
FF2 -safe-mode with ad-ons enabled (just firebug): bug exists
FF3+firebug: bug exists
FF3 -safe-mode with ad-ons disabled: bug exists
FF3 -safe-mode with ad-ons disabled: bug exists
So just with FF2 in non safe mode and with the firebug extension does the iframes behave as expected. I then looked and saw even with ad-ons enabled in safe-mode firebug doesnt load. So I then disabled firebug, the only extension, and then restarted in non safe mode and the bug appeared.
So believe it or not it seems that in FF2, but not FF3, the firebug extension somehow fixes this bug. Go figure.
Comment 6•17 years ago
|
||
The firebug extension hooks into the timing of pageload things in "interesting" ways. It's been known to cause bugs too.
So the reload issue is certainly bug 462076. I suspect so is the "link to yourself" issue, but it might be different, so leaving this open for now so we can double-check once bug 462076 is fixed.
Status: UNCONFIRMED → NEW
Component: General → Document Navigation
Depends on: 462076
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → docshell
Version: 3.0 Branch → Trunk
Comment 7•17 years ago
|
||
And James, thank you for the testcase and for testing this stuff! It's very much appreciated.
Comment 8•16 years ago
|
||
Google seems to need different query.
Comment 9•16 years ago
|
||
I can reproduce the bug on 3.6 (well, managed to do that once), but not on trunk.
Marking fixed (by bug 462076), but please reopen if you can still reproduce this
on trunk (FF4)
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•