Bug 67783 - Preserve absolute position of mouse events while taking into account page scaling.
Summary: Preserve absolute position of mouse events while taking into account page sca...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Knottenbelt
URL:
Keywords:
Depends on:
Blocks: 68075
  Show dependency treegraph
 
Reported: 2011-09-08 08:47 PDT by John Knottenbelt
Modified: 2011-09-19 02:33 PDT (History)
2 users (show)

See Also:


Attachments
Patch (7.12 KB, patch)
2011-09-08 08:47 PDT, John Knottenbelt
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Knottenbelt 2011-09-08 08:47:11 PDT
Preserve absolute position of mouse events while taking into account page scaling.
Comment 1 John Knottenbelt 2011-09-08 08:47:36 PDT
Created attachment 106744 [details]
Patch
Comment 2 Fady Samuel 2011-09-08 15:57:43 PDT
Comment on attachment 106744 [details]
Patch

Make a static pageScaleFactor instead of modifying the static pageZoomFactor, please.
Comment 3 Darin Adler 2011-09-16 12:10:48 PDT
Comment on attachment 106744 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=106744&action=review

> Source/WebCore/dom/MouseRelatedEvent.cpp:122
> -    return frame->pageZoomFactor();
> +    return frame->pageZoomFactor() * frame->pageScaleFactor();

It’s not good to change what this function does, but leave its name the same. The function is named pageZoomFactor but no longer returns the page zoom factor. We don’t want to use two different names for the same thing.
Comment 4 John Knottenbelt 2011-09-19 02:33:44 PDT
I'm going to mark this bug as invalid, because my fix to pageX and pageY coordinates (https://bugs.webkit.org/show_bug.cgi?id=67592 ) caused this problem of accidentally modifying the event's absolute location. I reverted that change, so this bug is no longer necessary. 

It would, however, be nice to have a layout test that ensured the absolute positioning was preserved under the presence of page scaling. Some ideas on how to do this would be to use an <input type="range"> element, since this element processes the absolute location of the mouse event. 

Another possibility would be to extend EventSender or LayoutTestController to allow the extraction of the absolute location of the mouse event. However, this might be a bad idea since implementation details of the mouse event would be exposed in a test, making it more fragile.