Closed Bug 174314 Opened 22 years ago Closed 22 years ago

Pop-up window height is incorrect

Categories

(SeaMonkey :: UI Design, defect)

x86
Windows 98
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: bob.clews, Assigned: samir_bugzilla)

Details

Pop-up windows height is rendered less than the 'height' attribute, width is OK
Target Milestone: --- → mozilla1.2alpha
Target Milestone: mozilla1.2alpha → ---
Version is: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2a) Gecko/20020910
What is the URL of the problem (where did it happen and how do you make it happen)?
I first noticed that this happens on my website, but since then I've noticed it on other sites that use pop-up windows. My URL is http://BobsTrains.org.uk - if you click on the guestbook link the image is cut off on the 'SGN BOOK' 'RESET FORM' buttons. More importantly, if you select one of the photo galleries from the site menu, then click on one of the images to enlarge it, the resulting window cuts off around 25% of the photo height, at the bottom. These pop-ups work OK in all other browsers that I've tried (IE5/6, Netscape4/5/6, Opera6)
Bob, The browser will comply with the requested values/settings of outerWidth/outerHeight, width/height and innerWidth/innerHeight as long as no part of the content area would get outside the view of the user. If that ever happens, then the popup window will be resized and be given the screen.availWidth/availHeight dimensions or (if given available space) the popup will be repositioned to the leftmost/topmost location/coordinates where all of the content area can be viewed. This is for security reasons. You say that NS 4 and NS 6 do not have this problem: I would be very much surprised if they do not display the same behavior as in Gecko/20020910. At the very least, NS 4.x, NS 6.x and NS 7 all have the same security behavior regarding size of window and not allowing any part of the content area to be masked or hidden outside the view of the user. Some chrome elements (like statusbar and scrollbars of the popup window can get masked by the window taskbar though). To validate this explanation, try to open your guestbook popup with the same settings but with a higher screen resolution. Here, with a screen resolution of 800x600, the popup gets cut off by about 25%. In your open() call, you also wrongly code this. window.open("gbook/gbook.html,book,toolbar=1,scrollbars=1,width=600,height=550,left=95,top=0") top and left are not supported in NS 4+ and Gecko-based browsers. You can give up to 3 string parameters to your open call. Here you give only 1. This is how your call should be edited: window.open("gbook/gbook.html" , "book", "toolbar=1,scrollbars=1,width=600,height=550,left=95,screenX=95,top=0,screenY=0") http://developer.netscape.com/docs/manuals/js/client/jsref/window.htm#1202731
Netscape 4.79 & 6.2 definitely display both guestbook and photograph windows correctly. The window.open() calls DO have 3 string parameters, where did you see only 1 string ? Another site that displays the same behaviour is http://www.nomatica.com/
I saw this in your code. I still see it. <a href="#2" onclick="javascript:window.open("gbook/gbook.html,book,toolbar=1,scrollbars=1,width=600,height=550,left=95,top=0");"> <img src="gifs/turnbook.gif" border="0" vspace="0" title="Please Sign my Guestbook" alt="Guestbook"><br> <div class="text">Guestbook</div></a> Nomatica sites uses 3 strings: function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } onClick="MM_openBrWindow('http://www.nomatica.com/FR/asp/contact.asp','','width=475,height=575')">contact</a>&nbsp; An height of 575 (that is 575 for the content area, the browser viewport) will for sure exceed the screen.availHeight on Windows (I have 800x600 and visible taskbar, no auto-hide) since the titlebar (and the statusbar as well if Scripts & plugins settings request it) has to be displayed. Therefore, the popup will be positioned at screenY = 0 and the popup is likely to be truncated. Nomatica does not use 3 strings at spots like this (notwithstanding blank spaces within one of the string! this is know to cause layout/display problems): <a href="javascript:var win=window.open('http://www.fia-net.com/certif/certificat.asp?key=1201&lang=FRA', 'certificat', 'width=620,height=382', 'toolbar=no,location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, dependent=yes');"> What is a browser to do if the required height + requested chrome elements (or outerHeight) exceed the screen.availHeight ? and at the same time, comply with the security requirements? The popup window will be truncated, must be truncated somewhere.
I have just ftp'd my navbar.htm file from the server, this is the code that I have cut & pasted from it: <a href="#2" onClick = 'javascript:window.open("gbook/gbook.html","book","toolbar=1,scrollbars=1,width= 600,height=550,left=95,top=0");'> <img src="gifs/turnbook.gif" border=0 vspace=0 title="Please Sign my Guestbook" alt="Guestbook"><br> <div class="text">Guestbook</div></a><br> <a href="mailto:bob_clews@yahoo.com"> <IMG SRC="gifs/email10.gif" BORDER=0 ALT="mailto:bob_clews@yahoo.com"></a><br> As you can see this is different from what you posted, how are you viewing the file?
Bob, I viewed your source-code with a very recent build. In Mozilla 1.2 beta (2002101612) as well, I see only 1 string but I admit that with other browsers, I see 3 strings. Not really my fault... So you were right on this point. But the remaining points are still valid. (content area not being masked or hidden for safety reasons; I need to check top and left... references do not say it's supported in NS 4+). Is the problem you see the same when using a higher resolution? When I go to your site, I see the "SIGN BOOK" and "CLEAR FORM" buttons but not the bottom of the guestbook popup window (the statusbar is masked and about 16 pixels of the content area - the equivalent of the height of the titlebar - is masked, hidden by the window taskbar) and not the bottom end of the content area. I tried the photos; I enlarged 3 photos from your photo galleries and the popup displayed accordingly, without any cutting off. I think you need to create a test case of the problem you see, a reduced case, enlightening the bug you see and give details (your resolution, os setting regarding taskbar if that's relevant,etc.). Reproducibility and good solid working test case are important factors so that bugs can be eradicated. I'm sure you can do a testcase on your site. Maybe you'll need to create a snapshot of what you see. Anyway, you need to isolate the problem from other factors (no frame, no applet, just valid HTML code, supported features in the open call) which could intervene in the behavior you see.
top and left are supported window features in the 3rd argument of window.open() method in Mozilla 1.2beta and in NS 7: so this is news to me as it is not documented anywhere. And top and left have precedence over screenX and screenY.
The same problem occurs at 800x600 and 1024x768. I've created a page which has just one pop-up on it, it displays an enlarged version of a photograph. If you check the larger photo's properties you'll see that it's a 591x401 pixel image, that is the size that the pop-up should be but isn't. the link is: http://BobsTrains.org.uk/test.htm
Your open() call was: window.open("image.htm?photos/fo108.jpg", "mypage1", "status=1,width=591,height=401,left=95,top=25"); and the content area of the popup window was precisely 591w. x 401h. while using XP Pro SP1, build 2002101908 at a 800 x 600 scr. res.: your test case WFM. There was no cut off of the window's height over here.
Bob, I've been working on a meta-testcase for the last 10 days or so. You can try it with Windows 98 and see if you can reproduce the bug you saw. http://jibbering.com/du/MozPopupHelpTestcaseDebugger.html At the bottom of that page (the 4th link), there is a Netscape reference pointing to a .gif image indicating that popup windows cannot be opened with a part of the content area outside the browser viewport.
This is really weird, I used the test case you created and it worked OK on my home PC. I then tried the pop-ups on my website and now they're working. I wonder if there was something lurking in Java cache which your test case removed.
mrk as wfm per reporter comment
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.