If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

document.body.scrollHeight returning wrong value

RESOLVED INVALID

Status

()

Core
DOM
--
major
RESOLVED INVALID
14 years ago
5 years ago

People

(Reporter: xavier.loup, Unassigned)

Tracking

({regression, testcase})

Trunk
x86
Windows NT
regression, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5) Gecko/20030916
Build Identifier: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5) Gecko/20030916

I have the script which test if the page is longer than the window

// if (document.body.scrollHeight > document.body.clientHeight) {
// }

This script works fine with Mozilla 1.4 but fails with 1.5 RC1.
document.body.scrollHeight is always equal to document.body.clientHeight

This bug could be a duplicate of bugs 201803 and 209807

The size of the window is checked by many scripts.
The fact that it returns wrong values could create many bugs.

Reproducible: Always

Steps to Reproduce:
(Reporter)

Comment 1

14 years ago
I think this regression is due to the fix for bug 211030.
I changed my code to use document.documentElement (instead of document.body) and
it works now. 

Comment 2

14 years ago
Eiffel, what should we do with this bug? Is it really a bug, or just a
consequence of the fix for bug 211030? Please let us know, and resolve the bug
appropriately, thanks in advance!

Comment 3

14 years ago
Created attachment 135718 [details]
Testcase

Updated

14 years ago
Keywords: regression, testcase
(Reporter)

Comment 4

14 years ago
Sorry, i'm not able to decide alone if it's a regression or the consequence of a
fix.
It's ok for me to close this bug, because i have found another way to obtain the
data i need (document.documentElement).
The two values are different when there is enough content that we create
vertical scrollbars; otherwise they are the same.  That's consistent with
mapping body to the documentElement in quirks mode... so I don't see what the
bug is.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.