Closed
Bug 115198
Opened 23 years ago
Closed 23 years ago
clientX and clientY coordinates are incorrect
Categories
(Core :: DOM: Events, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: bryner, Assigned: bryner)
References
Details
Attachments
(2 files)
1.11 KB,
text/html
|
Details | |
1.08 KB,
patch
|
blizzard
:
superreview+
|
Details | Diff | Splinter Review |
Any time a frame on a web page has a view that has its own widget, any mouse
events within that frame get incorrect clientX and clientY coordinates if the
page is scrolled. Here's why:
Widgets keep their stored bounds in an nsRect (see nsWindow.cpp). The position
of this rect is only modified via calls to SetBounds() or Move(). As the user
scrolls, we don't update the bounds, so they continue to reflect the position
when the page was first reflowed. The code that computes clientX and clientY
relies on these bounds reflecting the position relative to the visible viewport.
This is automatic on Windows, because the OS is queried for the widget's
current position. On mac, the bounds remain correct because the bounds for
child windows are updated when nsWindow::Scroll is called.
Assignee | ||
Comment 1•23 years ago
|
||
To see the bug, load the test case and scroll the page down a bit. Now move
the mouse from the page into the inner div and watch clientY jump.
Assignee | ||
Comment 2•23 years ago
|
||
Comment 3•23 years ago
|
||
Comment on attachment 61712 [details] [diff] [review]
patch to update child window bounds when scrolling
r/sr=blizzard
Nice catch!
Attachment #61712 -
Flags: superreview+
Assignee | ||
Comment 4•23 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 6•23 years ago
|
||
verifying on build 2002-01-04-08-trunk linux RedHat
and build 2002-01-04-03-trunk windows 98
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•