From 9c3f8716aa3ce8ca612b4200c02a8530cfd599ba Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 22 Jan 2010 10:40:22 +0000 Subject: absoluteToLocal works with a page co-ordinate that is relative to the top left of the containing frame's document, so fix a bug in the WebCore touch event handler where the wrong page co-ordinates were being passed to the Touch construtor. This part of the change should be upstreamed to webkit. Also fix a crash when a touchCancel event is sent to a plugin because touchCancel, like touchend is not guaranteed to have data in touches, but will have data in changedTouches. Change-Id: I5345d7baf4e4325b24fbc5fbe60132dafb80e006 --- WebCore/plugins/android/PluginViewAndroid.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'WebCore/plugins/android/PluginViewAndroid.cpp') diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp index 41dc668..88e7f0b 100644 --- a/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/WebCore/plugins/android/PluginViewAndroid.cpp @@ -208,10 +208,10 @@ void PluginView::handleTouchEvent(TouchEvent* event) evt.data.touch.modifiers = 0; // todo - // In the event of a touchend (up) event, we must ask the changedTouch for the + // In the event of a touchend (up) or touchcancel event, we must ask the changedTouch for the // co-ordinates as there is no touch in touches anymore. - TouchList* touches = (evt.data.touch.action == kUp_ANPTouchAction) ? - event->changedTouches() : event->touches(); + TouchList* touches = (evt.data.touch.action == kUp_ANPTouchAction + || evt.data.touch.action == kCancel_ANPTouchAction) ? event->changedTouches() : event->touches(); // Convert to coordinates that are relative to the plugin. // We only support single touch points at the moment, so we want to look at index 0 only. -- cgit v1.1