Bug 74718

Summary: onmousemove does not report proper values
Product: [Applications] konqueror Reporter: pete
Component: khtml ecmaAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Here is the test case I oncluded in the email

Description pete 2004-02-09 16:38:52 UTC
Version:           3.2.0 (using KDE 3.2.0 RC1,  (testing/unstable))
Compiler:          gcc version 3.3.3 20040110 (prerelease) (Debian)
OS:          Linux (i686) release 2.4.22-1-k7

As far as I can tell, the onmousemove event capturing does not report the proper clientY or pageY value. It is reporting the screenY value rather than the page value. Below is a sample page that isolates the failure.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>event.clientY Not working</title>
</head>
<script language="JavaScript1.2">
<!-- Begin
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;

function getMouseXY(e) 
{
	//tempX = event.clientX;
	//tempY = event.clientY;
	tempX = e.pageX;
	tempY = e.pageY;
	return true;
}

function reportMousePos()
{
	alert("Mouse is at: x " + tempX + " y " + tempY);
}
//-->
</script>
<body>
<a onclick="reportMousePos(); return true;">Click Here To Test Mouse Position</a>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a onclick="reportMousePos(); return true;">Click Here To Test Mouse Position</a>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a onclick="reportMousePos(); return true;">Click Here To Test Mouse Position</a>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a onclick="reportMousePos(); return true;">Click Here To Test Mouse Position</a>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a onclick="reportMousePos(); return true;">Click Here To Test Mouse Position</a>
</body>
</html>
Comment 1 pete 2004-02-09 16:45:23 UTC
Created attachment 4596 [details]
Here is the test case I oncluded in the email

You need to scroll to the bottom and click on each link, you will note that the
Y valuse never gets much higher than 700 even though it should be once you
scroll down the page.
Comment 2 Dirk Mueller 2004-02-11 04:14:40 UTC
CVS commit by mueller: 

unfiddle various mouse coordinate mess
CCMAIL: 74718-done@bugs.kde.org
CCMAIL: 70290-done@bugs.kde.org


  M +5 -0      ChangeLog   1.202
  M +11 -13    khtmlview.cpp   1.618
  M +25 -3     dom/dom2_events.cpp   1.12
  M +10 -2     dom/dom2_events.h   1.15
  M +6 -0      ecma/kjs_dom.cpp   1.171
  M +2 -6      ecma/kjs_events.cpp   1.82
  M +17 -6     xml/dom2_eventsimpl.cpp   1.44
  M +8 -2      xml/dom2_eventsimpl.h   1.39
  M +13 -10    xml/dom_nodeimpl.cpp   1.228