layerX/layerY wrong when mouse is over scrollbar
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mozilla Firefox |
New
|
Unknown
|
|||
firefox (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: firefox
When you have a DIV with scrollbars (overflow:scroll or overflow:auto) and connect a mouse handler like "onmousemove" to the div then event.layerX must contain the X mouse position relative to the upper left corner of the DIV. But this doesn't work in Firefox when the mouse is over the scrollbar. Firefox "wraps" the mouse position so it begins with X=0 at the left edge of the scrollbar. This is bad because in this way Javascript cannot determine if the mouse is over the scrollbar or if the mouse is on the left side of the DIV. Here is a demo:
http://
Move the mouse over the div and then move it to the right over the scrollbar and watch the displayed X coordinate wrapping from 186 to 1. Other browsers behave correctly. Tested it in IE, Safari, Konqueror and Opera. In my opinion the mouse events should not fire at all when the mouse pointer is over the scrollbar but my opinion is not important. So I think this should be fixed so Firefox behaves like all other browsers and don't "wrap" the mouse position.
I also tested the current Firefox Nightly Build and the problem is still present there.
ProblemType: Bug
Architecture: i386
Date: Mon Sep 3 13:26:05 2007
DistroRelease: Ubuntu 7.04
Package: firefox 2.0.0.6+1-0ubuntu1
PackageArchitec
SourcePackage: firefox
Uname: Linux vincent 2.6.20-16-generic #2 SMP Fri Aug 31 00:55:27 UTC 2007 i686 GNU/Linux
Changed in firefox: | |
status: | Unknown → New |
Changed in firefox: | |
importance: | Unknown → Medium |
Changed in firefox: | |
status: | New → Unknown |
Changed in firefox: | |
status: | Unknown → New |
Changed in firefox: | |
importance: | Medium → Unknown |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007092404 Minefield/3.0a9pre
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007092404 Minefield/3.0a9pre
When you have a DIV with scrollbars (overflow:scroll or overflow:auto) and connect a mouse handler like "onmousemove" to the div then event.layerX must contain the X mouse position relative to the upper left corner of the DIV. But this doesn't work in Firefox when the mouse is over the scrollbar. Firefox "wraps" the mouse position so it begins with X=0 at the left edge of the scrollbar. This is bad because in this way Javascript cannot determine if the mouse is over the scrollbar or if the mouse is on the left side of the DIV. Here is a demo:
http:// www.ailis. de/~k/permdata/ 20070903/ scrollbar. html
Move the mouse over the div and then move it to the right over the scrollbar and watch the displayed X coordinate wrapping from 186 to 1. Other browsers behave correctly. Tested it in IE, Safari, Konqueror and Opera. In my opinion the mouse events should not fire at all when the mouse pointer is over the scrollbar but my opinion is not important. So I think this should be fixed so Firefox behaves like all other browsers and don't "wrap" the mouse position.
This problem occurs in current nightly build and current stable version on Linux and Windows.
Reproducible: Always
Steps to Reproduce: www.ailis. de/~k/permdata/ 20070903/ scrollbar. html
1. Open
http://
2. Move mouse cursor over scrollbar
3. Notice the wrong mouse position
Actual Results:
Mouse position which can be retrieved with layerX/layerY is wrong. X and Y should be somewhere between 180 and 200 but they are between 0 and 20.
Expected Results:
X and Y position between 180 and 200 when mouse cursor is over scrollbar