Closed Bug 9606 Opened 25 years ago Closed 24 years ago

setting window.innerWidth does not size window correctly

Categories

(Core :: DOM: Core & HTML, defect, P2)

x86
Windows 95
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: christian, Assigned: danm.moz)

References

Details

(Keywords: testcase, Whiteboard: [nsbeta2-][nsbeta3+])

Attachments

(1 file)

Overview Description:
setting window.innerWidth does not work correctly

Steps to reproduce:
1) Load the attachment
2 [details] [diff] [review]) note that window.[inner|outer]Width is read, set and read again.

Actual Results:
window.innerWidth = [depending on browser size]
window.outerWidth = [depending on browser size]

Setting window.outerWidth to 800
window.innerWidth = 780
window.outerWidth = 800

Setting window.innerWidth to 700
window.innerWidth = 692
window.outerWidth = 712

Expected results:
[as above; last three lines as follows:]
Setting window.innerWidth to 700
window.innerWidth = 700
window.outerWidth = 720

Build Date & Platform:
1999070917 build (Win32); on M7 (Win32), the last three lines are set as
follows:
Setting window.innerWidth to 700
window.innerWidth = 688
window.outerWidth = 700
Summary: setting window.innerWidth and window.outerWidth implementation incorrect → setting window dimensions implementation incorrect
Whiteboard: [TESTCASE] writing window.innerWidth does not work as expected
Is the actual size of the window correct?  Rather, is the bug that the new value
of window.*Height misreported, or that the window is incorrectly sized?

I don't think this is a beta-stopper.
HTML DOM bugs are M11/P2 for Vidur.
Assignee: vidur → danm
Passing along to DanM (and cc:ing joki).
mass-moving most m11 bugs to m12
Mass-moving non-PDT+ bugs to M13
Status: NEW → ASSIGNED
Target Milestone: M13 → M14
related to 17311,18104,19003
Bulk moving [testcase] code to new testcase keyword. Sorry for the spam!
Keywords: testcase
bulk moving all window-size-off-by-a-couple-of-pixels bugs to more distant 
milestone.
Target Milestone: M14 → M18
*** Bug 24118 has been marked as a duplicate of this bug. ***
Mass moving M18 bugs to M19
Target Milestone: M18 → M19
Some of the M16 nightly builds (eg. ID: 2000041808) had the window.innerWidth 
function working nearly properly (off by one pixel in either direction as 
opposed to the width of the scrollbar in earlier builds).  Since M15 has been 
release and, I assume, code changes have been rolled in, the browser has 
reverted to its original behavior.  Just a heads up.
Nominating nsbeta2. We have to start drawing a line on DOM0 backward 
compatibility; these bugs are supposed to be a high priority for nsbeta2 per the 
beta2 criteria. (Dan, if you're swamped, then we should see if we can get help 
for you on these.)
Keywords: nsbeta2
mass-moving all bugs to m21 that are not dogfood+ or nsbeta2+ or nsbeta2-
Target Milestone: M19 → M21
Changing Summary from "setting window dimensions implementation incorrect" to 
"setting window.innerWidth does not size window correctly". M17. Setting to 
[nsbeta2+][6/15]. nsbeta3 stopper if doesn't make nsbeta2.
Summary: setting window dimensions implementation incorrect → setting window.innerWidth does not size window correctly
Whiteboard: [TESTCASE] writing window.innerWidth does not work as expected → [nsbeta2+][6/15]
Target Milestone: M21 → M17
Target Milestone: M17 → M20
Since this probably won't make nsbeta2, nom. nsbeta3 & rtm, *strongly* recc. 
nsbeta3 hard-stop. This JavaScript property is widely used ever since Nav4 and 
there is no standards-based equivalent in the W3C DOM; either this works 
correctly, or we've got no way to specify the window's inner width. Both content 
sites and web applications need the ability to control the size of the 
window--and often one needs to do that in terms of the inner (content area) 
width, not the outer (content area + chrome) width. Getting this correct by rtm 
is a critical part of our web content and web application platform.
Keywords: nsbeta3, rtm
Cleaning up status whiteboard by marking beta2 minus (6/15 has passed)

Folks or too doomed to handle this for beta2
Whiteboard: [nsbeta2+][6/15] → [nsbeta2-]
nsbeta3+
Whiteboard: [nsbeta2-] → [nsbeta2-][nsbeta3+]
Target Milestone: M20 → M18
*** Bug 42544 has been marked as a duplicate of this bug. ***
I haven't figured out how to get the source for the test case from the 
attachment. So I basically wrote another. Here's my test case:

<html><head><script>
  var orgWidth, orgHeight;
  function saveSize() {
    orgWidth = outerWidth;
    orgHeight = outerHeight;
  }
  function restoreSize() {
    outerWidth = orgWidth;
    outerHeight = orgHeight;
  }
  function sizeDescription() {
    var sizeStr;
    sizeStr = "<h5>current window dimensions</h5>";
    sizeStr += "inner Width "+innerWidth+"<br>inner Height "+innerHeight+"<br>";
    sizeStr += "outer Width "+outerWidth+"<br>outer Height "+outerHeight+"<br>";
    return sizeStr;
  }
  function testSizing() {
    var testStr;
    saveSize();
    testStr = "<h4>Beginning</h4>" + sizeDescription();
    outerWidth = 800;
    testStr += "<h4>Setting outer width to 800</h4>" + sizeDescription();
    innerWidth = 800;
    testStr += "<h4>Setting inner width to 800</h4>" + sizeDescription();
    restoreSize();
    document.write(testStr);
  }
</script></head><body>
<form><input type=button value="Test Sizing" onclick="testSizing()"></form>
</body></html>

Works fine with today's build. It returns slightly different numbers than Nav 4 
-- as it should; the size of our chrome is different. But the important things: 
innnerWidth after innerWidth is set, and outerWidth after outerWidth is set, are 
all correct. Calling it fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
Verified with 2000-08-09-08.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: