ClientX/Y coordinates for touch pointer events are wrong |
|||||
Issue descriptionAfter some digging, PlatformTouchPoint::m_pos is in root frame coordinates (i.e. root's "client coordinates"). It comes from in WebInputEventConversion's PlatformTouchPointBuilder constructor. We should be changing the name from m_pos to m_positionInRootFrame. This means touchInfo.adjustedPagePoint is correct and the point there is in page coordinates, scaled by CSS zoom (i.e. in CSS pixels). However, the m_clientX/Y members of pointerEventInit expect to be in client coordinates so I think the current code is wrong. The error is at EventHandler::dispatchPointerEvents, we pass in the adjustedPagePoint even though sendTouchPointerEvent expects client coordinates. We have to convert from page to client coordinates. You do this by using the current FrameView's contentsToFrame to go from the frame's page coordinates to client.
,
May 3 2016
Marking it as a CodeHealth bug, to make the names clearer as Navid mentioned in #0 above.
,
May 5 2016
,
May 9 2016
,
May 10 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/52b840ceccfb1041681e0e85a61e9bcdee071b8a commit 52b840ceccfb1041681e0e85a61e9bcdee071b8a Author: nzolghadr <nzolghadr@chromium.org> Date: Tue May 10 21:18:27 2016 Fix clientX/Y properties of touch pointer events Before this change clientX/Y of touch pointer events were incorrectly set from content coordinates. But after this CL they are correctly translated by scroll position and will become clientX/Y. BUG= 608394 Review-Url: https://codereview.chromium.org/1964523002 Cr-Commit-Position: refs/heads/master@{#392722} [add] https://crrev.com/52b840ceccfb1041681e0e85a61e9bcdee071b8a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe-expected.txt [add] https://crrev.com/52b840ceccfb1041681e0e85a61e9bcdee071b8a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html [modify] https://crrev.com/52b840ceccfb1041681e0e85a61e9bcdee071b8a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp [modify] https://crrev.com/52b840ceccfb1041681e0e85a61e9bcdee071b8a/third_party/WebKit/Source/core/events/PointerEventFactory.h [modify] https://crrev.com/52b840ceccfb1041681e0e85a61e9bcdee071b8a/third_party/WebKit/Source/core/input/PointerEventManager.cpp [modify] https://crrev.com/52b840ceccfb1041681e0e85a61e9bcdee071b8a/third_party/WebKit/Source/core/input/TouchEventManager.cpp [modify] https://crrev.com/52b840ceccfb1041681e0e85a61e9bcdee071b8a/third_party/WebKit/Source/core/input/TouchEventManager.h
,
May 10 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by mustaq@chromium.org
, May 3 2016