Bug 40776 - node.offsetTop, offsetLeft return 0 on A elements
Summary: node.offsetTop, offsetLeft return 0 on A elements
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-11 21:18 UTC by Chris King
Modified: 2004-02-17 12:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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