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)
SeaMonkey
UI Design
Tracking
(Not tracked)
VERIFIED
FIXED
M10
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.
Updated•26 years ago
|
Assignee: vidur → joki
Updated•26 years ago
|
Status: NEW → ASSIGNED
Comment 1•26 years ago
|
||
Yeah, the apprunner guys apparently don't yet implement nsIBrowserWindow. I'll
fix it to return 0 when it fails.
Comment 3•26 years ago
|
||
I tested same command and it gives me result 991. So I don't see any problem
there.
Comment 4•26 years ago
|
||
What did you test it under. It works fine in viewer, it just doesn't work in
apprunner.
Comment 5•26 years ago
|
||
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.
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Comment 6•26 years ago
|
||
Checked in afternoon, 3/29. Value is initialized to zero for cases where out
application (currently apprunner) doesn't provide this info.
Updated•26 years ago
|
Status: RESOLVED → REOPENED
Component: DOM Level 0 → Apprunner
Summary: window.innerWidth returns junk → window.innerWidth returns junk in apprunner.
Comment 7•26 years ago
|
||
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>
Comment 8•26 years ago
|
||
By mistake in product I said [apprunner as well as viewer]. This problem is just
for apprunner.
Comment 9•26 years ago
|
||
It happens on buld 03/31/99 also.
Comment 10•26 years ago
|
||
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.
Updated•26 years ago
|
Assignee: joki → rpotts
Status: REOPENED → NEW
Comment 11•26 years ago
|
||
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
Comment 12•26 years ago
|
||
Re-assigned to radha@netscape.com; set target milestone to M6; changed component
to XPApps, priority to P2, and platform and OS to All.
Updated•26 years ago
|
Status: NEW → ASSIGNED
Comment 13•26 years ago
|
||
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?
Comment 14•26 years ago
|
||
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?
Comment 15•26 years ago
|
||
Won't be here for M6. Moving to M7
Updated•26 years ago
|
Assignee: radha → don
Status: ASSIGNED → NEW
Comment 16•26 years ago
|
||
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.
Comment 17•26 years ago
|
||
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.
Comment 18•26 years ago
|
||
Reassign this to me. I'll take it.
Comment 19•26 years ago
|
||
OK, it's yours ...
Updated•26 years ago
|
Assignee: hyatt → danm
Comment 20•26 years ago
|
||
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. :)
Comment 21•26 years ago
|
||
Mass migration of minor danm bugs from M7 -> M8
Status: NEW → RESOLVED
Closed: 26 years ago → 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 22•26 years ago
|
||
hyatt stepped on this one as he was ambling by
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 23•26 years ago
|
||
Working fine now. Marking verified.
Comment 24•26 years ago
|
||
Updated•26 years ago
|
Status: VERIFIED → REOPENED
Summary: window.innerWidth returns junk in apprunner. → window.innerHeight AND window.innerWidth return wrong values.
Updated•26 years ago
|
Resolution: FIXED → ---
Comment 25•26 years ago
|
||
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);">
  innerHeight:<INPUT TYPE=text NAME="result" SIZE=20><br><br>
<input type="button" value="Check Window innerWidth" name="Reset2"
onClick="report1(window.innerWidth);">
  innerWidth:<INPUT TYPE=text NAME="result1" SIZE=20><br><br>
<input type="reset" value="Reset">
</form>
</body>
</html>
END OF CODE
Comment 26•26 years ago
|
||
Nisheeth, I know you've been by this code recently. Could you take a look at
this?
Updated•26 years ago
|
Target Milestone: M8 → M10
Comment 27•26 years ago
|
||
setting M10, since it is a regression.
Status: REOPENED → RESOLVED
Closed: 26 years ago → 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 28•26 years ago
|
||
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.)
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 29•26 years ago
|
||
Now, its working. Marking verified.
Updated•20 years ago
|
Product: Core → Mozilla Application Suite
You need to log in
before you can comment on or make changes to this bug.
Description
•