Bug 40776

Summary: node.offsetTop, offsetLeft return 0 on A elements
Product: [Applications] konqueror Reporter: Chris King <chris.king>
Component: khtml rendererAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandrake RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Chris King 2002-04-11 21:17:01 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kjs
Version:           KDE 3.0.0 
Severity:          normal
Installed from:    Mandrake RPMs
Compiler:          n/a
OS:                Linux
OS/Compiler notes: Not Specified

the functions offsetTop and offsetLeft return 0 rather than the offset for links (A tags).  For example:

<html>
<body>
<a href="test.html">hello</a><br>
<a href="test2.html">hello</a>
<script language="JavaScript">
alert(document.getElementsByTagName("A")[1].offsetTop);
</script>
</body>
</html>

This should clearly return a non zero value we are retrieving the height of the second link (index 1) which is not at the top of the document.  Even the first link should not return 0 with default margins padding etc.

.offsetLeft does not work either in the same way (for links).

(Submitted via bugs.kde.org)
Comment 1 David Faure 2002-11-02 23:16:01 UTC
Fixed in CVS, thanks for the report. 
Comment 2 David Faure 2003-10-27 19:10:00 UTC
Unfortunately, it seems this is back in the current CVS of KDE.
But it works in Safari, so this is something to be merged...
Comment 3 Germain Garand 2004-02-17 12:12:24 UTC
not accurate in 3.2.0 but works fine in HEAD