Closed Bug 10574 Opened 26 years ago Closed 25 years ago

Page coordinates in event object don't match real position

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: hhedberg, Assigned: joki)

References

()

Details

This bug is at least in Linux / M8. event.pageX and event.pageY values in event handlers don't match with real scrolled position. Actual values are cursor position in the viewable area which is wrong behavior. Included code produces following output when page has first scrolled to bottom: Browser Window Alert: pageY = 293 clientY = 293 screenY = 643 layerY = 1538 So the pageY value is same as clientY although is should be same as layerY. In Netscape Navigator 4.61 same code produces correct values: pageY = 1491 clientY = undefined screenY = 679 layerY = 1491 Code: <html> <head> <title>Bug</title> <script language="JavaScript"> function showCoords(e) { alert( "\npageY = " + e.pageY + "\nclientY = " + e.clientY + "\nscreenY = " + e.screenY + "\nlayerY = " + e.layerY ); return false; } function setup() { for( i = 0; i < 50; i++ ) document.links[ i ].onclick = showCoords; } </script> </head> <body onload="setup()"> <script language="JavaScript"> for( i = 0; i < 50; i++ ) document.writeln( '<p><a href="">' + i + " Is this long enoung?</a></p>" ); </script> </body> </html>
Target Milestone: M13
Target Milestone: M13 → M14
Moving off bugs that won't make M13
Target Milestone: M14 → M16
Moving M16.
Fix checked in.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Mass update: changing qacontact to ckritzer@netscape.com
QA Contact: janc → ckritzer
Updating QA Contact.
QA Contact: ckritzer → lorca
Reassigning QA Contact for all open and unverified bugs previously under Lorca's care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
QA contact updated
QA Contact: gerardok → madhur
VERIFIED ON BUILD 2001-07-30-08-TRUNK
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.