Bug 67783

Summary: Preserve absolute position of mouse events while taking into account page scaling.
Product: WebKit Reporter: John Knottenbelt <jknotten>
Component: UI EventsAssignee: John Knottenbelt <jknotten>
Status: RESOLVED INVALID    
Severity: Normal CC: aroben, fsamuel
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 68075    
Attachments:
Description Flags
Patch none

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.