Closed Bug 3798 Opened 26 years ago Closed 26 years ago

window.innerHeight AND window.innerWidth return wrong values.

Categories

(SeaMonkey :: UI Design, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: neil, Assigned: danm.moz)

Details

Attachments

(1 file)

I got a value of 8132552 from a document.writeln(window.innerWidth); My window is big, but not that big! This is from the March 12 build of Apprunner.
Assignee: vidur → joki
Status: NEW → ASSIGNED
Yeah, the apprunner guys apparently don't yet implement nsIBrowserWindow. I'll fix it to return 0 when it fails.
QA Contact: 4646 → 4616
Updated QA contact.
I tested same command and it gives me result 991. So I don't see any problem there.
What did you test it under. It works fine in viewer, it just doesn't work in apprunner.
I'm sorry I tested it with viewer, so it was working fine. It does not work with apprunner it gives me result 8363720. Its not working, I don't know what is the cause.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Checked in afternoon, 3/29. Value is initialized to zero for cases where out application (currently apprunner) doesn't provide this info.
Status: RESOLVED → REOPENED
Component: DOM Level 0 → Apprunner
Summary: window.innerWidth returns junk → window.innerWidth returns junk in apprunner.
I checked this bug. Initially it was returning garbage, but now it returns zero. Actually it is supposed to return some number which is innerWidth of the window, but it returns zero. I'm reopening the bug, and assigning it to apprunner. This problem is just in apprunner. Providing information to reproduce the bug. Product: Seamonkey.[apprunner as well as viewer] Build Date: 03/22/99 Platform: PC [Windows-95] Steps to Reproduce: 1] Please copy the code I'm providing. Save as HTML file. 2] Open this HTML file in apprunner as well as viewer. 3] You will see one button "Check innerWidth. Click that button. 4] It should give innerWidth of the window in result text box. Expected Result: The actual innerWidth of the window is expected in result text box. Actual result: Its giving innerWidth as zero. Code: <html> <head> <title>Test innerWidth</title> </head> <script> <!-- function init(){ window.status="Seamonkey"; } function report(text) { var value=document.workform.result.value; var msg= value+ " " +text; document.workform.result.value=msg; } //--> </script> <body onLoad="init();" > <form name="workform" > <input type="button" value="Check innerWidth" name="Reset2" onClick="report(window.innerWidth)"><br> Result Text Box<INPUT TYPE=text NAME="result" SIZE=80> <input type="reset" value="Reset"> </form> </body> </html>
By mistake in product I said [apprunner as well as viewer]. This problem is just for apprunner.
It happens on buld 03/31/99 also.
As clarification of what needs to be done, the javascript window object receives information and controls new window opening and such via the nsIBrowserWindow interface. Currently we don't find one when we query for one.
Resolution: FIXED → ---
Assignee: joki → rpotts
Status: REOPENED → NEW
Apprunner needs to implement nsIBrowserWindow. Talked briefly with rpotts about it. Giving to him to either fix or reassign.
Assignee: rpotts → radha
Component: Apprunner → XPApps
OS: Windows 95 → All
Priority: P3 → P2
Hardware: PC → All
Target Milestone: M6
Re-assigned to radha@netscape.com; set target milestone to M6; changed component to XPApps, priority to P2, and platform and OS to All.
Status: NEW → ASSIGNED
Apprunner now implements nsIBrowserWindow and this test doesn't return junk anymore. But it returns the same number though I rezsized the apprunner several times. Viewer also behaves the same way. It returns the same # after several resizes. I guess that is a bug with innerwidth. Vidur, joki any input here?
Apprunner now implements nsIBrowserWindow and this test doesn't return junk anymore. But it returns the same number though I rezsized the apprunner several times. Viewer also behaves the same way. It returns the same # after several resizes. I guess that is a bug with innerwidth. Vidur, joki any input here?
Won't be here for M6. Moving to M7
Assignee: radha → don
Status: ASSIGNED → NEW
Don, I don't quite believe that the problem now is, webshellwindow not implementing nsIBrowserWindow. WebShellWindow does now implement BrowserWindow and I still see some problems which is described in my comments above. I spoke to Matt about this. I don't think this belongs to me. I think this s'd go to someone in gecko team. Reassigning to you.
Well it sorta works now as well. We no longer return junk, the value is valid but unfortunately the value includes the chrome. window.outerWidth/Height should include the chrome and is probably ok. window.innerWidth/Height should be client area only and as far as WebShellWindow is concerned, it is. Unfortunately the client area also contains the UI. So what we need is specialized handling for the content area only. I know hyatt has spent some time dealing with this for other webshell issues, he may know the right thing to do.
Reassign this to me. I'll take it.
Assignee: don → hyatt
Target Milestone: M7
OK, it's yours ...
Assignee: hyatt → danm
Giving this one to danm. We need to have a method on nsIBrowserWindow that returns the bounds of the "content area". This can be used for innerWidth and innerHeight. This ties in with the idea that there should be one primary area in a chrome window that is labeled as the "supreme" content area. Right now a window can have many content areas and that's ok, but we do need a notion that one of them is the king of the content areas. :)
Mass migration of minor danm bugs from M7 -> M8
Status: NEW → RESOLVED
Closed: 26 years ago26 years ago
Resolution: --- → FIXED
hyatt stepped on this one as he was ambling by
Status: RESOLVED → VERIFIED
Working fine now. Marking verified.
Status: VERIFIED → REOPENED
Summary: window.innerWidth returns junk in apprunner. → window.innerHeight AND window.innerWidth return wrong values.
Resolution: FIXED → ---
Reopening this bug, coz I just tested it with todays builds and found that its returning wrong values. PRODUCT: Seamonkey.[apprunner] BUILD: 08-16-09 PLATFORM: Windows-95 STEPS TO REPRODUCE: 1] Please copy the code I'm providing. Save as HTML file. [Or you can use the attachment I provided] 2] Open this HTML file in apprunner as well as viewer. 3] You will see two buttons. One is "Check innerHeight" and other is "Check innerWidth". You'll see result boxes infront of respective buttons. 4] Click button "Check innerHeight". Then 5] Click button "Check innerWidth". EXPECTED RESULTS: The innerHeight: text box should show 600 and innerWidth: text box should show 700. innerHeight: 600 innerWidth: 700 [Expected result is like this because code is setting window.innerHeight=600 and window.innerWidth=700.] ACTUAL RESULTS: innerHeight: 264 innerWidth: 692 CODE: <html> <head> <title>Default Status</title> </head> <script> <!-- function report(text) { var value=document.workform.result.value; var msg= value+ " " +text; document.workform.result.value=msg; } function report1(text) { var value=document.workform.result1.value; var msg= value+ " " +text; document.workform.result1.value=msg; } //--> </script> <body > <script> <!-- window.innerHeight=600; window.innerWidth=700; //--> </script> <form name="workform" > <input type="button" value="Check Window innerHeight" name="Reset2" onClick="report(window.innerHeight);"> &nbsp innerHeight:<INPUT TYPE=text NAME="result" SIZE=20><br><br> <input type="button" value="Check Window innerWidth" name="Reset2" onClick="report1(window.innerWidth);"> &nbsp innerWidth:<INPUT TYPE=text NAME="result1" SIZE=20><br><br> <input type="reset" value="Reset"> </form> </body> </html> END OF CODE
Nisheeth, I know you've been by this code recently. Could you take a look at this?
Target Milestone: M8 → M10
setting M10, since it is a regression.
Status: REOPENED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: --- → FIXED
apprunner's window was sizing the chrome webshell, rather than the content webshell (and then returning the size of the content webshell, so they didn't match.)
Status: RESOLVED → VERIFIED
Now, its working. Marking verified.
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: