Closed Bug 63492 Opened 24 years ago Closed 24 years ago

offsetHeight Not giving expected results

Categories

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

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: ivan, Assigned: jst)

References

()

Details

If I create a DIV containing a left aligned image (align="left") then offsetHeight for that DIV returns the height of the text in the DIV regardless of the height of the image. So, if the image extends below the bottom of the text, the returned value is incorrect. The above contains two DIV's, each with the same text but with different images. The onLoad event calls this function to report the offsetHeight of each DIV. function getHeight() { var msg = "Height of DIV w1 = " + document.getElementById("test1").offsetHeight; msg += "\nHeight of DIV 2 = " + document.getElementById("test2").offsetHeight; alert(msg); } This problem has been verified with Netscape 6 on Win2K and MacOS as well as Mozilla 0.6 on Win2K. Cheers Ivan
The issue here is that if an image is floated (which is what align="left" does) it no longer affects the height of its parent and can overflow it. Indeed, putting a border around the divs shows the large image overflowing its div. I believe this is correct CSS2 behavior, but changing qa to hixie for confirmation
Keywords: qawanted
QA Contact: vidur → ian
Looks like your right. Another example of me expecting it to behave like everything else.
So are you saying this is not a bug then? If so please mark as you see fit.
Isn't this bug 34398?
> Isn't this bug 34398? I don't think so. That one is about the effect of the blocks position relative to its' parent. > So are you saying this is not a bug then? Well, possibly. It could be a bug in the CSS spec (which is obviously not something to be dealt with here). But I am not a regular here and don't pretend to understand the language of the various specs enough to be really sure of anything. > If so please mark as you see fit. As a web developer and user I feel it is appropriate for me to raise possible issues. But, as I am not involved in the development, I'm not sure that it is my place to determine the validity of the "bug".
Marking WORKSFORME as per comments.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → WORKSFORME
Component: DOM Level 2 → DOM Style
Taking QA Contact on all open or unverified DOM Style bugs...
oops, not a style bug. No 'offsetHeight' in DOM2 Style AFAIK. DOM0?
Component: DOM Style → DOM Level 0
QA Contact: ian → desale
Verified with 2001-05-22-04.
Status: RESOLVED → VERIFIED
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.