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.
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.
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+
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
imho, bug 33226 should be duped against this one.
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.