Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 1964523002: Fix clientX/Y properties of touch pointer events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix zoom problem Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/PointerEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
index 1528d20163ce97e7746e7dda79ead3d038609fce..0aa9823293aecdb936e00e278c6bcba88ff8a43d 100644
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -423,13 +423,15 @@ void PointerEventManager::dispatchTouchPointerEvents(
WebInputEventResult result = WebInputEventResult::NotHandled;
// Do not send pointer events for stationary touches.
if (touchPoint.state() != PlatformTouchPoint::TouchStationary) {
- // TODO(crbug.com/608394): The adjustedPagePoint should be converted
- // to client coordinates.
+ float scaleFactor = 1.0f / touchInfo.targetFrame->pageZoomFactor();
+ FloatPoint scrollPosition = touchInfo.targetFrame->view()->scrollPosition();
+ FloatPoint framePoint = touchInfo.contentPoint;
+ framePoint.moveBy(scrollPosition.scaledBy(-scaleFactor));
PointerEvent* pointerEvent = m_pointerEventFactory.create(
pointerEventNameForTouchPointState(touchPoint.state()),
touchPoint, event.getModifiers(),
touchInfo.adjustedRadius,
- touchInfo.adjustedPagePoint);
+ framePoint);
// Consume the touch point if its pointer event is anything but NotHandled
// (e.g. preventDefault is called in the listener for the pointer event).

Powered by Google App Engine
This is Rietveld 408576698