KHTML offsetTop issue with latest HierMenus code

David Joham djoham at yahoo.com
Mon Jan 26 00:34:02 GMT 2004


Hello all,

I'm back with more HierMenus issues :)

The author of HierMenus is trying to do some positioning of elements based on the browser's
offsetTop and offsetLeft values. The issue that he is running into with KHTML is that if an
element is not absolute positioned, its offsetTop and offsetLeft values do not consider the
margins of the body. However, if the element is absolute positioned, the offsetTop and offsetLeft
values do consider the margins of the body. 

This difference in behavior results in some odd positioning and is goofing up his menus since
KHTML also does not give reliable data as to whether or not an element is absolute positioned or
not. Similar to Mozilla, if an element's position is specified in the class attribute and an
external (or inline) stylesheet, element.style.position always returns blank - even when a
position has been defined. When the positioning has been defined in the style attribute, then
element.style.position returns valid data.

I've attached a test case that demonstrates the problem of the body margins on non-absolute
positioned elements. I'm also wondering if this issue is similar to bug 54911. Any thoughts on how
hard this would be to fix? And the real kicker question: Can this be fixed for 3.2?

Best regards,

David Joham

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040125/c2c65206/attachment.html>


More information about the kfm-devel mailing list