clientX and clientY coordinates are incorrect

VERIFIED FIXED

Status

()

VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: bryner, Assigned: bryner)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

17 years ago
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)

Updated

17 years ago
Blocks: 112713
(Assignee)

Comment 1

17 years ago
Created attachment 61702 [details]
test case

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

17 years ago
Created attachment 61712 [details] [diff] [review]
patch to update child window bounds when scrolling
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

17 years ago
checked in.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 5

17 years ago
imho, bug 33226 should be duped against this one.

Comment 6

17 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.