Opens new window for each window.open even though we want to use same child window opened previously.

VERIFIED FIXED in M14

Status

()

Core
DOM: Core & HTML
P1
blocker
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: Prashant Desale, Assigned: travis)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [PDT+], URL)

(Reporter)

Description

18 years ago
If we use window.open continously to load new pages in the same child window 
one after another, then it keeps on opening new window for each window.open 
call. 

In our automation testing we open new window for loading every new testcase, and 
now this is opening new window for each new testcase. Which inturn makes 
application to crash. We have thousands of testcases. 

BUILDS: 2000-02-10-09.

OS TESTED ON: Win-95, Linux.

STEPS TO REPRODUCE:
1] Please visit above URL.
2] You'll see one parent window. This parent window will keep on opening one 
child window.
3] You'll see one counter on child window. And you'll see totally 5 new windows 
opened.

OR

1] Please copy HTML codes I'm providing for parent window, as well as child 
window. Save those HTML files. Make chages in variabe 'url' in parent window 
code, according to new file locations.
2] Open parent file with above specified builds.
3] You'll see one parent window. This parent window will keep on opening one 
child window.
4] You'll see one counter on child window. And you'll see totally 5 new windows 
opened.

EXPECTED RESULTS:
Parent window should open child window 5 times, and keep on loading page in 
same child window.

ACTUAL RESULTS:
It opens 5 new windows for each window.open call.

TESTCASE CODE FOR PARENT WINDOW START:
<HTML>
<HEAD><TITLE>Continous Window.Open()</TITLE></HEAD>
<BODY>
This is Parent Window which is going to open child window 5 times.
<SCRIPT>
<!--
var tcnum=1;
opennewwin();
function opennewwin()
{
  if(tcnum != 6)
  {
  
    url = 'http://bubblegum/desale/opennewwin1.html';
    testWin = window.open(url, 'testWindow');
    testWin.opener = self;
    testWin.focus();
    tcnum++;
  }
}
//-->
</SCRIPT>
</BODY>
</HTML>
TESTCASE CODE FOR PARENT WINDOW END:

TESTCASE CODE FOR CHILD WINDOW START:
<html>
<head>
<title>Child window</title>
</head>
<body>
This is child window which is going to get opened by parent window 5 times.
<SCRIPT>
<!--
document.write('<H1>');
document.write('Window Open Counter = ');
document.write(window.opener.tcnum);
document.write('</H1>');
window.opener.opennewwin();
//-->
</SCRIPT>
</body>
</html>
TESTCASE CODE FOR CHILD WINDOW END:
(Reporter)

Comment 1

18 years ago
Priority to P1. New blocker for automation. 
Keywords: beta1
Priority: P3 → P1
(Reporter)

Comment 2

18 years ago
Forgot to specify URL.

Comment 3

18 years ago
Introduced by Travis' checkin last week? I'll leave it to danm to find out. 
Prashant, window.open bugs should, in general, go directly to danm. Sorry, Dan!
Assignee: vidur → danm
(Reporter)

Comment 4

18 years ago
Oh OK. Now onwards I'll assgin window.open bugs directly to danm.

Comment 5

18 years ago
Putting on the PDT+ radar for beta.
Whiteboard: [PDT+]
(Assignee)

Comment 6

18 years ago
I probably caused this regression..
Assignee: danm → travis

Updated

18 years ago
Target Milestone: M14

Comment 7

18 years ago
Travis, I think I found at least part of the cause of this, or this patch

actually makes things work properly on windows but not on linux (I have no clue

why not!)



Index: docshell/base/nsDocShell.cpp

===================================================================

RCS file: /cvsroot/mozilla/docshell/base/nsDocShell.cpp,v

retrieving revision 1.56

diff -u -r1.56 nsDocShell.cpp

--- nsDocShell.cpp      2000/02/14 10:27:32     1.56

+++ nsDocShell.cpp      2000/02/16 22:31:44

@@ -601,6 +601,7 @@

       {

       *_retval = NS_STATIC_CAST(nsIDocShellTreeItem*, this);

       NS_ADDREF(*_retval);

+      return NS_OK;

       }



    // Second we check our children making sure not to ask a child if it







OS: Windows 95 → All
Hardware: PC → All

Comment 8

18 years ago
Argh, seems like mozilla added extra whitespace, grr, well, it's not like the
patch is very complicated so I think you'll figure it out...
(Assignee)

Comment 9

18 years ago
Hey, great catch, I have been busy with other bugs and hadn't had a change to 
even look at this one.  It's great to come to it and find someone has helped 
out by providing a fix.  Thanks a lot!  I've applied it and will be checking it 
in soon.  Will investigate the Linux side next...
(Assignee)

Comment 10

18 years ago
I just tried this on Linux and it works.  Marking this fixed as that was the 
last remaining issue on this bug.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 11

18 years ago
Travis, you're welcom, glad I was able to help you.

I tried this again on linux and it *does* work, I must have not compiled it
yesterday or screwed something else up, sorry about the confusion.
(Reporter)

Comment 12

18 years ago
Now this one is working fine. Thanks guys, it was blocking our automation.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.