Closed Bug 582722 Opened 15 years ago Closed 4 years ago

document.body.scrollWidth has a wrong value (to small)

Categories

(Core :: DOM: CSS Object Model, defect, P5)

x86
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: micha, Unassigned)

Details

(Keywords: testcase, Whiteboard: [cssom-view])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8 When I open a popup I like to resize it to the content. I know it was working before (about in June 2010), but sorry I can't say since which version of firefox it does not. Now I get the value back with whom I opened the popup window. On the other side the document.body.scrollHeight returns the right value. Reproducible: Always Steps to Reproduce: 1. I have a html document which opens a popup (excerpt) <script language="JavaScript"> function openPopUnder(gotourl){ var windowprops = "width=200,height=200,location=no,menubar=no,toolbar=no,scrollbars=no,resizable=no"; newWindow = window.open(gotourl,'NewWindow',windowprops); newWindow.blur(); window.focus(); } </script> </head> <body style="margin:0;padding:0;"> <a href="#" onclick="openPopUnder('test.html')">Testpopup</a> </body> 2. the second document is the test.html page (excerpt) <div id="container" style="width:545px; height:314px;">some text</div> <script language="JavaScript"> alert('w:'+document.body.scrollWidth+' h:'+document.body.scrollHeight); alert('w:'+document.getElementById('container').scrollWidth+' h:'+document.getElementById('container').scrollHeight); </script> Actual Results: the first alert returns w:200 h:314 the second one returns w:545 h:314 Expected Results: it should w:545 h:314 w:545 h:314 on https://developer.mozilla.org/en/DOM/element.scrollWidth I can read: scrollWidth is a read–only property that returns either the width in pixels of the content of an element or the width of the element itself, whichever is greater. If I get it right, the document.body.scrollWidth should return the higher value in my case the width of the div
Attached file the two pages
the two pages to see the bug
Version: unspecified → 3.6 Branch
Component: General → DOM: CSS Object Model
Keywords: testcase
Product: Firefox → Core
QA Contact: general → style-system
Whiteboard: [cssom-view]
Version: 3.6 Branch → unspecified
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5

The testcases are correctly displaying the width and height (w:545 h:314) in both alerts, using latest Nightly 95.0a1 under Win 10 64-bit, so I'm closing this bug as RWFM.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: